Add --show-dictionary option to report the origin of each typo#3973
Open
ekanshul wants to merge 1 commit into
Open
Add --show-dictionary option to report the origin of each typo#3973ekanshul wants to merge 1 commit into
ekanshul wants to merge 1 commit into
Conversation
Each dictionary entry now records the dictionary it was loaded from. With --show-dictionary, every reported typo is annotated with the name of the builtin dictionary (e.g. 'clear', 'rare') or the path of the custom dictionary file it came from, which helps decide which builtin dictionaries to enable and makes dictionary entries easier to fix. Closing: codespell-project#1470
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1470
Each dictionary entry now records which dictionary it was loaded from, and a new
--show-dictionaryoption annotates every reported typo with it — the name of the builtin dictionary (clear,rare, …) or the path of a custom-Ddictionary file:This makes it easy to see which builtin dictionaries are worth enabling/disabling for a project, and to locate the right dictionary file when an entry needs fixing.
Implementation notes:
Misspellinggains asourceattribute (a shared string per dictionary, so the memory overhead is one reference per entry)._select_builtin_dictionarynow returns(filename, name)tuples so builtins can be reported by their friendly name.test_show_dictionary) covering builtins, custom dictionaries, override order and--check-filenames.