Merge pull request #3160 from Starbuck5/color-sdl3 #47
This file contains 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: python3 setup.py lint | |
# Run lint CI on changes to main branch, or any PR to main. Do not run CI on | |
# any other branch. | |
# Run only if there are changes on files that are linted (C, Python and rst files) | |
on: | |
push: | |
branches: main | |
paths: | |
- '**.h' | |
- '**.c' | |
- '**.py' | |
- '**.rst' | |
- '.pre-commit-config.yaml' | |
pull_request: | |
branches: main | |
paths: | |
- '**.h' | |
- '**.c' | |
- '**.py' | |
- '**.rst' | |
- '.pre-commit-config.yaml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-format-lint | |
cancel-in-progress: true | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: pre-commit/[email protected] | |
format-lint-code-check: | |
runs-on: ubuntu-24.04 | |
env: | |
# Pip now forces us to either make a venv or set this flag, so we will do | |
# this | |
PIP_BREAK_SYSTEM_PACKAGES: 1 | |
steps: | |
- uses: actions/[email protected] | |
- name: Install deps | |
run: python3 -m pip install pylint sphinx"<7.2.0" | |
- name: Check code linting | |
run: pylint src_py docs | |
- name: Check docs changes are checked in | |
run: | | |
python3 buildconfig/make_docs.py | |
if [[ `git status --porcelain` ]]; then | |
echo "Generating docs caused changes. Please check them in." | |
echo "You may need to run: python3 buildconfig/make_docs.py full_generation" | |
# Run git status again, so people can see what changed. | |
git status --porcelain | |
exit 1 | |
fi |