Skip to content

Commit

Permalink
Merge pull request #2069 from DSD-DBS/use-ruff
Browse files Browse the repository at this point in the history
ci: Use ruff to replace black, pyupgrade, and isort
  • Loading branch information
MoritzWeber0 authored Dec 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 42285e8 + 747d74a commit d4de17f
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
@@ -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:
@@ -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:
@@ -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
@@ -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]
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2024-10-11 17:34:05.210906
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2023-06-26 17:04:34.613373
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2024-12-02 14:40:15.815359
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2022-11-09 16:50:52.026374
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2022-10-14 08:17:28.933231
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2024-09-30 19:47:36.253187
"""

import sqlalchemy as sa
from alembic import op

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2022-10-28 14:22:52.516394
"""

from alembic import op

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

import sqlalchemy as sa
from alembic import op

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


import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
Create Date: 2022-11-08 10:06:04.740051
"""

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

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

import sqlalchemy as sa
from alembic import op

Loading

0 comments on commit d4de17f

Please sign in to comment.