Skip to content

Commit 9fc50e8

Browse files
committed
repo: Add format task and enforce in CI
CI runs all tasks, if we add the formatting task, it is enforced. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 16e2b1b commit 9fc50e8

File tree

3 files changed

+10
-77
lines changed

3 files changed

+10
-77
lines changed

.github/workflows/format.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ jobs:
2828
# Run linter/type checks only on 1 combination
2929
- os: ubuntu-latest
3030
python-version: '3.13'
31-
task: lint
31+
task: gh-lint
32+
- os: ubuntu-latest
33+
python-version: '3.13'
34+
task: gh-format
3235
- os: ubuntu-latest
3336
python-version: '3.13'
3437
task: types

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,10 @@ env = {PYTHONIOENCODING = "utf-8"}
114114

115115
[tool.poe.tasks]
116116
lint = "ruff check ."
117+
format = "ruff format --preview"
117118
types = "mypy --package west"
118-
all = ["test", "lint", "types"]
119+
all = ["test", "lint", "format", "types"]
120+
121+
# Github specific tasks
122+
gh-lint = "ruff check --output-format=github ."
123+
gh-format = "ruff format --check --preview --output-format=github"

0 commit comments

Comments
 (0)