Automatically format the code with ruff

This commit is contained in:
Roland Geider
2024-01-24 14:12:45 +01:00
parent 81c57a0ad7
commit e2f8d5078c
2 changed files with 6 additions and 9 deletions

View File

@@ -16,13 +16,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Get dependencies
run: pip install yapf isort
- name: Format the code
run: ruff format
- name: Format the code with yapf
run: yapf --recursive --in-place wger
- name: Sort the imports with isort
# 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

View File

@@ -12,9 +12,7 @@ from wger.tasks import (
setup_django_environment,
)
if __name__ == "__main__":
if __name__ == '__main__':
# If user passed the settings flag ignore the default wger settings
if not any('--settings' in s for s in sys.argv):
setup_django_environment(get_path('settings.py'))