From 840fb94f9b371f6555536de2c32953c967c1122a Mon Sep 17 00:00:00 2001 From: Watson Sato Date: Tue, 21 Jan 2020 14:17:00 +0100 Subject: [PATCH 1/2] Don't check for path len of logs directory The logs are not part of the tarball, nor used to build the content. --- tests/ensure_paths_are_short.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ensure_paths_are_short.py b/tests/ensure_paths_are_short.py index 5d4e27cb91..18d4c662ff 100755 --- a/tests/ensure_paths_are_short.py +++ b/tests/ensure_paths_are_short.py @@ -13,6 +13,10 @@ def main(): ssg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) max_path = "" for dir_, _, files in os.walk(ssg_root): + # Don't check for path len of log files + # They are not shipped nor used during build + if "tests/logs/" in dir_: + continue for file_ in files: path = os.path.relpath(os.path.join(dir_, file_), ssg_root) if len(path) > len(max_path): From 8d29c78efc51cc2c2da0e436b3cd9a2edb5342bc Mon Sep 17 00:00:00 2001 From: Watson Sato Date: Tue, 21 Jan 2020 15:05:17 +0100 Subject: [PATCH 2/2] Skip only only tests/logs/ from project root --- tests/ensure_paths_are_short.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ensure_paths_are_short.py b/tests/ensure_paths_are_short.py index 18d4c662ff..b9e985fea0 100755 --- a/tests/ensure_paths_are_short.py +++ b/tests/ensure_paths_are_short.py @@ -15,7 +15,8 @@ def main(): for dir_, _, files in os.walk(ssg_root): # Don't check for path len of log files # They are not shipped nor used during build - if "tests/logs/" in dir_: + current_relative_path = os.path.relpath(dir_, ssg_root) + if current_relative_path.startswith("tests/logs/"): continue for file_ in files: path = os.path.relpath(os.path.join(dir_, file_), ssg_root)