Bug 1405654 - set default value for header-filter the same as source. r?sylvestre
MozReview-Commit-ID: 705as3mM1dA
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2228,18 +2228,22 @@ class StaticAnalysis(MachCommandBase):
if checks == '-*':
checks = self._get_checks()
common_args = ['-clang-tidy-binary', self._clang_tidy_path,
'-checks=%s' % checks,
'-extra-arg=-DMOZ_CLANG_PLUGIN']
- if len(header_filter):
- common_args.append('-header-filter=%s' % header_filter)
+ # Flag header-filter is passed to 'run-clang-tidy' in order to limit
+ # the diagnostic messages only to the specified header files.
+ # When no value is specified the default value is considered to be the source
+ # in order to limit the dianostic message to the source files or folders.
+ common_args.append('-header-filter=%s' %
+ (header_filter if len(header_filter) else ''.join(source)))
if fix:
common_args.append('-fix')
self.log_manager.register_structured_logger(logging.getLogger('mozbuild'))
compile_db = json.loads(open(self._compile_db, 'r').read())
total = 0