Skip to content

Commit a3af732

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 5c54d99 commit a3af732

File tree

3 files changed

+12
-77
lines changed

3 files changed

+12
-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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ extend-select = [
103103
[tool.ruff.format]
104104
quote-style = "preserve"
105105
line-ending = "lf"
106+
# Enable preview mode for Github Annotations added in 0.13.3
107+
preview = true
106108

107109
[tool.mypy]
108110
mypy_path = "src"
@@ -114,5 +116,10 @@ env = {PYTHONIOENCODING = "utf-8"}
114116

115117
[tool.poe.tasks]
116118
lint = "ruff check ."
119+
format = "ruff format"
117120
types = "mypy --package west"
118-
all = ["test", "lint", "types"]
121+
all = ["test", "lint", "format", "types"]
122+
123+
# Github specific tasks
124+
gh-lint = "ruff check --output-format=github ."
125+
gh-format = "ruff format --check --output-format=github"

0 commit comments

Comments
 (0)