Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Lint

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
pylint:
name: Pylint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt

- name: Run Pylint
run: |
pylint miniupdate/ setup.py --fail-under=8.0

black:
name: Black Formatter
runs-on: ubuntu-latest
permissions:
contents: write
# Skip if the last commit was from github-actions[bot] to avoid infinite loops
if: github.actor != 'github-actions[bot]'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref || github.ref }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Black
run: |
python -m pip install --upgrade pip
pip install black

- name: Run Black
run: |
black miniupdate/ setup.py

- name: Check for changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT

- name: Commit and push changes
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply black formatting"
git push
Loading