summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
author Hsin-chen Chuang <chharry@google.com> 2024-06-07 01:07:08 +0800
committer Hsin-chen Chuang <chharry@google.com> 2024-06-07 13:24:41 +0800
commitbcd7b636f035001932eaca5400a8150774d84636 (patch)
tree918d425c1e0c624fcb45e10ef103a6e034a550af /build.py
parentbc8d7d3ebf391c9d756e0a441abbd0a2b26a9d73 (diff)
floss: build.py: Add clippy target
Bug: 343315863 Tag: #floss Test: mmm packages/modules/Bluetooth Test: ./build.py --target clippy Flag: EXEMPT, Floss-only changes Change-Id: Ia7bbcc4128b48ea0f69d97b11aa14a48d88bccf9
Diffstat (limited to 'build.py')
-rwxr-xr-xbuild.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.py b/build.py
index 8c17ddd3a4..0b51e3367a 100755
--- a/build.py
+++ b/build.py
@@ -76,6 +76,7 @@ VALID_TARGETS = [
'prepare', # Prepare the output directory (gn gen + rust setup)
'rust', # Build only the rust components + copy artifacts to output dir
'test', # Run the unit tests
+ 'clippy', # Run cargo clippy
'utils', # Build Floss utils
]
@@ -494,6 +495,12 @@ class HostBuild():
cwd=os.path.join(self.output_dir),
env=self.env)
+ def _target_clippy(self):
+ """ Runs cargo clippy, a collection of lints to catch common mistakes.
+ """
+ cmd = ['cargo', 'clippy']
+ self.run_command('rust', cmd, cwd=os.path.join(self.platform_dir, 'bt'), env=self.env)
+
def _target_utils(self):
""" Builds the utility applications.
"""
@@ -605,6 +612,8 @@ class HostBuild():
self._target_main()
elif self.target == 'test':
self._target_test()
+ elif self.target == 'clippy':
+ self._target_clippy()
elif self.target == 'clean':
self._target_clean()
elif self.target == 'install':