Skip to content

Add code linting and formatting checking GitHub Action #6

Add code linting and formatting checking GitHub Action

Add code linting and formatting checking GitHub Action #6

Workflow file for this run

name: Auto-format with autopep8
on:
pull_request:
branches:
- main
- dev
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install autopep8
run: pip install autopep8
- name: Run autopep8
run: autopep8 --in-place --recursive --ignore=E5 .
- name: Check for uncommitted changes
run: |
if [[ $(git status --porcelain) ]]; then
echo "Uncommitted changes found. Please format your code with autopep8."
git --no-pager diff
exit 1
fi