Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try out Darker GitHub Action #18

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading