pre-commit exclude is ignored
See original GitHub issueQuestion
Is it possible to ignore directories and files when using the mypy pre-commit by specifying exclude
?
My .pre-commit-config.yaml
file:
default_language_version:
python: python3.6
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: flake8
args: [ignore_me, not_me]
exclude: 'ignore_me' # This works, and skips the directory ignore_me, and only runs flake8 on the not_me directory
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.670
hooks:
- id: mypy
args: [--ignore-missing-imports, .]
exclude: 'ignore_me' # I still see mypy errors from the ignore_me directory
When I commit in my repository, I still see mypy errors from ignore_me
and I don’t get the flake8 errors.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Pre-commit-hook ignores exclude patterns · Issue #395 - GitHub
While configuring this, I discovered that black seems to ignore inclusion/exclusion rules completely if it's given a path to a file not a...
Read more >Exclude some files on running black using pre-commit
This issue on the black issue tracker outlines your particular problem. pre-commit finds all the python files, then applies pre-commit 's ...
Read more >pre-commit
Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically...
Read more >Can I Exclude Files From Every Precommit Hook Except For One
Here is an example let's say we want to ignore a file called readme.txt then we just.gitignore file ignoring files in Git |...
Read more >Available Hooks • precommit - Lorenz Walthert's
Arguments for the hooks are specified as described in the pre-commit.com ... Argument ignore-start and ignore-stop is passed to options() to set ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you’ll note I didn’t use
exclude
anywhere, I instead configured mypy settings for individual modulesSorry but it’s still unclear to me how to make mypy ignore errors in specific files. The link in your post doesn’t provide an example of that.
I’ve tried adding
to
.pre-commit-config.yaml
and I’ve tried adding
to
mypy.ini
I’ve also tried adding
to
.pre-commit-config.yaml
None of it worked.