Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 1610315

Browse files
committed
Bug 1403846 - add "header-filter" option argument to static-analysis from mach. r=sylvestre
MozReview-Commit-ID: GulGPCCi9U4
1 parent 7ee5780 commit 1610315

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

python/mozbuild/mozbuild/mach_commands.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,8 +2205,12 @@ def static_analysis(self):
22052205
help='Strip NUM leading components from file names in diff mode.')
22062206
@CommandArgument('--fix', '-f', default=False, action='store_true',
22072207
help='Try to autofix errors detected by clang-tidy checkers.')
2208+
@CommandArgument('--header-filter', '-h-f', default='', metavar='header_filter',
2209+
help='Regular expression matching the names of the headers to '
2210+
'output diagnostics from. Diagnostics from the main file '
2211+
'of each translation unit are always displayed')
22082212
def check(self, source=None, jobs=2, strip=1, verbose=False,
2209-
checks='-*', fix=False):
2213+
checks='-*', fix=False, header_filter=''):
22102214
self._set_log_level(verbose)
22112215
rc = self._build_compile_db(verbose=verbose)
22122216
if rc != 0:
@@ -2228,6 +2232,10 @@ def check(self, source=None, jobs=2, strip=1, verbose=False,
22282232
common_args = ['-clang-tidy-binary', self._clang_tidy_path,
22292233
'-checks=%s' % checks,
22302234
'-extra-arg=-DMOZ_CLANG_PLUGIN']
2235+
2236+
if len(header_filter):
2237+
common_args.append('-header-filter=%s' % header_filter)
2238+
22312239
if fix:
22322240
common_args.append('-fix')
22332241

0 commit comments

Comments
 (0)