Skip to content

Commit 02d6da4

Browse files
authored
Update packages and add ruff annotations for Github (#33)
* Update dependencies * Add ruff github action with inline annotations
1 parent 2814d93 commit 02d6da4

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/.github/workflows/{{ cookiecutter.package_name }}.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,17 @@ jobs:
3939
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
4040
run: poetry install --no-interaction --no-root
4141

42-
- name: Run linters
43-
run: make lint
42+
- name: Check dependencies
43+
run: make check-dependencies
44+
45+
- name: Check codestyle
46+
run: make check-codestyle
47+
48+
- name: ruff
49+
run: make check-ruff-github
50+
51+
- name: mypy
52+
run: make check-mypy
4453

4554
test:
4655
runs-on: ubuntu-latest

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-json
66
- id: check-toml
77
- id: check-xml
88
- id: check-yaml
99
- id: check-added-large-files
10-
args: [--maxkb=10000]
10+
args: [ --maxkb=10000 ]
1111
- id: check-case-conflict
1212
- id: check-merge-conflict
1313
- id: check-executables-have-shebangs
@@ -20,8 +20,10 @@ repos:
2020
- id: fix-byte-order-marker
2121
- id: mixed-line-ending
2222
- id: trailing-whitespace
23+
- id: pretty-format-json
24+
args: [ --autofix, --no-ensure-ascii ]
2325

2426
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.5.5
27+
rev: v0.11.8
2628
hooks:
2729
- id: ruff-format

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,19 @@ check-dependencies: check-poetry check-deptry
6161
.PHONY: check-ruff
6262
check-ruff:
6363
poetry run ruff check $(CODE) --no-fix
64+
.PHONY: check-codestyle
65+
check-codestyle:
66+
poetry run ruff format $(CODE) --check
6467
{% if cookiecutter.git_platform == 'gitlab' %}
6568
.PHONY: check-ruff-gitlab
6669
check-ruff-gitlab:
6770
poetry run ruff check $(CODE) --output-format=gitlab > ruff-report.json
6871
{% endif %}
69-
.PHONY: check-codestyle
70-
check-codestyle:
71-
poetry run ruff format $(CODE) --check
72+
{% if cookiecutter.git_platform == 'github' %}
73+
.PHONY: check-ruff-github
74+
check-ruff-github:
75+
poetry run ruff check $(CODE) --no-fix --output-format=github
76+
{% endif %}
7277

7378
.PHONY: check-mypy
7479
check-mypy:

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ pydantic = "^2.6.4"
1313
{%- endif %}
1414

1515
[tool.poetry.group.dev.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/
16-
mypy = "^1.11.1"
17-
pre-commit = "^3.8.0"
18-
pytest = "^8.3.2"
16+
mypy = "^1.15.0"
17+
pre-commit = "^4.2.0"
18+
pytest = "^8.3.5"
1919
pytest-cov = "^5.0.0"
20-
coverage = "^7.6.0"
21-
typeguard = "^4.3.0"
22-
ruff = "^0.5.5"
23-
safety = "^3.2.4"
24-
deptry = "^0.18.0"
20+
coverage = "^7.8.0"
21+
typeguard = "^4.4.2"
22+
ruff = "^0.11.8"
23+
safety = "^3.4.0"
24+
deptry = "^0.23.0"
2525
{%- if cookiecutter.git_platform == 'gitlab' %}
26-
mypy-gitlab-code-quality = "^1.1.0"
26+
mypy-gitlab-code-quality = "^1.3.0"
2727
{%- endif %}
2828

2929
[tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file

0 commit comments

Comments
 (0)