Skip to content

Add pylint as dev dependency #13

Add pylint as dev dependency

Add pylint as dev dependency #13

Workflow file for this run

name: Code Quality
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Check Python files exist
id: check_files
run: |
if [ -z "$(git ls-files '*.py')" ]; then
echo "No Python files found"
echo "has_python_files=false" >> $GITHUB_OUTPUT
else
echo "has_python_files=true" >> $GITHUB_OUTPUT
fi
- name: Run pylint
if: steps.check_files.outputs.has_python_files == 'true'
run: |
uv run pylint $(git ls-files '*.py') \
--output-format=colorized \
--score=yes
continue-on-error: false
- name: Run pylint with report
if: steps.check_files.outputs.has_python_files == 'true' && failure()
run: |
uv run pylint $(git ls-files '*.py') \
--output-format=text \
--reports=yes > pylint-report.txt || true
- name: Upload pylint report
if: failure()
uses: actions/upload-artifact@v4
with:
name: pylint-report
path: pylint-report.txt