I am building a cookiecutter template for a python package, and I want to run a bunch of checks for the template repo itself with pre-commit.
A skeleton of the repo looks like this:
my_cookiecutter_template
| .pre-commit-config.yaml
| cookiecutter.json
|
|___{{cookiecutter.project_slug}}
| pyproject.toml
|
|____{{cookiecutter.project_slug}}
| __init__.py
One of the pre-commit hooks I am using is mypy, but it is failing with this error:
{{cookiecutter.project_slug}} is not a valid Python package name
because there is an __init__.py
file in the directory called {{cookiecutter.project_slug}}
(which will obviously be renamed with a valid name when the template is instantiated).
My question is, how can I suppress this mypy error? The mypy docs have details of lots of exceptions with a specific error code which gives you a way to suppress it. But, unless I am mistaken, there is nothing there that pertains to this specific error