Closed Bug 1455086 Opened 6 years ago Closed 6 years ago

codespell: add an exclude list

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

Details

Attachments

(1 file)

We have some Mozilla specific words. I propose that we add an exclude list.
Comment on attachment 8969028 [details]
Bug 1455086 - codespell: add an exclude list

https://reviewboard.mozilla.org/r/237714/#review243674

Thanks, lgtm!

::: tools/lint/spell/__init__.py:101
(Diff revision 1)
> +    path_to_exclude_list = os.path.join(
> +        config['root'], "tools", "lint", "spell", "exclude-list.txt")

This is fine, so feel to ignore. But it might be better to find the path relative to this one (so we can move directories around easier).

At the top of the file:

    here = os.path.abspath(os.path.dirname(__file__))
    
Then:

    exclude_list = os.path.join(here, 'exclude-list-txt')

::: tools/lint/spell/__init__.py:112
(Diff revision 1)
>                  # 2: disable warnings about binary file
>                  # 4: shut down warnings about automatic fixes
>                  #    that were disabled in dictionary.
>                  '--quiet-level=4',
> +                '--ignore-words=' + path_to_exclude_list,
> +                '--skip=exclude-list.txt',

Shouldn't this also use the `path_to_exclude_list` variable?
Attachment #8969028 - Flags: review?(ahalberstadt) → review+
Comment on attachment 8969028 [details]
Bug 1455086 - codespell: add an exclude list

https://reviewboard.mozilla.org/r/237714/#review243674

> Shouldn't this also use the `path_to_exclude_list` variable?

codespell can handle just the filename:
Example:
./mach lint -l codespell -n tools/lint/spell/exclude-list.txt
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e73fe9c25c94
codespell: add an exclude list r=ahal
Blocks: 1455451
https://hg.mozilla.org/mozilla-central/rev/e73fe9c25c94
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.