Move mypy to pre-commit
This commit is contained in:
parent
0266a32b5b
commit
2b9e5fa5d0
4 changed files with 12 additions and 4 deletions
|
@ -71,3 +71,12 @@ repos:
|
|||
additional_dependencies:
|
||||
- eslint@^7.29.0
|
||||
- eslint-config-prettier@^8.3.0
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: mypy
|
||||
language: system
|
||||
types: [python]
|
||||
exclude: tasks.py$
|
||||
args: ["--cache-dir=/dev/null"]
|
||||
|
|
|
@ -63,7 +63,6 @@ env = [
|
|||
|
||||
[tool.mypy]
|
||||
mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs:$MYPY_CONFIG_FILE_DIR/src"
|
||||
exclude = "/migrations/"
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
|
|
|
@ -7,7 +7,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
dependencies: list[str] = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
|
|
4
tasks.py
4
tasks.py
|
@ -33,10 +33,10 @@ def pre_commit(ctx):
|
|||
@task
|
||||
def mypy(ctx):
|
||||
with ctx.cd(BASE_DIR):
|
||||
ctx.run("mypy src", pty=True)
|
||||
ctx.run("pre-commit run --all-files mypy", pty=True)
|
||||
|
||||
|
||||
@task(pre=[pre_commit, mypy, test_cov])
|
||||
@task(pre=[pre_commit, test_cov])
|
||||
def check(ctx):
|
||||
pass
|
||||
|
||||
|
|
Reference in a new issue