Skip to content

Commit 6656f45

Browse files
committed
CI: use ruff for format check
1 parent 184c3b6 commit 6656f45

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## v2.4.0 - UNPUBLISHED
44

55
* Add support for Django 5.0 and Python 3.12.
6+
* Replace Black with Ruff for format checking
67

78
## v2.3.1 - May 2nd, 2023
89

django_prometheus/db/common.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@ class CursorWrapper(cursor_class):
6363

6464
def execute(self, *args, **kwargs):
6565
execute_total.labels(alias, vendor).inc()
66-
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
67-
errors_total, extra_labels=labels
66+
with (
67+
query_duration_seconds.labels(**labels).time(),
68+
ExceptionCounterByType(errors_total, extra_labels=labels),
6869
):
6970
return super().execute(*args, **kwargs)
7071

7172
def executemany(self, query, param_list, *args, **kwargs):
7273
execute_total.labels(alias, vendor).inc(len(param_list))
7374
execute_many_total.labels(alias, vendor).inc(len(param_list))
74-
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
75-
errors_total, extra_labels=labels
75+
with (
76+
query_duration_seconds.labels(**labels).time(),
77+
ExceptionCounterByType(errors_total, extra_labels=labels),
7678
):
7779
return super().executemany(query, param_list, *args, **kwargs)
7880

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ line_length = 88
1111
force_grid_wrap = 0
1212
include_trailing_comma = true
1313

14-
[tool.black]
15-
line-length = 120
16-
1714
[tool.ruff]
1815
line-length = 120
1916

@@ -60,18 +57,16 @@ commands =
6057
6158
[testenv:py39-lint]
6259
deps =
63-
black==23.3.0
6460
flake8
65-
ruff==0.0.262
61+
ruff==0.8.2
6662
isort>=5.12.0,<6
6763
flake8-debugger
6864
flake8-2020
6965
flake8-comprehensions
7066
flake8-bugbear
7167
commands =
72-
black --check django_prometheus/
68+
ruff format --check django_prometheus/
7369
flake8 django_prometheus
7470
isort --check-only django_prometheus/
7571
ruff check django_prometheus/
76-
7772
"""

0 commit comments

Comments
 (0)