File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ on: [push, pull_request]
33jobs :
44 ruff :
55 runs-on : ubuntu-latest
6+ env :
7+ MESSAGE : |
8+ Your code is not formatted!
9+ Please setup your development environment and run the formatting command.
10+ https://icalendar.readthedocs.io/en/stable/contribute/development.html#code-format
611 steps :
712 - uses : actions/checkout@v6
813 - name : Set up Python
@@ -15,10 +20,17 @@ jobs:
1520 python -m pip install --upgrade pip
1621 pip install . --group formatting
1722 - name : Run the ruff formatter to change files
18- run : ruff format --check .
19- - name : Run ruff checks on the files
20- run : ruff check --fix
23+ run : ruff format .
2124 - name : Fail if we detect any changes on the file system
2225 run : |
2326 git status
24- git diff --exit-code
27+ if ! git diff --exit-code; then
28+ echo "$MESSAGE"
29+ exit 1;
30+ fi
31+ - name : Run ruff checks on the files
32+ run : |
33+ if ! ruff check; then
34+ echo "$MESSAGE"
35+ exit 1;
36+ fi
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ We still recommend checking out the new features and giving feedback in the repo
2727Minor changes
2828~~~~~~~~~~~~~
2929
30+ - Show required code changes in the CI output to help contributors solve the formatting issues. :pr: `1216 `
3031- Use ruff 0.15.0 for code formatting in :file: `tox.ini `. :pr: `1215 `
3132
3233Breaking changes
You can’t perform that action at this time.
0 commit comments