ci: add a job running pylint #70
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: lint | |
on: [push, pull_request] | |
jobs: | |
ci: | |
name: Run black and pylint tools | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.12 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: "latest" | |
- name: Install Python dependencies | |
run: pip install anybadge black flake8 pylint | |
- name: Run linters | |
uses: wearerequired/lint-action@v2 | |
with: | |
auto_fix: false | |
black: true | |
flake8: false | |
- name: Analysing the code with pylint | |
run: | | |
uv run pylint --output-format=text ./**/*.py | tee pylint.txt | |
score="$(sed -n "/^Your code has been rated at/{s,.* at \([0-9\.]*\)\/.*,\1,p}" pylint.txt)" | |
uv run anybadge --label pylint --value "$score" --file="pylint.svg" --overwrite | |