-
Notifications
You must be signed in to change notification settings - Fork 471
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
how to add "wrong" words to dictionary? #66
Comments
You could use the |
a more elegant solution would be a comment-statement in the line with e.g.
|
@bittorf there isn't a way to do that right now. I think it would be reasonable to add a new option to pass a file with "ignore-words", or to extend the dictionary format to allow passing words as good ones. For the first option it would be something like: While for the second we would support in the dictionary a syntax like: So you could use something like thi: |
@lucasdemarchi that is not the way i like it: the given example is real ("churchs") but of course i do not want |
I don't like the approach of adding comments in code to tweak the behavior
of codespell. Even worse that codespell doesn't know what's a comment. I'd
prefer to tell people to either use the approaches suggested above, an
exclude file. Other option: use a "2 pass approach", excluding that word I
the first and using a dictionary with only that word in the second, but in
iterative mode. This way codespell will ask for confirmation if the word
should be changed.
…On Jan 4, 2017 11:21 AM, "Bastian Bittorf" ***@***.***> wrote:
@lucasdemarchi <https://github.com/lucasdemarchi> that is not the way i
like it:
the given example is real ("churchs") but of course i do not want
to loose real occurences of a misspelled "church". think of a large file,
where only 1 thing should be overridden...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB8eHKaS_nu9I0M27pGiypKu53yLUPTks5rO_EhgaJpZM4IPUe3>
.
|
I agree with Lucas, adding comments into the code to influence codespell isn't a sustainable way. Personally I like the idea to extend the dictionary syntax, but a word exclude file is fine for me as well. @bittorf: if you want to ignore just one occurrence of "churchs" I think the |
@thdot - i can work with the --exclude-file approach, but it is not elegant. having statements in the file is an old and good way to talk with a compiler. see e.g. GCC or 'shellcheck': https://github.com/koalaman/shellcheck/wiki/Directive having extra files describing an issue feels like code duplication. what is if a line moves up or down? i have to tweak my 2nd file also... |
please integrate a |
Fixed by #100 |
i still think, that a 'directive' directly above the false positive would be a better solution, e.g.
codespell does not need knowledge about how to detect comments in language XY: |
@bittorf |
The L flag is not enough: Having a "directive" in the file, you can ignore just a single occurrence |
I agree, a directive would be great! I want to be specific about where to ignore what. |
I'm not quite sure why this example doesn't follow the pattern:
I get an error that is seemingly inextinguishable. |
Try this @alex-zenml :
@bittorf we've also got this now:
The issue with comment directives, is e.g. you can't do them within some Pydoc or a Doxygen block or whatever (so it can't always be the line before), and you can then never write |
just an update that since #2400 it's now possible to add inline ignore comments. |
## what - use `codespell` ONLY for diagnostics ## how - check - codespell-project/codespell#66 (comment) ## why - by default the formatter is also enabled, sometimes overwriting words that misspelled in code ## where - ./lua/plugins/none-ls.lua ## usage ## commit id, issue or pull request
i want to add 'churchs' as a good word (a shoebrand!)
to my private dictionary, but codespell always want
to correct it with churchs->churches
what is the proposed way to do this?
The text was updated successfully, but these errors were encountered: