Skip to content

Commit

Permalink
Use the Darker GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Apr 20, 2024
1 parent 958da9a commit 89fa8c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,21 @@ jobs:
- name: Test with pytest
run: >
pytest
- name: Check formatting and linting with Darker
run: >
darker
--diff
--check
--revision=origin/master...
--isort
--lint=pylint
--lint=flake8
.
- name: Do static type checking with Mypy
run: >
mypy .
darker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- uses: akaihola/darker@v2.1.1
with:
options: --verbose --check --diff --isort --color
revision: origin/master...
lint: flake8 == 4.0.0 , pylint==2.13.2
1 change: 1 addition & 0 deletions pgtricks/pg_dump_splitsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def linecomp(l1: str, l2: str) -> int:
p2 = l2.split('\t', 1)
v1, v2 = cast(Tuple[float, float], try_float(p1[0], p2[0]))
result = (v1 > v2) - (v1 < v2)
# modifying a line to see whether Darker works:
if not result and len(p1) == len(p2) == 2:
return linecomp(p1[1], p2[1])
return result
Expand Down

0 comments on commit 89fa8c9

Please sign in to comment.