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 is not working #461
Comments
So a basic thing that was fixed in 1.3.4 was a bug in our CLI parser that allowed However, even with that its not working in the container with pre-commit but is working when I run it directly. Still looking into that. |
Also, in general using |
Hi @epage Unfortunately docker run -it --rm python:latest bash -c '\
cd /tmp ; mkdir compare-133-160; cd $_; \
echo ; \
echo "+ pip install pre-commit" ; \
pip install -q pre-commit ; \
mkdir -p tests/fixtures ; \
mkdir -p tests/folder/fixtures ; \
mkdir -p src/constants ; \
echo "Comman" > ./src/constants/config.py
echo "assingment" > ./tests/folder/fixtures/file.txt ; \
echo "dummy_id = \"b8e718aa646b8a235ba11\"" > ./tests/fixtures/mock_objects.py ; \
typos-hook-1-3-3() { \
cat <<\EOF
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.3.3
hooks:
- id: typos
verbose: true
args: [
"--exclude",
"tests/*/fixtures",
"--exclude",
"tests/fixtures",
"--exclude",
"src/constants/config.py",
]
EOF
} ; \
echo ; \
echo "+ cat ./tests/fixtures/mock_objects.py" ; \
cat ./tests/fixtures/mock_objects.py ; \
echo ; \
echo "+ cat ./tests/folder/fixtures/file.txt" ; \
cat ./tests/folder/fixtures/file.txt ; \
echo ; \
echo "+ cat ./src/constants/config.py" ; \
cat ./src/constants/config.py ; \
echo ; \
typos-hook-1-3-3 > .pre-commit-config.yaml ; \
echo "+ cat ./.pre-commit-config.yaml" ; \
cat ./.pre-commit-config.yaml ; \
echo ; \
echo "*** 1.3.3 ***" ; \
git config --global init.defaultBranch main ; \
git init; git add . ; \
pre-commit run --all-files; \
echo ; \
echo "*** 1.6.0 ***" ; \
pre-commit autoupdate; \
git add -u ; \
pre-commit run --all-files;' |
Maybe exclusion should be delegated to pre-commit before repos:
- repo: https://github.com/crate-ci/typos
rev: v1.6.0
hooks:
- id: typos
verbose: true
args: [
"--exclude",
"tests/*/fixtures",
"--exclude",
"tests/fixtures",
"--exclude",
"src/constants/config.py",
] after repos:
- repo: https://github.com/crate-ci/typos
rev: v1.6.0
hooks:
- id: typos
verbose: true
exclude: "fixtures|src/constants/config" docker run -it --rm python:latest bash -c '\
cd /tmp ; mkdir compare-133-160; cd $_; \
echo ; \
echo "+ pip install pre-commit" ; \
pip install -q pre-commit ; \
mkdir -p tests/fixtures ; \
mkdir -p tests/folder/fixtures ; \
mkdir -p src/constants ; \
echo "Comman" > ./src/constants/config.py
echo "assingment" > ./tests/folder/fixtures/file.txt ; \
echo "dummy_id = \"b8e718aa646b8a235ba11\"" > ./tests/fixtures/mock_objects.py ; \
typos-hook-1-3-3() { \
cat <<\EOF
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.3.3
hooks:
- id: typos
verbose: true
exclude: "fixtures|src/constants/config"
EOF
} ; \
echo ; \
echo "+ cat ./tests/fixtures/mock_objects.py" ; \
cat ./tests/fixtures/mock_objects.py ; \
echo ; \
echo "+ cat ./tests/folder/fixtures/file.txt" ; \
cat ./tests/folder/fixtures/file.txt ; \
echo ; \
echo "+ cat ./src/constants/config.py" ; \
cat ./src/constants/config.py ; \
echo ; \
typos-hook-1-3-3 > .pre-commit-config.yaml ; \
echo "+ cat ./.pre-commit-config.yaml" ; \
cat ./.pre-commit-config.yaml ; \
echo ; \
echo "*** 1.3.3 ***" ; \
git config --global init.defaultBranch main ; \
git init; git add . ; \
pre-commit run --all-files; \
echo ; \
echo "*** 1.6.0 ***" ; \
pre-commit autoupdate; \
git add -u ; \
pre-commit run --all-files;' |
Yes, using precommit's exclusions is a workaround for this. The downside is it doesn't work with other uses of |
Going ahead and closing this in favor of #347 |
Hi,
--exclude is not working after v1.3.3
To reproduce:
Result output is:
The text was updated successfully, but these errors were encountered: