Add .rs to list of presubmit source file patterns

.rs files were not part of DEFAULT_FILES_TO_CHECK which means that they
were not being checked for proper licenses, among other things.

Testing with this command reveals that six missing or bad licenses have
crept in:

    git cl presubmit --force --files "*.rs"

Output was:

Found a bad license header in these files:
  build\rust\tests\test_aliased_deps\main.rs
  build\rust\tests\test_aliased_deps\real_name.rs
  mojo\public\rust\tests\util\mojom_validation.rs
  testing\rust_gtest_interop\gtest_attribute.rs
  tools\crates\gnrt\sample_package\foo\src\lib.rs
  tools\crates\gnrt\sample_package\src\main.rs

Change-Id: Ia7788d92d428a4060f4a0b854fdcee0450b0a3f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4128762
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Collin Baker <collinbaker@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
changes/62/4128762/3
Bruce Dawson 3 years ago committed by LUCI CQ
parent 5b0c934026
commit 7a81ebf111

@ -573,7 +573,7 @@ class InputApi(object):
r'.+\.pm$',
# Other
r'.+\.java$', r'.+\.mk$', r'.+\.am$', r'.+\.css$', r'.+\.mojom$',
r'.+\.fidl$'
r'.+\.fidl$', r'.+\.rs$',
)
# Path regexp that should be excluded from being considered containing source

@ -1399,7 +1399,7 @@ class InputApiUnittest(PresubmitTestsBase):
def testDefaultOverrides(self):
input_api = presubmit.InputApi(
self.fake_change, './PRESUBMIT.py', False, None, False)
self.assertEqual(len(input_api.DEFAULT_FILES_TO_CHECK), 25)
self.assertEqual(len(input_api.DEFAULT_FILES_TO_CHECK), 26)
self.assertEqual(len(input_api.DEFAULT_FILES_TO_SKIP), 12)
input_api.DEFAULT_FILES_TO_CHECK = (r'.+\.c$',)

Loading…
Cancel
Save