Add separate pre-commit config for hatch

Authored by: bashonly
This commit is contained in:
bashonly 2024-05-12 11:21:46 -05:00
parent 2ffa8ed373
commit 10f4b229de
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0
3 changed files with 17 additions and 4 deletions

View File

@ -1,8 +1,13 @@
repos:
- repo: local
hooks:
- id: fix
name: Apply code fixes
entry: hatch fmt
- id: linter
name: Apply linter fixes
entry: ruff check --fix .
language: system
types: [python]
- id: format
name: Apply formatting fixes
entry: autopep8 --in-place .
language: system
types: [python]

8
.pre-commit-hatch.yaml Normal file
View File

@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: fix
name: Apply code fixes
entry: hatch fmt
language: system
types: [python]

View File

@ -136,7 +136,7 @@ dependencies = ["pre-commit"]
path = ".venv"
[tool.hatch.envs.default.scripts]
setup = "pre-commit install"
setup = "pre-commit install --config .pre-commit-hatch.yaml"
yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
[tool.hatch.envs.hatch-static-analysis]