Skip to content

Commit 2e81ed1

Browse files
author
Jens Diemer
committed
Use darker as code formatter tool base...
Use Darker as code formatter. Darker is: """ Apply black reformatting to Python files only in regions changed since a given commit. """ Also use `pytest-darker`, `pytest-flake8` and `pytest-isort` ... So code formatting "errors" will be check in pytest run. (Note: Only the first test is slower, afer one test runs only changed files will be checked.)
1 parent d6edab7 commit 2e81ed1

File tree

4 files changed

+215
-98
lines changed

4 files changed

+215
-98
lines changed

.github/workflows/pythonapp.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
django: [2.2, 3.1, 3.2]
2323
steps:
2424
- uses: actions/checkout@v2
25+
with:
26+
fetch-depth: 0
27+
- name: 'fetch master'
28+
run: |
29+
git fetch origin master
2530
- name: 'Set up Python ${{ matrix.python-version }}'
2631
uses: actions/setup-python@v2
2732
with:

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ update: check-poetry ## Update the dependencies as according to the pyproject.to
2525
poetry update
2626

2727
lint: ## Run code formatters and linter
28-
poetry run flynt --fail-on-change --line-length=${MAX_LINE_LENGTH} huey_monitor huey_monitor_tests
29-
poetry run isort --check-only .
30-
poetry run flake8 huey_monitor huey_monitor_tests
28+
poetry run darker --diff --check
3129

3230
fix-code-style: ## Fix code formatting
33-
poetry run flynt --line_length=${MAX_LINE_LENGTH} huey_monitor huey_monitor_tests
34-
poetry run autopep8 --aggressive --aggressive --in-place --recursive huey_monitor huey_monitor_tests
35-
poetry run isort .
31+
poetry run darker
3632

3733
tox-listenvs: check-poetry ## List all tox test environments
3834
poetry run tox --listenvs

0 commit comments

Comments
 (0)