Closed
Bug 1433410
(codespell)
Opened 7 years ago
Closed 7 years ago
Add codespell support for mach lint
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox60 fixed)
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
I am trying to integrate this tool: https://github.com/lucasdemarchi/codespell/ Example: ./mach lint -l codespell tools/lint/docs/linters/eslint-plugin-mozilla.rst tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js For now, --fix isn't managed because of https://github.com/lucasdemarchi/codespell/issues/314 I can ignore the warning but cannot ignore the autofix as it would require to patch codespell itself.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8945745 [details] Bug 1433410 - Add codespell support for mach lint https://reviewboard.mozilla.org/r/215852/#review221754 ::: tools/lint/codespell.yml:5 (Diff revision 1) > +--- > +codespell: > + description: Check code for common misspellings > + include: ['.'] > + exclude: [] We should at least add `third_party` here. Alternatively we could block on fixing bug 1433522 and bug 1375861 first. ::: tools/lint/spell/__init__.py:94 (Diff revision 1) > + if not binary: > + print(CODESPELL_NOT_FOUND) > + if 'MOZ_AUTOMATION' in os.environ: > + return 1 > + return [] This is fine for now because there's precedent.. but at some point we'll need to make bootstrapping these things easier. Maybe with a bit of refactoring we can import `mozboot` (the library behind |mach bootstrap|) and re-use the code in there to get things installed. ::: tools/lint/spell/__init__.py:103 (Diff revision 1) > + return [] > + > + config['root'] = lintargs['root'] > + cmd_args = [binary, > + '--disable-colors', > + # Silent some warnings: nit: Silence
Attachment #8945745 -
Flags: review?(ahalberstadt) → review+
Comment hidden (mozreview-request) |
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e414096f1c3b Add codespell support for mach lint r=ahal
Comment 5•7 years ago
|
||
Backed out changeset e414096f1c3b (bug 1433410) for yaml lint failures in tools/lint/codespell.yml:12:81 on a CLOSED TREE https://hg.mozilla.org/integration/autoland/rev/e414096f1c3b8fe55c1da6344c87c2df26e28b8c https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=01e0ee57f2f9e3334ab31142d07349784fbfaf40&filter-classifiedState=unclassified&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception
Comment hidden (mozreview-request) |
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3eefd4e1087c Add codespell support for mach lint r=ahal
Assignee | ||
Comment 8•7 years ago
|
||
I reported https://github.com/mozilla-releng/services/issues/796 about comment #5
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3eefd4e1087c
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Comment 10•7 years ago
|
||
Can we have a dev-platform+fx-dev post about this? I was confused when I suddenly got warning messages about codespell ("Unable to locate codespell, ...") when using `hg commit`.
Flags: needinfo?(sledru)
Assignee | ||
Comment 11•7 years ago
|
||
Sure but, before, I would like to have it running at review phase on all patches which aren't touching thirdparty code.
Flags: needinfo?(sledru)
Comment 12•7 years ago
|
||
(In reply to Sylvestre Ledru [:sylvestre] from comment #11) > Sure but, before, I would like to have it running at review phase on all > patches which aren't touching thirdparty code. OK. It's up to you. I was just surprised because things relating to the build and/or linting hooks changed (ie I got error/warning messages that made no sense to me ("You don't have this thing you've never heard of and didn't know you needed, here's how to get it!") without warning beforehand. I would imagine I'm not the only person who's surprised...
Comment 13•7 years ago
|
||
Yeah, that's fair. In hindsight I should have ensured that there was some kind of automated bootstrapping before granting review, that was my fault. We filed bug 1434337 and bug 1434332 to codify the rules for adding new linters to the tree a bit. I'm also in the progress of hooking up lint dependency installation to |mach bootstrap|, and I'll add bootstrapping code for shellcheck and codespell while I'm at it.
Updated•7 years ago
|
Product: Testing → Firefox Build System
Assignee | ||
Updated•5 years ago
|
Alias: codespell
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•