Skip to content

Commit

Permalink
ci: add a pylint badge
Browse files Browse the repository at this point in the history
Signed-off-by: Davide Madrisan <d.madrisan@proton.me>
  • Loading branch information
madrisan committed Dec 22, 2024
1 parent d89a81d commit 15bbd64
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
version: "latest"

- name: Install Python dependencies
run: pip install black flake8 pylint
run: pip install black flake8

- name: Run linters
uses: wearerequired/lint-action@v2
Expand All @@ -31,4 +31,4 @@ jobs:

- name: Analysing the code with pylint
run: |
uv run pylint $(git ls-files '*.py')
uv run pylint --output-format=text ./**/*.py
6 changes: 6 additions & 0 deletions pylint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
uv run pylint --verbose --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

rm -f pylint.txt
23 changes: 23 additions & 0 deletions pylint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [

[dependency-groups]
dev = [
"anybadge>=1.14.0",
"black>=24.10.0",
"mypy>=1.14.0",
"pylint>=3.3.2",
Expand Down
14 changes: 14 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15bbd64

Please sign in to comment.