Skip to content

Commit 942edd0

Browse files
authored
Remove black and use ruff formatter (#1106)
1 parent 67d618f commit 942edd0

File tree

47 files changed

+72
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+72
-27
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,18 @@ repos:
7777
- --quiet
7878

7979
- repo: https://github.com/astral-sh/ruff-pre-commit
80-
rev: v0.4.7
80+
rev: v0.4.10
8181
hooks:
8282
- id: ruff
83-
types_or: [python, pyi, jupyter]
83+
types_or: [python,pyi]
8484
args:
8585
- --fix
8686
- --select=B,C,E,F,W
8787
- --ignore=C901,E203,E402,E501,W391,E261
88-
89-
- repo: https://github.com/psf/black
90-
rev: 23.7.0
91-
hooks:
92-
- id: black
93-
args:
94-
- --safe
95-
- "--target-version=py311"
88+
- id: ruff-format
89+
types_or: [python,pyi]
90+
args:
91+
- --target-version=py311
9692

9793
- repo: https://github.com/pre-commit/mirrors-mypy
9894
rev: 'v1.4.1'

OpenOversight/app/filters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Contains all templates filters."""
2+
23
from datetime import datetime
34
from zoneinfo import ZoneInfo
45

OpenOversight/app/models/database_imports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def update_link_from_dict(data: Dict[str, Any], link: Link) -> Link:
252252

253253

254254
def get_or_create_license_plate_from_dict(
255-
data: Dict[str, Any]
255+
data: Dict[str, Any],
256256
) -> Tuple[LicensePlate, bool]:
257257
number = data["number"]
258258
state = parse_str(data.get("state"), None)
@@ -266,7 +266,7 @@ def get_or_create_license_plate_from_dict(
266266

267267

268268
def get_or_create_location_from_dict(
269-
data: Dict[str, Any]
269+
data: Dict[str, Any],
270270
) -> Tuple[Optional[Location], bool]:
271271
street_name = parse_str(data.get("street_name"), None)
272272
cross_street1 = parse_str(data.get("cross_street1"), None)

OpenOversight/app/utils/choices.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Contains choice lists of (value, label) tuples for form Select fields."""
2+
23
from us import states
34

45

OpenOversight/migrations/versions/2017-12-10-0512_114919b27a9f_initial_migration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2017-12-10 05:20:45.748342
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011

OpenOversight/migrations/versions/2017-12-23-1812_42233d18ac7b_change_type_of_star_no_to_string.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2017-12-23 18:03:07.304611
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011

OpenOversight/migrations/versions/2018-04-12-1504_af933dc1ef93_add_preferred_department_column.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2018-04-12 15:41:33.490603
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011

OpenOversight/migrations/versions/2018-04-30-1504_e14a1aa4b58f_add_area_coordinator_columns.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2018-04-30 15:48:51.968189
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011

OpenOversight/migrations/versions/2018-05-03-1505_0acbb0f0b1ef_change_datetime_to_date_officer_details.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2018-05-03 15:00:36.849627
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011
from sqlalchemy.dialects import postgresql

OpenOversight/migrations/versions/2018-05-04-2105_6065d7cdcbf8_add_officers_to_incidents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Create Date: 2018-05-04 21:05:42.060165
66
77
"""
8+
89
import sqlalchemy as sa
910
from alembic import op
1011

0 commit comments

Comments
 (0)