From 7a81ebf1117ec04c83a6a47a935547ce17f93b4b Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Tue, 3 Jan 2023 18:36:18 +0000 Subject: [PATCH] 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 Auto-Submit: Bruce Dawson Reviewed-by: Collin Baker Reviewed-by: Gavin Mak --- presubmit_support.py | 2 +- tests/presubmit_unittest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/presubmit_support.py b/presubmit_support.py index ceefc0809a..2b30d48a0d 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -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 diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index c77a41a26f..483227f533 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -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$',)