Test PyLint badge scoring #36
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: PyLint | ||
on: [ push ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11" ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Code Review Scoring | ||
run: find . -name '*.py' -print -exec pylint {} \; | ||
- name: Analysing code with PyLint | ||
run: | | ||
# pylint $(find . -name '*.py') --fail-under=8.0 | ||
pylint_score=$(pylint $(find . -name '*.py') --fail-under=8.0 --exit-zero --output-format=text | tee /dev/tty | grep 'Your code has been rated at' | sed 's/.*rated at \([-0-9.]*\)\/.*/\1/') | ||
echo "Pylint score: $pylint_score" | ||
# Assuming you have a script or service to generate/update the badge | ||
badge_url="https://some-badge-service.com/badge?score=$pylint_score" | ||
echo "Badge URL: $badge_url" | ||
# Update README.md or another document with the new badge URL | ||
# This is a simplified example. You would need a script to properly update the README.md with the new badge URL. |