Run linters and type checkers
(context: Context, fix: bool = False)
| 107 | |
| 108 | @task |
| 109 | def lint_py(context: Context, fix: bool = False): |
| 110 | """Run linters and type checkers""" |
| 111 | if fix: |
| 112 | context.run("ruff --fix .") |
| 113 | context.run("black .") |
| 114 | else: |
| 115 | context.run("ruff .") |
| 116 | context.run("black --check --diff .") |
| 117 | in_py( |
| 118 | context, |
| 119 | f"flake8 --toml-config '{ROOT / 'pyproject.toml'}' .", |
| 120 | "hatch run lint:all", |
| 121 | ) |
| 122 | |
| 123 | |
| 124 | @task(pre=[env_js]) |