From 4eff12d0a55be5d81b6a881af91e4c06d49bfcc2 Mon Sep 17 00:00:00 2001 From: ultimateownsz Date: Wed, 19 Feb 2025 10:20:07 +0100 Subject: [PATCH 1/2] making the lint simple again --- .github/workflows/lint_and_test.yml | 38 +++++++++++------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index f29d561..0465cfd 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -15,46 +15,36 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # - name: Exit if not Pyceaas repository - # run: | - # if [ "${{ github.repository }}" != "PyCeas/Pyceas" ]; then - # echo "Not running in PyCeas repository. Exiting." - # exit 0 - # fi - - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | python -m pip install --upgrade pip pip install ruff mypy pygame-ce pytmx - + - name: Check for Python files id: check_files run: | git ls-files '*.py' > files.txt if [ ! -s files.txt ]; then echo "No Python files found. Skipping lint and type-check." - fi + exit 0 - name: Run ruff - if: success() - run: | - if [ -s files.txt ]; then - ruff check $(cat files.txt) - else - echo "Skipping ruff; no Python files found." - fi + if: steps.check_files.outputs.found != '0' + run: ruff check . - name: Run mypy - if: success() - run: | - if [ -s files.txt ]; then - mypy $(cat files.txt) - else - echo "Skipping mypy; no Python files found." - fi - + if: steps.check_files.outputs.found != '0' + run: mypy . From 43a523b8cbda8073c822708ed8b29c7fa818f4ab Mon Sep 17 00:00:00 2001 From: ultimateownsz Date: Wed, 19 Feb 2025 10:59:59 +0100 Subject: [PATCH 2/2] revert to old linter --- .github/workflows/lint_and_test.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 0465cfd..7cf7017 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -20,31 +20,15 @@ jobs: with: python-version: '3.12' - - name: Cache pip dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install dependencies run: | python -m pip install --upgrade pip pip install ruff mypy pygame-ce pytmx - - name: Check for Python files - id: check_files - run: | - git ls-files '*.py' > files.txt - if [ ! -s files.txt ]; then - echo "No Python files found. Skipping lint and type-check." - exit 0 - - name: Run ruff - if: steps.check_files.outputs.found != '0' - run: ruff check . + run: | + ruff check $(git-ls '*.py') - name: Run mypy - if: steps.check_files.outputs.found != '0' - run: mypy . + run: | + mypy main.py \ No newline at end of file