Skip to content

Commit ebd89b2

Browse files
ci: added conventional commits (#16, #17, #18)
1 parent 477203f commit ebd89b2

File tree

4 files changed

+184
-5
lines changed

4 files changed

+184
-5
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
# get all branches
21+
fetch-depth: 0
22+
23+
- name: Lint commit messages
24+
uses: wagoid/commitlint-github-action@v5
1925

2026
- name: Set up Python ${{ env.PYTHON_VERSION }}
2127
uses: actions/setup-python@v5
@@ -29,11 +35,10 @@ jobs:
2935
- name: Install deps
3036
run: |
3137
cd python_coderunner
32-
uv pip install --system --group dev --requirements=pyproject.toml
38+
uv pip install --system --group pre-commit --requirements pyproject.toml
3339
3440
- name: Run pre-commit
3541
run: |
36-
pre-commit install
3742
pre-commit run --all-files
3843
3944
tests:
@@ -55,7 +60,7 @@ jobs:
5560
- name: Install deps
5661
run: |
5762
cd python_coderunner
58-
uv pip install --system --group dev --requirements=pyproject.toml
63+
uv pip install --system --group test --requirements pyproject.toml
5964
6065
- name: Run tests
6166
run: |

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,46 @@ repos:
66
entry: bash -c "cd python_coderunner && ruff check ."
77
language: system
88
types: [python]
9+
stages: [pre-commit]
10+
verbose: true
911

1012
- id: ruff_format
1113
name: ruff_format
1214
# not in args, because entry is bash
1315
entry: bash -c "cd python_coderunner && ruff format --quiet ."
1416
language: system
1517
types: [python]
18+
stages: [pre-commit]
19+
verbose: true
1620

1721
- id: isort
1822
name: isort
1923
entry: bash -c "cd python_coderunner && isort ."
2024
language: system
2125
types: [python]
26+
stages: [pre-commit]
27+
verbose: true
2228

2329
- id: mypy
2430
name: mypy
2531
entry: bash -c "cd python_coderunner && mypy ."
2632
language: system
2733
types: [python]
34+
stages: [pre-commit]
35+
verbose: true
2836

2937
- id: pylint
3038
name: pylint
3139
entry: bash -c "cd python_coderunner && pylint ."
3240
language: system
3341
types: [python]
42+
stages: [pre-commit]
43+
verbose: true
44+
45+
- id: commitlint
46+
name: commitlint
47+
entry: commitlint
48+
args: [--file]
49+
language: system
50+
stages: [commit-msg]
51+
verbose: true

python_coderunner/pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ requires-python = ">=3.10"
88

99
[dependency-groups]
1010
dev = [
11+
"commitlint>=1.3.0",
1112
"isort>=4.3.21",
1213
"mypy>=0.910",
1314
"pre-commit>=1.21.0",
@@ -17,6 +18,18 @@ dev = [
1718
"pytest-mock>=3.5.1",
1819
"ruff>=0.12.0",
1920
]
21+
pre-commit = [
22+
"isort>=4.3.21",
23+
"mypy>=0.910",
24+
"pre-commit>=1.21.0",
25+
"pylint>=2.6.2",
26+
"ruff>=0.12.0",
27+
]
28+
test = [
29+
"pytest>=6.1.2,<8.0.0",
30+
"pytest-lazy-fixture>=0.6.3",
31+
"pytest-mock>=3.5.1",
32+
]
2033

2134
[tool.pytest.ini_options]
2235
pythonpath = ["."] # to run without python -m, otherwise there will be no src in the path

0 commit comments

Comments
 (0)