diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2261e100cb..1e8099eb21 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ 1. [ ] If you've added code that should be tested, add tests 2. [ ] If you've changed APIs, update (or create!) the documentation 3. [ ] Ensure the tests pass -4. [ ] Make sure that your code lints and that you've followed [our coding style](https://github.com/kobotoolbox/kpi/blob/master/CONTRIBUTING.md) +4. [ ] Run `./python-format.sh` to make sure that your code lints and that you've followed [our coding style](https://github.com/kobotoolbox/kpi/blob/master/CONTRIBUTING.md) 5. [ ] Write a title and, if necessary, a description of your work suitable for publishing in our [release notes](https://community.kobotoolbox.org/tag/release-notes) 6. [ ] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE) 7. [ ] Open an issue in the [docs](https://github.com/kobotoolbox/docs/issues/new) if there are UI/UX changes diff --git a/format-python.sh b/format-python.sh index d6327b8abc..0a188b3ddb 100755 --- a/format-python.sh +++ b/format-python.sh @@ -22,9 +22,10 @@ if [ -n "$PYTHON_CHANGES" ]; then echo "Using ruff..." git diff --name-only "$BASE_REVISION" | grep '\.py' | xargs ruff check --select Q --select I --select F401 --select UP026 --select UP034 --select UP039 --select W292 --fix - # Applying Black format on changes (since $BASE_REVISION) + # Applying Black format on changes echo "Using darker..." - darker -i -r "$BASE_REVISION" + # Use `isort` and compare changes with revision $BASE_REVISION + darker --isort --revision "$BASE_REVISION" else echo "No Python changes detected!" fi diff --git a/pyproject.toml b/pyproject.toml index f5b4058e18..981b67b895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ # Do not enable `verbose = true` unless Black changes their behavior to respect # `--quiet` on the command line properly # verbose = true -line-length = 80 +line-length = 88 skip-string-normalization = true [tool.darker] @@ -17,7 +17,7 @@ isort = true [tool.isort] profile = "black" -line_length = 80 # same as black +line_length = 88 # same as black known_first_party = "kobo" no_lines_before = ["LOCALFOLDER"]