Skip to content

Improve info page

Improve info page #247

Workflow file for this run

name: Lint and Fix
on:
push:
branches-ignore:
- 'refs/tags/*'
pull_request:
jobs:
autostyle:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install autoflake autopep8
- name: Run autoflake to remove unused imports
run: |
autoflake --remove-all-unused-imports --remove-unused-variables --in-place --recursive .
- name: Run autopep8 to format the code
run: |
autopep8 --in-place --recursive --max-line-length 180 --ignore W503 .
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git diff-index --quiet HEAD || git commit -m 'Automatically fix code style issues'
git push origin ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
needs: autostyle
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Pull latest changes
run: git pull
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run flake8
run: |
flake8 . --max-line-length 180