replace flake8 with ruff
This commit is contained in:
parent
10d7cfeaf0
commit
28cfc4b66c
4
.flake8
4
.flake8
@ -1,4 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
ignore = E127,E226,E301,E302,E303,E305,E306,E309,E402,E701,E711,E712,E731,E741,W504
|
|
||||||
max_line_length = 120
|
|
||||||
show_source = True
|
|
10
Makefile
10
Makefile
@ -66,25 +66,25 @@ test-shell: $(env)
|
|||||||
test-schema: $(env)
|
test-schema: $(env)
|
||||||
$(with_tests_env) ./recreate-schema.sh test
|
$(with_tests_env) ./recreate-schema.sh test
|
||||||
|
|
||||||
pyflakes: $(env)
|
lint: $(env)
|
||||||
$(env_py) -m flake8 app.py liberapay tests
|
$(env_py) -m ruff check app.py liberapay tests
|
||||||
|
|
||||||
test: test-schema pytest
|
test: test-schema pytest
|
||||||
tests: test
|
tests: test
|
||||||
|
|
||||||
pytest: $(env)
|
pytest: $(env)
|
||||||
$(py_test) ./tests/py/test_$${PYTEST-*}.py
|
$(py_test) ./tests/py/test_$${PYTEST-*}.py
|
||||||
@$(MAKE) --no-print-directory pyflakes
|
@$(MAKE) --no-print-directory lint
|
||||||
$(py_test) --doctest-modules liberapay
|
$(py_test) --doctest-modules liberapay
|
||||||
|
|
||||||
pytest-cov: $(env)
|
pytest-cov: $(env)
|
||||||
$(py_test) --cov-report html --cov liberapay ./tests/py/test_$${PYTEST-*}.py
|
$(py_test) --cov-report html --cov liberapay ./tests/py/test_$${PYTEST-*}.py
|
||||||
@$(MAKE) --no-print-directory pyflakes
|
@$(MAKE) --no-print-directory lint
|
||||||
$(py_test) --doctest-modules liberapay
|
$(py_test) --doctest-modules liberapay
|
||||||
|
|
||||||
pytest-re: $(env)
|
pytest-re: $(env)
|
||||||
$(py_test) --lf ./tests/py/
|
$(py_test) --lf ./tests/py/
|
||||||
@$(MAKE) --no-print-directory pyflakes
|
@$(MAKE) --no-print-directory lint
|
||||||
|
|
||||||
pytest-i18n-browse: $(env)
|
pytest-i18n-browse: $(env)
|
||||||
@if [ -f sql/branch.sql ]; then $(MAKE) --no-print-directory test-schema; fi
|
@if [ -f sql/branch.sql ]; then $(MAKE) --no-print-directory test-schema; fi
|
||||||
|
@ -2863,7 +2863,7 @@ class Participant(Model, MixinTeam):
|
|||||||
for naive_group in naive_groups:
|
for naive_group in naive_groups:
|
||||||
naive_group.sort(key=due_date_getter)
|
naive_group.sort(key=due_date_getter)
|
||||||
group = None
|
group = None
|
||||||
execution_date = weeks_until_execution = None # for flake8
|
execution_date = weeks_until_execution = None # for the linter
|
||||||
for tip in naive_group:
|
for tip in naive_group:
|
||||||
last_payment_amount = last_payment_amounts.get(tip.tippee)
|
last_payment_amount = last_payment_amounts.get(tip.tippee)
|
||||||
# Start a new group if…
|
# Start a new group if…
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# flake8: noqa
|
# ruff: noqa
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Examples of data returned by the APIs of the elsewhere platforms.
|
Examples of data returned by the APIs of the elsewhere platforms.
|
||||||
|
@ -241,7 +241,7 @@ def iter_payday_events(db, participant, period_start, period_end, today, minimiz
|
|||||||
prev_date = None
|
prev_date = None
|
||||||
get_timestamp = lambda e: e['timestamp']
|
get_timestamp = lambda e: e['timestamp']
|
||||||
events = sorted(exchanges+transfers, key=get_timestamp, reverse=True)
|
events = sorted(exchanges+transfers, key=get_timestamp, reverse=True)
|
||||||
day_events, day_open = None, None # for pyflakes
|
day_events, day_open = None, None # for the linter
|
||||||
for event in events:
|
for event in events:
|
||||||
|
|
||||||
collapse = False
|
collapse = False
|
||||||
|
10
pyproject.toml
Normal file
10
pyproject.toml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[tool.ruff]
|
||||||
|
# https://docs.astral.sh/ruff/configuration/
|
||||||
|
line-length = 120
|
||||||
|
output-format = "full"
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
ignore = [
|
||||||
|
"E226", "E301", "E302", "E303", "E305", "E306", "E402",
|
||||||
|
"E701", "E711", "E712", "E721", "E731", "E741",
|
||||||
|
]
|
@ -1,8 +1,8 @@
|
|||||||
pytest
|
|
||||||
pytest-cov
|
|
||||||
pytest-cache
|
|
||||||
pytest-profiling
|
|
||||||
flake8
|
|
||||||
vcrpy
|
|
||||||
Faker
|
Faker
|
||||||
html5lib
|
html5lib
|
||||||
|
pytest
|
||||||
|
pytest-cache
|
||||||
|
pytest-cov
|
||||||
|
pytest-profiling
|
||||||
|
ruff
|
||||||
|
vcrpy
|
||||||
|
2
tox.ini
2
tox.ini
@ -7,7 +7,7 @@ commands =
|
|||||||
pip install -q -r requirements_base.txt
|
pip install -q -r requirements_base.txt
|
||||||
pip install -q -r requirements_tests.txt
|
pip install -q -r requirements_tests.txt
|
||||||
python cli/run.py -e defaults.env,tests/test.env,tests/local.env python -m pytest -Wd --cov liberapay --cov-report lcov tests/py {posargs}
|
python cli/run.py -e defaults.env,tests/test.env,tests/local.env python -m pytest -Wd --cov liberapay --cov-report lcov tests/py {posargs}
|
||||||
flake8 app.py liberapay tests
|
ruff check app.py liberapay tests
|
||||||
python cli/run.py -e defaults.env,tests/test.env,tests/local.env python -m pytest --doctest-modules liberapay
|
python cli/run.py -e defaults.env,tests/test.env,tests/local.env python -m pytest --doctest-modules liberapay
|
||||||
passenv =
|
passenv =
|
||||||
LIBERAPAY_I18N_TEST
|
LIBERAPAY_I18N_TEST
|
||||||
|
Loading…
x
Reference in New Issue
Block a user