Bug 1579845 - ride along: codespell Add support of exclude: r=ahal
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 30 Sep 2019 13:44:55 +0000
changeset 495683 1e0061521d8669f562e052fc944d62b2ab790309
parent 495682 b3b54d11c02edeb383b1046f2ef535d247b3524e
child 495684 38005dfbfc8cdca978ab4ec35552317f30089736
push id114140
push userdvarga@mozilla.com
push dateWed, 02 Oct 2019 18:04:51 +0000
treeherdermozilla-inbound@32eb0ea893f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1579845
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1579845 - ride along: codespell Add support of exclude: r=ahal Differential Revision: https://phabricator.services.mozilla.com/D45489
tools/lint/spell/__init__.py
--- a/tools/lint/spell/__init__.py
+++ b/tools/lint/spell/__init__.py
@@ -108,29 +108,30 @@ def lint(paths, config, fix=None, **lint
     binary = get_codespell_binary()
     if not binary:
         print(CODESPELL_NOT_FOUND)
         if 'MOZ_AUTOMATION' in os.environ:
             return 1
         return []
 
     config['root'] = lintargs['root']
+
+    skip_files = '--skip=*.dic,{}'.format(','.join(config['exclude']))
+
     exclude_list = os.path.join(here, 'exclude-list.txt')
     cmd_args = [binary,
                 '--disable-colors',
                 # Silence some warnings:
                 # 1: disable warnings about wrong encoding
                 # 2: disable warnings about binary file
                 # 4: shut down warnings about automatic fixes
                 #    that were disabled in dictionary.
                 '--quiet-level=7',
                 '--ignore-words=' + exclude_list,
-                # Ignore dictonnaries
-                '--skip=*.dic',
-                ]
+                skip_files]
 
     if fix:
         cmd_args.append('--write-changes')
     log.debug("Command: {}".format(' '.join(cmd_args)))
 
     base_command = cmd_args + paths
 
     run_process(config, base_command)