-
Notifications
You must be signed in to change notification settings - Fork 465
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
Docs request: how to put check-filenames
and ignore-words-list
into pyproject.toml
#2839
Comments
|
[tool.codespell]
ignore-words-list = "acn" Works for me when invoking - repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies:
- tomli Yaay, thank you! How about |
Following the convention in https://github.com/codespell-project/codespell#using-a-config-file where [tool.codespell]
ignore-words-list = "acn"
check-filenames = ""
check-hidden = "" And it looks like it works as intended. |
Shouldn't these work as well? check-filenames = true
check-hidden = true I wonder whether this should be considered a bug. |
@DimitriPapadopoulos thanks for the PR, appreciated! What is the correct TOML usage now, is it |
Not sure "correct" applies here, but yes, Ideally I would like |
Would it be possible to allow also a list? The main advantage is that you can then write notes/comments for future you ignore-words-list = [
"MAPE", # metrics name
"fo", # fall-out variable
] |
It could be implemented in TOML files, but the concept does not seem compatible with INI config files. The difficulty is that our options processing model is based on command line options and INI config files. I have tried to add some flexibility to our parsing of TOML files, but adding too many TOML-related patches might end up in too complex code. The main difficulty difficulty might be that we need to remain compatible with Perhaps I can have a go at it when finalising #2767. |
yes I think just switching this options to accept one or more values with nargs would be fully compatible and if only one is passed you try to split with comma
I would try Fire which has zero additional dependencies; and eventually I can help about the |
@DimitriPapadopoulos seems does not work for me...
with my [tool.codespell]
# comma separated list of words
ignore-words-list = "ROUGE"
quiet-level = 3 and using precommit: - repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
additional_dependencies: [tomli] |
I find
It would probably be less confusing if we could switch |
See Ignoring Words. Change: ignore-words-list = "ROUGE" to: ignore-words-list = "rouge" |
Ahh, all need to be lower-case? Even I have "ROUGE" in the text and write identical ROUGE (including case-sensitive) to the ignore list...
Do you mean for backward compatibility? I think that allowing words as a list truly would help |
How can I put
check-filenames
,check-hidden
, andignore-words-list
intopyproject.toml
?In the tests there doesn't seem to be a case for this: https://github.com/codespell-project/codespell/blob/v2.2.4/codespell_lib/tests/test_basic.py#L1028
From a GitHub Search, there's no results either:
tool.codespell filename:pyproject.toml
And none of the below keys are working for me:
From https://stackoverflow.com/questions/75377334/toml-how-to-have-key-without-value it seems keys without values aren't possible in
.toml
.Related: #2718
Here is my old
.codespellrc
:The text was updated successfully, but these errors were encountered: