From dc84b2708f7c92417bf2ac5d6dc0307d7e388f7f Mon Sep 17 00:00:00 2001 From: Ben Pastene Date: Tue, 19 Aug 2025 16:26:24 -0700 Subject: [PATCH] Uncap max line length for *.star files In https://crrev.com/c/6697693, presubmit's canned formatting checks started looking at *.star files. This included enforcing a max line length of 80 chars in such files. Most (all?) *.star files found in gclient-managed repos are lucicfg client repos, which generally have their own formatter and use 4-space indents. This can lead to some friction with presubmit's 80 char limit. So this uncaps that limit for all *.star files. Bug: None Change-Id: Ice68676c5d097d7951e83cf81ca9ac8adc8151ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6862147 Reviewed-by: Scott Lee Commit-Queue: Ben Pastene --- presubmit_canned_checks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 59182f889e..fcc5a06dfc 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -624,6 +624,11 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None): PY_FILE_EXTS = ('py', ) PY_EXCEPTIONS = ('import', 'from', '# ' + LINT_THEN_CHANGE_EXCEPTION) + # Uncap star files. For more info, see: + # https://bazel.build/build/style-guide#differences-python-style-guide + STAR_FILE_EXTS = ('star', ) + STAR_EXCEPTIONS = ('', ) + LANGUAGE_EXCEPTIONS = [ (CPP_FILE_EXTS, CPP_EXCEPTIONS), (HTML_FILE_EXTS, HTML_EXCEPTIONS), @@ -632,6 +637,7 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None): (TS_FILE_EXTS, TS_EXCEPTIONS), (OBJC_FILE_EXTS, OBJC_EXCEPTIONS), (PY_FILE_EXTS, PY_EXCEPTIONS), + (STAR_FILE_EXTS, STAR_EXCEPTIONS), ] def no_long_lines(file_extension, line):