Merge pull request #1338 from collective/1244-attry.categories_proper… #3021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check code style with ruff | |
| on: [push, pull_request] | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| env: | |
| MESSAGE: | | |
| Your code is not formatted! | |
| Please set up your development environment and run the formatting command. | |
| https://icalendar.readthedocs.io/en/stable/contribute/development.html#code-format | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . --group formatting | |
| sudo apt install -y git-delta | |
| - name: Run the ruff formatter to change files | |
| run: ruff format . | |
| - name: Fail if we detect any changes on the file system | |
| run: | | |
| git diff | delta --light --keep-plus-minus-markers | |
| if ! git diff --exit-code --quiet; then | |
| echo "$MESSAGE" | |
| exit 1; | |
| fi | |
| env: | |
| FORCE_COLOR: '1' | |
| - name: Run ruff checks on the files | |
| run: | | |
| if ! ruff check; then | |
| echo "$MESSAGE" | |
| exit 1; | |
| fi |