Skip to content

Commit

Permalink
Remove black and use ruff formatter (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett authored Jun 27, 2024
1 parent 67d618f commit 942edd0
Show file tree
Hide file tree
Showing 47 changed files with 72 additions and 27 deletions.
16 changes: 6 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,18 @@ repos:
- --quiet

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.4.10
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
types_or: [python,pyi]
args:
- --fix
- --select=B,C,E,F,W
- --ignore=C901,E203,E402,E501,W391,E261

- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
args:
- --safe
- "--target-version=py311"
- id: ruff-format
types_or: [python,pyi]
args:
- --target-version=py311

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.4.1'
Expand Down
1 change: 1 addition & 0 deletions OpenOversight/app/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains all templates filters."""

from datetime import datetime
from zoneinfo import ZoneInfo

Expand Down
4 changes: 2 additions & 2 deletions OpenOversight/app/models/database_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def update_link_from_dict(data: Dict[str, Any], link: Link) -> Link:


def get_or_create_license_plate_from_dict(
data: Dict[str, Any]
data: Dict[str, Any],
) -> Tuple[LicensePlate, bool]:
number = data["number"]
state = parse_str(data.get("state"), None)
Expand All @@ -266,7 +266,7 @@ def get_or_create_license_plate_from_dict(


def get_or_create_location_from_dict(
data: Dict[str, Any]
data: Dict[str, Any],
) -> Tuple[Optional[Location], bool]:
street_name = parse_str(data.get("street_name"), None)
cross_street1 = parse_str(data.get("cross_street1"), None)
Expand Down
1 change: 1 addition & 0 deletions OpenOversight/app/utils/choices.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains choice lists of (value, label) tuples for form Select fields."""

from us import states


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-12-10 05:20:45.748342
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-12-23 18:03:07.304611
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-04-12 15:41:33.490603
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-04-30 15:48:51.968189
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-03 15:00:36.849627
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-04 21:05:42.060165
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-04 21:03:12.925484
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-10 20:02:19.006081
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-15 17:03:06.270691
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-05-15 19:56:14.199692
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-06-04 19:04:23.524079
"""

import os
import sys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-06-06 19:34:16.439093
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-06-07 15:32:25.524117
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-06-07 18:53:47.656557
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-06-07 18:52:31.059396
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-07-26 18:36:10.061968
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-11 20:31:02.265231
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-13 13:18:15.381300
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-18 13:36:00.987327
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-01-07 21:57:48.495757
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-01-24 15:54:08.123125
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-01-25 15:47:13.812837
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-02-03 05:33:05.296642
"""

import os
import sys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-03-15 22:40:10.473917
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-04-17 18:26:35.733783
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-04-20 17:54:41.661851
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-04-24 19:55:46.168086
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-05-04 05:28:06.869101
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-04-24 01:58:05.146902
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import column, table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-07-13 02:45:07.533549
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-07-31 14:03:59.871182
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-01-05 06:50:40.070530
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-18 17:17:02.018209
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-18 19:21:43.632936
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-18 20:27:19.891054
"""

from alembic import op


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-19 16:38:49.233825
"""

import os

import sqlalchemy as sa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-24 16:19:01.375427
"""

import uuid

import sqlalchemy as sa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-26 15:51:05.329701
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-08-01 19:05:34.745077
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-08-21 03:00:57.468190
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-06-05 02:03:29.168771
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Loading

0 comments on commit 942edd0

Please sign in to comment.