-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
better doc on excluding files in pyproject.toml #13883
Comments
Thanks, in fact, I'm using I intentionaly make a file ( My [tool.mypy]
exclude = [
"^venv/",
"^scripts/",
] Running Now running mypy under pre-commit, repos:
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: mypy
types: [python]
args:
- --show-error-codes Running Adding config-file param in repos:
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: mypy
types: [python]
args:
- --show-error-codes
- --config-file
- pyproject.toml |
Use pre-commit's pass_filenames: false. mypy does whole program analysis so pre-commits file diffing isn't saving you work |
thx a lot, but with the suggested param, I got the error: mypy.....................................................................Failed
- hook id: mypy
- exit code: 2
usage: mypy [-h] [-v] [-V] [more options; see below]
[-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: Missing target module, package, files, or command. removing the |
i have the same issue... running |
I have the same problem. @copdips or @tgy, could you solve the problem? May I ask you how? Thanks in advance. |
Hello, to be honnest, I haven't used mypy for a while, what I can show is my last config, I don't run mypy directly, always from pre-commit. # file pyproject.toml
[tool.mypy]
ignore_missing_imports = true
warn_return_any = true
warn_unused_configs = true
show_error_codes = true
# strict = true
exclude = ["^.venv/", "^build/", "^_local_test/"] # file .pre-commit-config.yaml
- id: mypy
name: mypy
language: system
entry: mypy
types: [python] |
Documentation
hello,
Could anyone provide a better doc about the exculde section in the pyproject.toml file ?
Current doc says:
IMHO, it's not very clear, at least, it should explain what kind of files are exclude by the syntax of
'^file1\.py$'
, and what for"^file2\\.py$"
. And is it for any file with the same name under any folder ?In addition, could you please provide an example how to exclude by a file path keywork. Suppose i have some files located at :
/a/b/c/file.py
, I would like to exclude all files where their location has the keywork/c/
, how to achieve that.The text was updated successfully, but these errors were encountered: