Skip to content

Commit 3726689

Browse files
committed
Update the pre-commit
1 parent c335fc3 commit 3726689

3 files changed

Lines changed: 18 additions & 29 deletions

File tree

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
11
# Pre-commit hooks for code quality
22
# See https://pre-commit.com for more information
33
repos:
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
4431
ci:
4532
autofix_prs: true
46-
autoupdate_schedule: weekly

{{cookiecutter.project_slug}}/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ endif
2121
all:
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
2631
run:

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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"
7270
reportUnusedImport = "warning"
7371
reportUnusedVariable = "warning"
7472
reportGeneralTypeIssues = "error"
75-
reportMissingTypeStubs = false
73+
reportMissingTypeStubs = true
7674

7775
[tool.ruff]
7876
line-length = 100

0 commit comments

Comments
 (0)