Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit should have at least one spell-checker #302

Closed
ssbarnea opened this issue Jun 29, 2018 · 9 comments
Closed

pre-commit should have at least one spell-checker #302

ssbarnea opened this issue Jun 29, 2018 · 9 comments

Comments

@ssbarnea
Copy link
Contributor

ssbarnea commented Jun 29, 2018

Spellchecking in commit message, comments and source code is more than a trivial issue as git history cannot be realistically be changed and because spelling errors slipping into API do become the "norm" and they are very hard to fix later due to the need to avoid breaking the API.

I have not special speller in mind but I wanted to share with you experience about two of them:

  • cspell - nodejs based and official speller of vscode, proved to be easy to customize and easy to keep an in-repo dictionary. Only downside is that I would have preferred a python one, especially for CI purposes.
  • topy - is python based and easy to use but is very hard to customize, due to rules exceptions not possible or undocumented intgr/topy#19 I would advise not using it.

Update: streetsidesoftware/cspell#56 ticket would track adding the hook definition on cspell.

@rpdelaney
Copy link
Contributor

rpdelaney commented Dec 23, 2018

Why not just use GNU aspell?

Edit: There's also enchant

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Jan 15, 2019

I would prefer a tool that can easily be installed by pre-commit at runtime on most platforms, which means: python, nodejs or ruby based. Other approaches would make harder to assure succesfuly precommit installation.

Currently I am using cpell on few projects but not as hook yet.

PS. We do not want to add system package requirements to pre-commit, for portability reasons. I really like the fact that now it works well on almost any platform.

@peternewman
Copy link

I think we tick those boxes, and someone added a hook, although I see it's not listed and I get the feeling there's a step missing to run it from the pre-commit config: codespell-project/codespell#1117

@ssbarnea
Copy link
Contributor Author

I used cspell on a couple of projects and it proved to be a real PITA, issues with installation and also usage. I am going to five codespell a chance and see how it goes. Lets not close the ticket yet as there is a real need to spell code and also commit messages.

@peternewman
Copy link

I am going to five codespell a chance

Sadly only some kind of magic machine learning algorithm might catch those sort of issues. 😃

@asottile
Copy link
Member

ah I'll add it to the website -- thanks @peternewman (that's handled through https://github.com/pre-commit/pre-commit.github.io)

@peternewman
Copy link

Thanks @asottile, yeah I'd seen that site, I was assuming people would need to do a bit more work to codespell, but I see the system essentially just calls the existing library/executable by default.

@asottile
Copy link
Member

yep! all that's needed is the little metadata file and pre-commit does the rest of the heavy lifting :)

@antonpatsev

This comment was marked as off-topic.

@pre-commit pre-commit locked as off-topic and limited conversation to collaborators Jun 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants