Open muvarov opened 4 years ago
With the latest changed dictionary was moved from /usr/share/codespell/dictionary.txt to /usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt. With some custom installations paths might be different. I think it's better to add some method to codespell to printout default location of the dictionary. What do you think?
In theory the location should (from now on at least) always be relative to where codespell
itself is installed, i.e.:
python -c "import os.path as op; import codespell_lib; print(op.join(op.dirname(codespell_lib.__file__), 'data', 'dictionary.txt'))"
Would this work rather than adding something to codespell?
If not, I guess we could make a codespell --list
or something that just spit out the absolute paths of the builtin dictionaries.
I think 'codespell --list' is more clean way to do this.
The other thing to note @muvarov if you're using the file independently rather than via Codespell, is that there are now multiple dictionary files ( https://github.com/codespell-project/codespell/tree/master/codespell_lib/data ), but only some are enabled by default: https://github.com/codespell-project/codespell/blob/f107ddb54b766c40f57d406c50858b1efe9a84b3/codespell_lib/_codespell.py#L50
Perhaps a --list option should report that status too?
--help
should tell them which are enabled by default somewhere, so I wouldn't put it in --list
dictionary.txt is used for linux kernel code checker checkpatch.pl. With the latest changed dictionary was moved from /usr/share/codespell/dictionary.txt to /usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt. With some custom installations paths might be different. I think it's better to add some method to codespell to printout default location of the dictionary. What do you think?