Skip to content

Commit a8020bc

Browse files
committed
Update ruff config and sort imports
1 parent eb23367 commit a8020bc

File tree

18 files changed

+27
-21
lines changed

18 files changed

+27
-21
lines changed

.pyproject_generation/pyproject_template.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ fixable = [
4242
"UP", # e.g. List -> list
4343
"I", # sort imports
4444
"D", # pydocstyle
45+
"RUF022", # sort items in __all__
4546
]
4647
ignore = [
4748
"E111", # indentation with invalid multiple (for formatter)
@@ -60,6 +61,8 @@ ignore = [
6061
"D107", # missing docstring in __init__
6162
"D206", # indent-with-spaces (for formatter)
6263
"D300", # triple-single-quotes (for formatter)
64+
"UP040", # type statement (not yet supported by mypy)
65+
"PLC0206", # Extracting value from dictionary without calling `.items()`
6366
]
6467
select = [
6568
"C90", # McCabe Complexity

examples/auth_demo/auth_demo/auth/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
"""Configuration of the auth context."""
1818

19-
__all__ = ["DemoAuthContext", "DemoAuthConfig"]
19+
__all__ = ["DemoAuthConfig", "DemoAuthContext"]
2020

2121
from typing import Any, cast
2222

examples/ghga_auth/ghga_auth/policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
require_auth_context_using_credentials,
3333
)
3434

35-
__all__ = ["OptionalAuthContext", "UserAuthContext", "AdminAuthContext"]
35+
__all__ = ["AdminAuthContext", "OptionalAuthContext", "UserAuthContext"]
3636

3737

3838
async def get_auth_context(

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ fixable = [
8989
"UP",
9090
"I",
9191
"D",
92+
"RUF022",
9293
]
9394
ignore = [
9495
"E111",
@@ -107,6 +108,8 @@ ignore = [
107108
"D107",
108109
"D206",
109110
"D300",
111+
"UP040",
112+
"PLC0206",
110113
]
111114
select = [
112115
"C90",

src/ghga_service_commons/api/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
__all__ = [
4848
"CORRELATION_ID_HEADER_NAME",
4949
"ApiConfigBase",
50-
"set_header_correlation_id",
51-
"get_validated_correlation_id",
52-
"correlation_id_middleware",
50+
"UnexpectedCorrelationIdError",
5351
"configure_app",
52+
"correlation_id_middleware",
53+
"get_validated_correlation_id",
5454
"run_server",
55-
"UnexpectedCorrelationIdError",
55+
"set_header_correlation_id",
5656
]
5757

5858
# unofficial, but frequently used header name

src/ghga_service_commons/api/mock_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
from ghga_service_commons.httpyexpect.server.exceptions import HttpException
3030

3131
__all__ = [
32+
"HttpException",
3233
"MockRouter",
3334
"assert_all_responses_were_requested",
34-
"HttpException",
3535
]
3636

3737
BRACKET_PATTERN = re.compile(r"{.*?}")

src/ghga_service_commons/api/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import httpx
2323

24-
__all__ = ["get_free_port", "AsyncTestClient"]
24+
__all__ = ["AsyncTestClient", "get_free_port"]
2525

2626

2727
def get_free_port() -> int:

src/ghga_service_commons/http/correlation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
CORRELATION_ID_HEADER_NAME = "X-Request-Id"
2727

28-
__all__ = ["attach_correlation_id_to_requests", "AsyncClient"]
28+
__all__ = ["AsyncClient", "attach_correlation_id_to_requests"]
2929

3030

3131
async def _cid_request_hook(request, generate_correlation_id: bool):

src/ghga_service_commons/httpyexpect/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
exceptions.
1919
"""
2020

21-
__all__ = ["Response", "ExceptionMapping", "ResponseTranslator"]
21+
__all__ = ["ExceptionMapping", "Response", "ResponseTranslator"]
2222

2323
from ghga_service_commons.httpyexpect.client.custom_types import Response
2424
from ghga_service_commons.httpyexpect.client.mapping import ExceptionMapping

src/ghga_service_commons/httpyexpect/client/mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
validate_exception_id,
4040
)
4141

42-
__all__ = ["EXCEPTION_FACTORY_PARAMS", "FactoryKit", "ExceptionMapping"]
42+
__all__ = ["EXCEPTION_FACTORY_PARAMS", "ExceptionMapping", "FactoryKit"]
4343

4444
EXCEPTION_FACTORY_PARAMS = ("status_code", "exception_id", "description", "data")
4545

0 commit comments

Comments
 (0)