Page MenuHomePhabricator

[LINTER] Add a spell checker to arcanist
ClosedPublic

Authored by Fabien on Jun 5 2019, 17:43.

Details

Summary

This is not the same spell checker that the one used by core, but it
avoids adding another dependency and it runs faster. The dictionary is
also smaller but easier to maintain.

The dictionary is the one shipped with arcanist in which I added with the errors found in the codebase by core's linter that were not catched.

Test Plan

Remove the line:

"(^test/lint/dictionary/)"

from the exclude array of the spelling linter in the .arclint
file, as well as the trailing comma on the preceding line.

arc lint -- test/lint/dictionary/english.json

Check the linter is linting its own dictionary.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Jun 5 2019, 17:43
Herald added a reviewer: Restricted Project. · View Herald TranscriptJun 5 2019, 17:43
jasonbcox requested changes to this revision.Jun 6 2019, 18:49
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
test/lint/dictionary/english.json
612 ↗(On Diff #9155)

What does 'partial' mean? Do you have documentation I can read on this?

Maybe even link the docs as a comment. I couldn't find any from a quick google search.

This revision now requires changes to proceed.Jun 6 2019, 18:49
Fabien requested review of this revision.Jun 6 2019, 19:26
Fabien added inline comments.
test/lint/dictionary/english.json
612 ↗(On Diff #9155)

AFAIK the only documentation is the arcanist embedded help arc linters spelling which won't help you.
Sorry about that, the only link I can give you is the arcanist source code...

Based on code and testing partial is used for parts of word and not the whole word.
Example: recieved will be catched, as well as fuctional.
It takes longer to search so the exact array should be preferred.

Also you cannot add comments to a JSON file unless there is a field designed for it.

Why not use command line tools like aspell to do this ? I think some of them are already have arc integration.

Fabien added a comment.Jun 7 2019, 05:55

There is no command line spell checker which is natively integrated into arcanist (at least with my arcanist version) ; this one is the only built-in spell checker.
Other tools can always be added later if needed, but I prefer starting with the easiest one (no new dependency and faster to run) and see if there is the need for another spell checker based on usage feedback.

jasonbcox accepted this revision.Jun 7 2019, 17:14
jasonbcox added inline comments.
test/lint/dictionary/english.json
612 ↗(On Diff #9155)

I was a bit confused about the source of these, so we cleared it up offline. Arcanist provides a spellcheck dictionary and Fabien added a few items to it. Just to clarify for other reviewers.

This revision is now accepted and ready to land.Jun 7 2019, 17:14
Fabien edited the summary of this revision. (Show Details)Jun 7 2019, 17:16
This revision was automatically updated to reflect the committed changes.