Skip to content

Commit

Permalink
ci: Use ruff to replace black, pyupgrade, and isort
Browse files Browse the repository at this point in the history
For now, replace black, pyupgrade, and isort with ruff.
In the future, we can also replace pylint with ruff.
Pydocstyle was configured but not actually being run, so it has been removed from the config. It can
 also be re-added and replaced with ruff in the future.
  • Loading branch information
zusorio committed Dec 9, 2024
1 parent bc6e9d1 commit 747d74a
Show file tree
Hide file tree
Showing 91 changed files with 144 additions and 119 deletions.
29 changes: 6 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ default_install_hook_types: [commit-msg, pre-commit]
default_stages: [pre-commit, pre-merge-commit]
minimum_pre_commit_version: 3.2.0
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/gitleaks/gitleaks.git
rev: v8.20.1
hooks:
Expand Down Expand Up @@ -39,24 +45,6 @@ repos:
- id: codespell
exclude: 'frontend/package-lock.json'
args: ['-L', 'AKS']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
files: '^backend/'
args:
- '--config'
- 'backend/pyproject.toml'
types: [python]
- id: black
types: [python]
exclude: '^backend/'
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
entry: bash -c "cd backend && isort ."
types: [python]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
Expand Down Expand Up @@ -217,8 +205,3 @@ repos:
stages: [commit-msg]
additional_dependencies:
- '@commitlint/config-conventional'
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: ['--py311-plus']
16 changes: 11 additions & 5 deletions backend/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ sqlalchemy.url =
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples
hooks = ruff, ruff_format

# lint with attempts to fix using "ruff"
ruff.type = exec
ruff.executable = %(here)s/.venv/bin/ruff
ruff.options = check --fix REVISION_SCRIPT_FILENAME

# format using "ruff" - use the exec runner, execute a binary
ruff_format.type = exec
ruff_format.executable = %(here)s/.venv/bin/ruff
ruff_format.options = format REVISION_SCRIPT_FILENAME

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-10-11 17:34:05.210906
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-07-22 14:49:47.575605
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-11-12 14:47:12.295103
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-11-18 11:40:46.395645
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-11-25 13:02:19.197569
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-09-19 11:25:16.343948
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-12-28 16:56:43.714914
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-10-29 14:11:47.774679
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-11-04 12:31:17.024627
"""

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 @@ -8,6 +8,7 @@
Create Date: 2023-06-26 17:04:34.613373
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-10-01 15:46:26.054936
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-02-23 08:53:31.142987
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-10-17 14:08:01.431956
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-05-29 14:25:34.801756
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-08-07 20:09:26.524318
"""

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 @@ -8,6 +8,7 @@
Create Date: 2024-12-02 14:40:15.815359
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-12-21 12:01:00.653463
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-11-08 16:36:18.621808
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-02-02 09:05:00.727519
"""

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 @@ -8,6 +8,7 @@
Create Date: 2022-11-09 16:50:52.026374
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Create Date: 2022-10-06 15:06:40.370022
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-10-24 14:21:07.128985
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-02-09 11:57:07.345877
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-02-15 14:21:18.085411
"""

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 @@ -8,6 +8,7 @@
Create Date: 2022-10-14 08:17:28.933231
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Create Date: 2022-05-27 12:27:22.682178
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-10-14 08:16:20.665269
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-11-10 13:13:25.041000
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-02-20 09:24:05.465477
"""

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 @@ -8,6 +8,7 @@
Create Date: 2024-09-30 19:47:36.253187
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-10-27 14:54:40.452599
"""

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 @@ -8,6 +8,7 @@
Create Date: 2022-10-28 14:22:52.516394
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2023-07-10 09:24:26.635483
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""


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 @@ -8,6 +8,7 @@
Create Date: 2023-08-04 12:05:53.846434
"""

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 @@ -8,6 +8,7 @@
Create Date: 2022-10-06 08:52:02.263343
"""

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 @@ -8,6 +8,7 @@
Create Date: 2022-11-08 10:06:04.740051
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-07-17 09:19:57.903328
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-10-07 10:29:25.859413
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2024-04-25 10:48:56.205850
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Create Date: 2022-10-13 10:51:57.631309
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Loading

0 comments on commit 747d74a

Please sign in to comment.