Skip to content

Commit 9da4c5a

Browse files
committed
Enable pre-commit hooks
1 parent 47fc528 commit 9da4c5a

File tree

4 files changed

+227
-9
lines changed

4 files changed

+227
-9
lines changed

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ci:
2+
autofix_prs: false
3+
skip:
4+
# This steps run in the ci workflow. Keep in sync
5+
- mypy
6+
- pylint
7+
8+
default_language_version:
9+
python: python3.13
10+
11+
repos:
12+
- repo: https://github.com/python-poetry/poetry
13+
rev: '2.1.3'
14+
hooks:
15+
- id: poetry-check
16+
- id: poetry-lock
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.11.12
19+
hooks:
20+
- id: ruff
21+
args:
22+
- --fix
23+
- --unsafe-fixes
24+
- id: ruff-format
25+
- repo: local
26+
hooks:
27+
- id: mypy
28+
name: Check with mypy
29+
entry: poetry run mypy src
30+
language: system
31+
types:
32+
- python
33+
require_serial: true
34+
- id: pylint
35+
name: Check with pylint
36+
entry: poetry run pylint src/**/*.py
37+
language: system
38+
types:
39+
- python
40+
require_serial: true
41+
exclude: ^tests/.+
42+
- repo: https://github.com/pre-commit/pre-commit-hooks
43+
rev: v5.0.0
44+
hooks:
45+
- id: check-yaml
46+
- id: check-added-large-files

poetry.lock

Lines changed: 173 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

poetry.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[virtualenvs]
2+
in-project = true

pyproject.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ dependencies = [
2626
Homepage = "https://github.com/SAIC-iSmart-API/saic-python-client-ng"
2727
Issues = "https://github.com/SAIC-iSmart-API/saic-python-client-ng/issues"
2828

29+
[build-system]
30+
requires = ["poetry-core>=2.0.0,<3.0.0"]
31+
build-backend = "poetry.core.masonry.api"
32+
2933
[tool.poetry.group.dev.dependencies]
3034
pytest = "^8.2.2"
3135
mock = "^5.1.0"
@@ -36,12 +40,7 @@ pytest-asyncio = "^0.24.0"
3640
pytest-mock = "^3.14.0"
3741
mypy = "^1.15.0"
3842
pylint = "^3.3.6"
39-
40-
41-
42-
[build-system]
43-
requires = ["poetry-core>=1.0.0"]
44-
build-backend = "poetry.core.masonry.api"
43+
pre-commit = "^4.2.0"
4544

4645
[tool.pytest.ini_options]
4746
norecursedirs = ".git build dist"
@@ -85,6 +84,7 @@ include = [
8584
"tests/**/*.py",
8685
"**/pyproject.toml"
8786
]
87+
8888
[tool.ruff.lint]
8989
select = ["ALL"]
9090

@@ -129,7 +129,6 @@ ignore = [
129129
[tool.ruff.lint.flake8-pytest-style]
130130
fixture-parentheses = false
131131

132-
133132
[tool.ruff.lint.isort]
134133
combine-as-imports = true
135134
force-sort-within-sections = true

0 commit comments

Comments
 (0)