Skip to content

Commit 3b0f6dc

Browse files
committed
Added pre-commit as development dependency, updated pre-commit config
pre-commit package was not present in development dependency, so pre-commit handler could not be installed locally. Also simplified CI for linting a bit. Removed black and ruff from dev dependencies After thinking about it again, just using pre-commit handling in CI is a simpler approach also for maintenance.
1 parent 7358b49 commit 3b0f6dc

File tree

4 files changed

+138
-16
lines changed

4 files changed

+138
-16
lines changed

.github/workflows/ci-lint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
with:
1919
python-version: "3.9" # the pre-commit is hooked in as 3.9
2020
- name: Install Python dependencies
21-
run: poetry install
22-
- name: Install pre-commit
23-
run: pip install pre-commit
24-
- name: Run linter
21+
run: poetry install --no-interaction
22+
- name: Execute pre-commit handler
2523
run: pre-commit run -a

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ repos:
1010
- id: end-of-file-fixer
1111

1212
- repo: https://github.com/psf/black-pre-commit-mirror
13-
rev: '24.1.1'
13+
rev: '24.2.0'
1414
hooks:
1515
- id: black
1616
args: [ '--config', 'pyproject.toml' ]
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: 'v0.1.14'
19+
rev: 'v0.3.0'
2020
hooks:
2121
- id: ruff
2222
# Explicitly setting config to prevent Ruff from using `pyproject.toml` in sub packages.

poetry.lock

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

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ redis = ["redis"]
108108
selenium = ["selenium"]
109109

110110
[tool.poetry.group.dev.dependencies]
111+
mypy = "1.7.1"
112+
pre-commit = "3.6.2"
113+
pg8000 = "*"
111114
pytest = "7.4.3"
112115
pytest-cov = "4.1.0"
113116
sphinx = "^7.2.6"
114-
pg8000 = "*"
115117
twine = "^4.0.2"
116-
mypy = "1.7.1"
117118

118119
[[tool.poetry.source]]
119120
name = "PyPI"
@@ -139,15 +140,14 @@ exclude_lines = [
139140
"raise NotImplementedError" # TODO: used in core/generic.py, not sure we need DbContainer
140141
]
141142

142-
[tool.ruff.flake8-type-checking]
143-
strict = true
144-
145143
[tool.ruff]
146144
target-version = "py39"
147145
line-length = 120
148146
fix = true
149-
fixable = ["I"]
150147
src = ["core", "modules/*"]
148+
149+
[tool.ruff.lint]
150+
fixable = ["I"]
151151
exclude = ["**/tests/**/*.py"]
152152
select = [
153153
# flake8-2020
@@ -194,6 +194,8 @@ ignore = [
194194
"INP001"
195195
]
196196

197+
[tool.ruff.lint.flake8-type-checking]
198+
strict = true
197199

198200
[tool.mypy]
199201
python_version = "3.9"

0 commit comments

Comments
 (0)