Files
wger/.github/workflows/formatter.yml
dependabot[bot] c4efe843cc Bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 23:03:04 +00:00

39 lines
767 B
YAML

name: Automatic formatting
on:
push:
branches:
- "master"
paths:
- '**.py'
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get dependencies
run: pip install yapf isort
- name: Format the code with yapf
run: yapf --recursive --in-place wger
- name: Sort the imports with isort
run: isort .
- name: Push a commit with the changed files
# Needed if no files were changed
continue-on-error: true
run: |
git config user.name Github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Automatic linting"
git push