@@ -41,34 +41,32 @@ jobs:
4141 - name : Install lint dependencies
4242 run : |
4343 python -m pip install --upgrade pip
44- # Install linters
45- pip install ruff flake8 pylint isort
46- # Install project dependencies if linters need to import them (e.g., pylint)
44+ # Install linters AND setuptools (might be needed by some implicitly)
45+ pip install ruff flake8 pylint isort setuptools
46+ # Install project dependencies if linters need to import them
4747 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
48- # Installing the package itself might be needed for pylint if it checks imports deeply
48+ # Optional: Install package if pylint needs deep import checks
4949 # pip install .
5050
51- - name : Linting with Ruff
52- run : |
53- ruff check . --output-format=github
54- ruff format . --check --diff
55-
5651 - name : Analysing the code with pylint
5752 run : |
58- # Adjust the path if your code is not directly in python_gpt_po/
59- pylint python_gpt_po/ || echo "Pylint found issues" # Continue even if pylint fails
53+ # Adjust path if needed
54+ pylint python_gpt_po/ || echo "Pylint found issues but continuing... " # Or remove || to fail on issues
6055
6156 - name : Check code style with flake8
6257 run : |
63- # stop the build if there are Python syntax errors or undefined names
64- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
65- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
66- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
58+ # Adjust path if needed
59+ flake8 python_gpt_po/
6760
6861 - name : Check import order with isort
6962 run : |
7063 isort --check-only --diff .
7164
65+ - name : Linting with Ruff
66+ run : |
67+ # Uses git ls-files to find only tracked python files
68+ ruff check $(git ls-files '*.py')
69+
7270 test :
7371 name : Test (Python ${{ matrix.python-version }})
7472 needs : lint # Run tests only if linting passes
@@ -197,7 +195,7 @@ jobs:
197195 permissions :
198196 contents : read # For checkout
199197 packages : write # For GHCR push
200- id-token : write # Uncomment if using PyPI Trusted Publishing
198+ id-token : write # Uncomment if using PyPI Trusted Publishing`
201199
202200 strategy :
203201 fail-fast : true # If one deployment fails, stop others
0 commit comments