File tree Expand file tree Collapse file tree
{{cookiecutter.project_slug}} Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Pre-commit hooks for code quality
22# See https://pre-commit.com for more information
33repos :
4- - repo : https://github.com/astral-sh/ruff-pre-commit
5- # Ruff version.
6- rev : v0.14.8
7- hooks :
8- # Run the linter.
9- - id : ruff-check
10- args : [--fix]
11- # Run the formatter.
12- - id : ruff-format
13-
144 - repo : local
155 hooks :
16- - id : pyright
17- name : pyright type check
18- entry : uv run pyright
6+ - id : format
7+ name : format code
8+ entry : make format
199 language : system
2010 types : [python]
2111 pass_filenames : false
22- require_serial : true
2312
24- {%- if cookiecutter.docstring_coverage %}
25- - id : interrogate
26- name : interrogate docstring coverage
27- entry : uv run interrogate -c pyproject.toml
13+ - id : lint
14+ name : lint code
15+ entry : make lint
2816 language : system
2917 types : [python]
3018 pass_filenames : false
31- {%- endif %}
19+ require_serial : true
3220
33- - id : pytest
34- name : pytest
35- entry : uv run pytest
21+ - id : test
22+ name : run tests
23+ entry : make test
3624 language : system
3725 types : [python]
3826 pass_filenames : false
3927 require_serial : true
40- # Only run on pre-commit, not on push
4128 stages : [pre-commit]
4229
4330# Configuration
4431ci :
4532 autofix_prs : true
46- autoupdate_schedule : weekly
Original file line number Diff line number Diff line change 2121all :
2222 @echo " Run my targets individually!"
2323
24+ .PHONY : dev
25+ dev :
26+ uv sync --group dev
27+ uv run pre-commit install
28+
2429{%- if cookiecutter.entry_point %}
2530.PHONY : run
2631run :
Original file line number Diff line number Diff line change @@ -36,10 +36,7 @@ lint = [
3636 # NOTE: ruff is under active development, so we pin conservatively here
3737 # and let Dependabot periodically perform this update.
3838 " ruff ~= 0.14.0" ,
39- " pyright ~= 1.1.407" ,
40- " types-html5lib" ,
41- " types-requests" ,
42- " types-toml" ,
39+ " pyright" ,
4340 {%- if cookiecutter.docstring_coverage %}
4441 "interrogate",
4542 {%- endif %}
@@ -48,6 +45,7 @@ dev = [
4845 {include-group = " doc" },
4946 {include-group = " test" },
5047 {include-group = " lint" },
48+ " pre-commit" ,
5149]
5250
5351{% if cookiecutter.entry_point -%}
@@ -72,7 +70,7 @@ typeCheckingMode = "strict"
7270reportUnusedImport = " warning"
7371reportUnusedVariable = " warning"
7472reportGeneralTypeIssues = " error"
75- reportMissingTypeStubs = false
73+ reportMissingTypeStubs = true
7674
7775[tool .ruff ]
7876line-length = 100
You can’t perform that action at this time.
0 commit comments