Add a linter to identify identifier misspellings
Categories
(Developer Infrastructure :: Lint and Formatting, task, P4)
Tracking
(Not tracked)
People
(Reporter: ehsan.akhgari, Unassigned)
References
Details
Examples of where this could have been useful: bug 1585058 and bug 1578304.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•4 years ago
|
||
What linters covers for this type of facility, As far as I know codespell comes close to this but It works only for English errors
. I will like to work on this.
Requesting information from :sylvestre as :ahal is PTO till march.
Comment 2•4 years ago
|
||
for coverity, andi is the expert :)
Updated•4 years ago
|
Comment 3•3 years ago
|
||
Another example where this could have been useful: https://bugzilla.mozilla.org/show_bug.cgi?id=1714177.
Comment 4•3 years ago
|
||
And also: https://phabricator.services.mozilla.com/D114998.
We don't have to rely on Coverity for this, we could use something like https://github.com/aotaduy/eslint-plugin-spellcheck, or even write a custom analyzer which builds a DB of all identifiers, and checks if the new added one is likely a misspelling of an already existing identifier.
Comment 5•3 years ago
|
||
Or we could use codespell or typos.
Comment 6•3 years ago
|
||
Yeah was just about to say we have codespell already:
https://searchfox.org/mozilla-central/source/tools/lint/codespell.yml
But it only runs on a set of explicitly included directories which is why it didn't catch the error in bug 1714177. Transitioning it to an exclude list might be a good first step.
Bug 1548485 talks about enabling it for source files, but that appears to already be done. It's just enabling it across a wider set of directories that remains.
Comment 7•3 years ago
|
||
Dunno if it is worth the effort.
codespell can fix most of the issues but when there are ambiguities, we need a human.
Example:
aborte can be aborted, abort or aborts
but it could be good first bugs to learn workflows
Comment 8•3 years ago
|
||
(In reply to Sylvestre Ledru [:Sylvestre] from comment #7)
Dunno if it is worth the effort.
codespell can fix most of the issues but when there are ambiguities, we need a human.Example:
aborte can be aborted, abort or abortsbut it could be good first bugs to learn workflows
Maybe not super useful for docs and comments, but for identifiers it could be (we already have at least three bugs linked here that would have been prevented, two of which even required uplift to Beta).
Updated•2 years ago
|
Updated•2 years ago
|
Description
•