Skip to content

Commit bb42e9d

Browse files
nateboschcommit-bot@chromium.org
authored andcommitted
Allow lints in status file tests and front_end
See comments on https://dart-review.googlesource.com/c/sdk/+/106726 - Add a `should_skip` argument to `_CheckFormat` to suppress warnings in files that are opted out of format checking. - Skip status file lint checks for files under "pkg/status_file/test/data" and "pkg/front_end". Change-Id: I485cf32c5193bbbc7ef2b92bfc401399acda85c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106925 Reviewed-by: Alexander Thomas <athom@google.com> Commit-Queue: Nate Bosch <nbosch@google.com>
1 parent 1f99240 commit bb42e9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

PRESUBMIT.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818

1919
def _CheckFormat(input_api, identification, extension, windows,
20-
hasFormatErrors):
20+
hasFormatErrors, should_skip = lambda path : False):
2121
local_root = input_api.change.RepositoryRoot()
2222
upstream = input_api.change._upstream
2323
unformatted_files = []
2424
for git_file in input_api.AffectedTextFiles():
2525
if git_file.LocalPath().startswith("pkg/front_end/testcases/"):
2626
continue
27+
if should_skip(git_file.LocalPath()):
28+
continue
2729
filename = git_file.AbsoluteLocalPath()
2830
if filename.endswith(extension) and hasFormatErrors(filename=filename):
2931
old_version_has_errors = False
@@ -147,8 +149,12 @@ def HasFormatErrors(filename=None, contents=None):
147149
process.communicate(input=contents)
148150
return process.returncode != 0
149151

152+
def should_skip(path):
153+
return (path.startswith("pkg/status_file/test/data/")
154+
or path.startswith("pkg/front_end/"))
155+
150156
unformatted_files = _CheckFormat(input_api, "status file", ".status",
151-
windows, HasFormatErrors)
157+
windows, HasFormatErrors, should_skip)
152158

153159
if unformatted_files:
154160
normalize = os.path.join(local_root, 'pkg', 'status_file', 'bin',

0 commit comments

Comments
 (0)