Skip to content
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

--exclude / extend-exclude does not affect explicitly specified files #548

Closed
scop opened this issue Aug 31, 2022 · 1 comment
Closed

--exclude / extend-exclude does not affect explicitly specified files #548

scop opened this issue Aug 31, 2022 · 1 comment

Comments

@scop
Copy link
Contributor

scop commented Aug 31, 2022

Exclusions specified with --exclude or files.extend-exclude do not seem to affect files explicitly passed as arguments.

$ cat test.txt 
aack
$ typos --format brief
./test.txt:1:0: `aack` -> `ack`
$ typos --format brief --exclude test.txt           # this is ok, test.txt is excluded
$ typos --format brief --exclude test.txt test.txt  # this does _not_ exclude test.txt!
test.txt:1:0: `aack` -> `ack`

This is problematic for example with pre-commit, which passes filenames to typos, causing exclusions in .typos.toml and friends or --exclude to not take effect. To work around it, one needs to additionally exclude the files on pre-commit level, but also specify in typos' config to cover direct typos invocations without pre-commit.

@epage
Copy link
Collaborator

epage commented Aug 31, 2022

This is a duplicate of #347

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants