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.
Adding options for existing flags
I've added a few more options to the
typos
hook to pass existing command line flags.These options are
binary
,no-check-filenames
,no-check-files
,no-unicode
,quiet
,verbose
.I also refactored the descriptions of the options and
cmdArgs
of the hook a bit.Adding an option to ignore files
I asked in the
typos
repo how to best ignore words, that should not be marked as typos. The waytypos
works, you have to add these words/spellings to the word list by extending it.Due to some design decisions,
typos
maintainers will not introduce CLI flags to ignore words and will to stick to the use of a single config file (_typos.toml) for that.To make
typos
even more usable as a pre-commit hook, I've added an option to list words to be ignored in the configuration of the hook. This makes it possible to set the following:If the option is set, the list of words then gets appended to a passed config file in a way
typos
understands.The resulting config file passed to the hook then contains the required section:
If both
settings.typos.config
andsettings.typos.configPath
are set, the latter gets ignored. This is now documented in the option's description, so that users know not to configure both.Unsetting
pass_filenames
In commit f441d08, I have removed the recent change from @phip1611. I stated in the PR discussion why I think changing this was not a good idea.
@domenkozar Perhaps we can wait for @phip1611's response and discuss this in #387 before this PR gets merged.