Skip to content

Add todo for updated README with new examples #25

Add todo for updated README with new examples

Add todo for updated README with new examples #25

Workflow file for this run

name: Lint and Format Code
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 flake8-pyproject black isort
- name: Lint with flake8
run: |
# uses the flake8 configuration in pyproject.toml
# stop the build if there are Python syntax errors or undefined names
flake8 .
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --exit-zero
- name: Run black
run: black .
- name: Run isort
run: isort .
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
if git diff --exit-code --staged; then
echo "No changes to commit"
else
git commit -m "[PROJ] Format code with Black"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
fi