mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [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/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
41 lines
848 B
YAML
41 lines
848 B
YAML
name: Automatic formatting
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths:
|
|
- '**.py'
|
|
|
|
|
|
jobs:
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Get dependencies
|
|
run: pip install ruff isort
|
|
|
|
- name: Format the code
|
|
run: ruff format
|
|
|
|
# While ruff can also do some sorting, isort can still be configured to do more,
|
|
# like grouping imports, etc.
|
|
- name: Sort the imports
|
|
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
|