Skip to content

Update run-pylint.yml #61

Update run-pylint.yml

Update run-pylint.yml #61

Workflow file for this run

name: Pylint
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
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 pylint anybadge
- name: Download .pylintrc file
uses: suisei-cn/[email protected]
id: pylintrc
with:
url: "https://raw.githubusercontent.com/nlp-tlp/badges/main/.pylintrc"
- name: Run Pylint
run: |
pylint ${{ github.event.repository.name }} --output pylint.log --exit-zero
- name: Get Pylint score and create badge
run: |
PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.log)
echo $PYLINT_SCORE
anybadge -l pylint --value=$PYLINT_SCORE -f ${{ github.event.repository.name }}-pylint-badge.svg 2=red 4=orange 8=yellow 10=green