We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
"exclude" param doesn't work in toml settings
To Reproduce
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer exclude: .yaml - id: check-added-large-files exclude: ^(reports/|references/) - repo: https://github.com/asottile/seed-isort-config rev: v1.9.4 hooks: - id: seed-isort-config - repo: https://github.com/pre-commit/mirrors-isort rev: v4.3.21 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases hooks: - id: isort entry: black --skip-string-normalization exclude: ^(alembic) - repo: https://github.com/psf/black rev: 22.3.0 hooks: - id: black entry: black --skip-string-normalization - repo: local hooks: - id: flake8 name: flake8 entry: flake8 language: system - repo: local hooks: - id: mypy name: mypy entry: mypy language: system types: [python] require_serial: true exclude: ^(test|references/|reports/|alembic/)
in .pre-commit-config.yaml
- repo: local hooks: - id: mypy name: mypy entry: mypy language: system types: [python] require_serial: true
in pyproject.toml
[tool.mypy] exclude = ['.*env\.py'] plugins = "pydantic.mypy" ignore_missing_imports = true
pre-commit run --all-files
Expected Behavior
All files as env.py has been ignored by mypy
Actual Behavior
alembic/env.py:19: error: Argument 1 to "fileConfig" has incompatible type "Optional[str]"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], IO[str], RawConfigParser]" [arg-type] Found 1 error in 1 file (checked 146 source files)
Your Environment
The text was updated successfully, but these errors were encountered:
@mshinkareva I am sorry, but is it really a mypy issue? This looks like pre-commit issue. Can you please reproduce this without pre-commit?
pre-commit
Let me explain (I am not very familiar with pre-commit):
exclude
mypy
I think that the workaround for this would be adding exclude to mypy config: https://mypy.readthedocs.io/en/stable/config_file.html#confval-exclude or you can just silence warnings for this specific file, see https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file (or fix the issue there).
Do you agree? :)
Sorry, something went wrong.
See also #13916 . Use pass_filenames: false
pass_filenames: false
No branches or pull requests
Bug Report
"exclude" param doesn't work in toml settings
To Reproduce
in .pre-commit-config.yaml
in pyproject.toml
Expected Behavior
All files as env.py has been ignored by mypy
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: