Skip to content

Commit 356d377

Browse files
authored
Merge pull request #327 from VariantEffect/feature/bencap/267/lint-with-ruff
Lint and Format with Ruff
2 parents 96f5d1a + c76ed51 commit 356d377

File tree

171 files changed

+1899
-1615
lines changed

Some content is hidden

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

171 files changed

+1899
-1615
lines changed

.flake8

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/run-tests-on-push.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,17 @@ jobs:
6161
- run: pip install poetry
6262
- run: poetry install --with dev --extras server
6363
- run: poetry run mypy src/
64+
65+
run-ruff-lint:
66+
runs-on: ubuntu-latest
67+
name: Ruff linting on Python 3.10
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: actions/setup-python@v5
71+
with:
72+
python-version: "3.10"
73+
cache: 'pip'
74+
- run: pip install --upgrade pip
75+
- run: pip install poetry
76+
- run: poetry install --with dev --extras server
77+
- run: poetry run ruff check

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 23.3.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.6.8
45
hooks:
5-
- id: black
6-
# Latest version of Python supported by the project
7-
# See https://pre-commit.com/#top_level-default_language_version
8-
language_version: python3.9
6+
# Run the linter.
7+
- id: ruff
8+
# Run the formatter.
9+
- id: ruff-format

alembic/alembic_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# From https://improveandrepeat.com/2021/09/python-friday-87-handling-pre-existing-tables-with-alembic-and-sqlalchemy/
22
# Based on https://github.com/talkpython/data-driven-web-apps-with-flask
33

4-
from alembic import op
54
from sqlalchemy import engine_from_config
65
from sqlalchemy.engine import reflection
76

7+
from alembic import op
8+
89

910
def table_does_not_exist(table, schema=None):
1011
config = op.get_context().config

alembic/env.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from logging.config import fileConfig
21
import os
2+
from logging.config import fileConfig
33

4-
from sqlalchemy import engine_from_config
5-
from sqlalchemy import pool
4+
from sqlalchemy import engine_from_config, pool
65

76
from alembic import context
87

alembic/versions/194cfebabe32_rename_wild_type_sequence.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
Create Date: 2023-08-29 12:48:18.390567
66
77
"""
8-
from alembic import op
9-
import sqlalchemy as sa
108

9+
from alembic import op
1110

1211
# revision identifiers, used by Alembic.
1312
revision = "194cfebabe32"

alembic/versions/1cee01c42909_make_index_on_contributors_unique.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
Create Date: 2024-09-03 09:53:21.635751
66
77
"""
8-
from alembic import op
9-
import sqlalchemy as sa
108

9+
from alembic import op
1110

1211
# revision identifiers, used by Alembic.
1312
revision = "1cee01c42909"

alembic/versions/1d4933b4b6f7_merge_76e1e55bc5c1_and_d7e6f8c3b9dc.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
Create Date: 2024-09-04 16:17:20.875937
66
77
"""
8-
from alembic import op
9-
import sqlalchemy as sa
10-
118

129
# revision identifiers, used by Alembic.
13-
revision = '1d4933b4b6f7'
14-
down_revision = ('76e1e55bc5c1', 'd7e6f8c3b9dc')
10+
revision = "1d4933b4b6f7"
11+
down_revision = ("76e1e55bc5c1", "d7e6f8c3b9dc")
1512
branch_labels = None
1613
depends_on = None
1714

alembic/versions/22e2d92d602e_add_publication_identifier_metadata_.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
Create Date: 2023-06-01 14:51:04.700969
66
77
"""
8-
from typing import Optional
8+
99
import os
10+
from typing import Optional
1011

1112
import eutils
12-
from eutils._internal.xmlfacades.pubmedarticleset import PubmedArticleSet
1313
import sqlalchemy as sa
1414
from eutils import EutilsNCBIError
15-
from mavedb.lib.exceptions import AmbiguousIdentifierError
15+
from eutils._internal.xmlfacades.pubmedarticleset import PubmedArticleSet
1616
from sqlalchemy.dialects.postgresql import JSONB
1717
from sqlalchemy.orm import Session
1818

1919
from alembic import op
20-
from mavedb.lib.identifiers import ExternalPublication
20+
from mavedb.lib.exceptions import AmbiguousIdentifierError
2121
from mavedb.lib.external_publications import Rxiv
22+
from mavedb.lib.identifiers import ExternalPublication
2223
from mavedb.models.publication_identifier import PublicationIdentifier
2324

2425
# revision identifiers, used by Alembic.

alembic/versions/2b6f40ea2fb6_add_score_range_column.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
Create Date: 2024-09-09 12:25:33.180077
66
77
"""
8-
from alembic import op
8+
99
import sqlalchemy as sa
1010
from sqlalchemy.dialects import postgresql
1111

12+
from alembic import op
13+
1214
# revision identifiers, used by Alembic.
1315
revision = "2b6f40ea2fb6"
1416
down_revision = "1cee01c42909"

0 commit comments

Comments
 (0)