Bug 1447817 - correlate mach static-analysis documentation with configuration file. r?sylvestre draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Sat, 24 Mar 2018 13:01:04 +0200
changeset 771984 71800211609245dd55d93bebe0d48f2a17457e49
parent 771980 945baa8bc9603cd870bf0f9806b437506765fe15
push id103816
push userbmo:bpostelnicu@mozilla.com
push dateSat, 24 Mar 2018 11:01:43 +0000
reviewerssylvestre
bugs1447817
milestone61.0a1
Bug 1447817 - correlate mach static-analysis documentation with configuration file. r?sylvestre MozReview-Commit-ID: FB296IBeKOk
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1612,17 +1612,18 @@ class StaticAnalysis(MachCommandBase):
                           'Can be omitted, in which case the entire code base '
                           'is analyzed.  The source argument is ignored if '
                           'there is anything fed through stdin, in which case '
                           'the analysis is only performed on the files changed '
                           'in the patch streamed through stdin.  This is called '
                           'the diff mode.')
     @CommandArgument('--checks', '-c', default='-*', metavar='checks',
                      help='Static analysis checks to enable.  By default, this enables only '
-                     'custom Mozilla checks, but can be any clang-tidy checks syntax.')
+                     'checks that are published here: https://mzl.la/2DRHeTh, but can be any '
+                     'clang-tidy checks syntax.')
     @CommandArgument('--jobs', '-j', default='0', metavar='jobs', type=int,
                      help='Number of concurrent jobs to run. Default is the number of CPUs.')
     @CommandArgument('--strip', '-p', default='1', metavar='NUM',
                      help='Strip NUM leading components from file names in diff mode.')
     @CommandArgument('--fix', '-f', default=False, action='store_true',
                      help='Try to autofix errors detected by clang-tidy checkers.')
     @CommandArgument('--header-filter', '-h-f', default='', metavar='header_filter',
                      help='Regular expression matching the names of the headers to '
@@ -1726,17 +1727,17 @@ class StaticAnalysis(MachCommandBase):
 
     @StaticAnalysisSubCommand('static-analysis', 'print-checks',
                               'Print a list of the static analysis checks performed by default')
     def print_checks(self, verbose=False):
         self._set_log_level(verbose)
         rc = self._get_clang_tools(verbose=verbose)
         if rc != 0:
             return rc
-        args = [self._clang_tidy_path, '-list-checks', '-checks=-*,mozilla-*']
+        args = [self._clang_tidy_path, '-list-checks', '-checks=%s' % self._get_checks()]
         return self._run_command_in_objdir(args=args, pass_thru=True)
 
     @Command('clang-format',  category='misc', description='Run clang-format on current changes')
     @CommandArgument('--show', '-s', action='store_true', default=False,
                      help='Show diff output on instead of applying changes')
     @CommandArgument('--path', '-p', nargs='+', default=None,
                      help='Specify the path(s) to reformat')
     def clang_format(self, show, path, verbose=False):