Skip to content

Commit 14187bc

Browse files
authored
Merge pull request #14 from realshouzy/pre-commit-ci-update-config
2 parents 29f5510 + 830fff7 commit 14187bc

18 files changed

+51
-51
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ repos:
3434
hooks:
3535
- id: isort
3636
- repo: https://github.com/astral-sh/ruff-pre-commit
37-
rev: v0.7.2
37+
rev: v0.8.1
3838
hooks:
3939
- id: ruff
4040
args: [--fix, --exit-non-zero-on-fix]
4141
- repo: https://github.com/pycqa/bandit
42-
rev: 1.7.10
42+
rev: 1.8.0
4343
hooks:
4444
- id: bandit
4545
args: [-c, pyproject.toml]

nrw/algorithms/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
from __future__ import annotations
44

55
__all__: Final[list[str]] = [
6-
"linear_search",
7-
"depth_first_search",
86
"breadth_first_search",
97
"bubble_sort",
10-
"selection_sort",
8+
"depth_first_search",
9+
"inorder",
1110
"insertion_sort",
11+
"levelorder",
12+
"linear_search",
1213
"merge_sort",
13-
"quick_sort",
14-
"preorder",
15-
"inorder",
1614
"postorder",
17-
"levelorder",
15+
"preorder",
16+
"quick_sort",
17+
"selection_sort",
1818
]
1919

2020
from typing import Final

nrw/algorithms/__init__.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# pylint: skip-file
22
__all__: Final[list[str]] = [
3-
"linear_search",
4-
"depth_first_search",
53
"breadth_first_search",
64
"bubble_sort",
7-
"selection_sort",
5+
"depth_first_search",
6+
"inorder",
87
"insertion_sort",
8+
"levelorder",
9+
"linear_search",
910
"merge_sort",
10-
"quick_sort",
11-
"preorder",
12-
"inorder",
1311
"postorder",
14-
"levelorder",
12+
"preorder",
13+
"quick_sort",
14+
"selection_sort",
1515
]
1616

1717
from typing import Final, TypeVar, overload

nrw/algorithms/_searching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from __future__ import annotations
44

55
__all__: Final[list[str]] = [
6-
"linear_search",
7-
"depth_first_search",
86
"breadth_first_search",
7+
"depth_first_search",
8+
"linear_search",
99
]
1010

1111
from typing import TYPE_CHECKING, Final, TypeVar

nrw/algorithms/_sorting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
__all__: Final[list[str]] = [
66
"bubble_sort",
7-
"selection_sort",
87
"insertion_sort",
98
"merge_sort",
109
"quick_sort",
10+
"selection_sort",
1111
]
1212

1313
from typing import TYPE_CHECKING, Final

nrw/algorithms/_traversal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from __future__ import annotations
44

55
__all__: Final[list[str]] = [
6-
"preorder",
76
"inorder",
8-
"postorder",
97
"levelorder",
8+
"postorder",
9+
"preorder",
1010
]
1111

1212
from typing import Final, TypeVar

nrw/database/_query_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class QueryResult:
1515
Die Klasse verfügt über keinen öffentlichen Konstruktor.
1616
"""
1717

18-
__slots__: Final[tuple[str, str, str]] = ("_data", "_column_names", "_column_types")
18+
__slots__: Final[tuple[str, str, str]] = ("_column_names", "_column_types", "_data")
1919

2020
def __init__(
2121
self,

nrw/database/_query_result.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ __all__: Final[list[str]] = ["QueryResult"]
44
from typing import Any, Final
55

66
class QueryResult:
7-
__slots__: Final[tuple[str, str, str]] = ("_data", "_column_names", "_column_types")
7+
__slots__: Final[tuple[str, str, str]] = ("_column_names", "_column_types", "_data")
88
def __init__(
99
self,
1010
data: list[tuple[Any, ...]],

nrw/datastructures/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
from __future__ import annotations
44

55
__all__: Final[list[str]] = [
6-
"Stack",
7-
"Queue",
8-
"List",
6+
"BinarySearchTree",
97
"BinaryTree",
108
"ComparableContent",
119
"ComparableContentT",
12-
"Vertex",
1310
"Edge",
14-
"BinarySearchTree",
1511
"Graph",
12+
"List",
13+
"Queue",
14+
"Stack",
15+
"Vertex",
1616
]
1717

1818

nrw/datastructures/__init__.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# pylint: skip-file
22
__all__: Final[list[str]] = [
3-
"Stack",
4-
"Queue",
5-
"List",
3+
"BinarySearchTree",
64
"BinaryTree",
75
"ComparableContent",
86
"ComparableContentT",
9-
"Vertex",
107
"Edge",
11-
"BinarySearchTree",
128
"Graph",
9+
"List",
10+
"Queue",
11+
"Stack",
12+
"Vertex",
1313
]
1414

1515
from typing import Final, Generic, TypeVar, overload
@@ -43,7 +43,7 @@ class Stack(Generic[_T]):
4343
def top(self) -> _T | None: ...
4444

4545
class List(Generic[_T]):
46-
__slots__: Final[tuple[str, str, str]] = ("_first", "_last", "_current")
46+
__slots__: Final[tuple[str, str, str]] = ("_current", "_first", "_last")
4747
__hash__ = None # type: ignore[assignment]
4848

4949
def __init__(self) -> None: ...
@@ -131,7 +131,7 @@ class Vertex:
131131
def is_marked(self) -> bool: ...
132132

133133
class Edge:
134-
__slots__: Final[tuple[str, str, str]] = ("_vertices", "_weight", "_mark")
134+
__slots__: Final[tuple[str, str, str]] = ("_mark", "_vertices", "_weight")
135135
__hash__ = None # type: ignore[assignment]
136136

137137
def __init__(self, vertex: Vertex, another_vertex: Vertex, weight: int) -> None: ...
@@ -149,7 +149,7 @@ class Edge:
149149
def is_marked(self) -> bool: ...
150150

151151
class Graph:
152-
__slots__: Final[tuple[str, str]] = ("_vertices", "_edges")
152+
__slots__: Final[tuple[str, str]] = ("_edges", "_vertices")
153153
__hash__ = None # type: ignore[assignment]
154154

155155
def __init__(self) -> None: ...

nrw/datastructures/_edge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Edge:
1818
und eine Markierung gesetzt und abgefragt werden.
1919
"""
2020

21-
__slots__: Final[tuple[str, str, str]] = ("_vertices", "_weight", "_mark")
21+
__slots__: Final[tuple[str, str, str]] = ("_mark", "_vertices", "_weight")
2222
__hash__ = None # type: ignore[assignment]
2323

2424
def __init__(self, vertex: Vertex, another_vertex: Vertex, weight: int) -> None:

nrw/datastructures/_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Graph:
2727
Knotenobjekt zu einer bestimmten ID gehört und ob der Graph leer ist.
2828
"""
2929

30-
__slots__: Final[tuple[str, str]] = ("_vertices", "_edges")
30+
__slots__: Final[tuple[str, str]] = ("_edges", "_vertices")
3131
__hash__ = None # type: ignore[assignment]
3232

3333
def __init__(self) -> None:

nrw/datastructures/_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class List(Generic[_T]):
6161
kann vor dem aktuellen Objekt ein Listenobjekt eingefügt werden.
6262
"""
6363

64-
__slots__: Final[tuple[str, str, str]] = ("_first", "_last", "_current")
64+
__slots__: Final[tuple[str, str, str]] = ("_current", "_first", "_last")
6565
__hash__ = None # type: ignore[assignment]
6666

6767
def __init__(self) -> None:

nrw/network/__init__.py

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

33
from __future__ import annotations
44

5-
__all__: Final[list[str]] = ["Connection", "Client", "Server"]
5+
__all__: Final[list[str]] = ["Client", "Connection", "Server"]
66

77
from typing import Final
88

nrw/network/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# pylint: skip-file
2-
__all__: Final[list[str]] = ["Connection", "Client", "Server"]
2+
__all__: Final[list[str]] = ["Client", "Connection", "Server"]
33

44
from abc import ABC, abstractmethod
55
from typing import Final
66

77
class Connection:
8-
__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
8+
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")
99
def __init__(self, server_ip: str, server_port: int) -> None: ...
1010
def receive(self) -> str | None: ...
1111
def send(self, message: str) -> None: ...
1212
def close(self) -> None: ...
1313

1414
class Client(ABC):
15-
__slots__: Final[tuple[str, str]] = ("_socket_wrapper", "_active")
15+
__slots__: Final[tuple[str, str]] = ("_active", "_socket_wrapper")
1616
def __init__(self, server_ip: str, server_port: int) -> None: ...
1717
@property
1818
def is_connected(self) -> bool: ...
@@ -25,8 +25,8 @@ class Server(ABC):
2525
__slots__: Final[tuple[str, str, str, str]] = (
2626
"__weakref__",
2727
"_connection_handler",
28-
"_message_handlers",
2928
"_lock",
29+
"_message_handlers",
3030
)
3131
def __init__(self, port: int) -> None: ...
3232
@property

nrw/network/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class _SocketWrapper:
18-
__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
18+
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")
1919

2020
def __init__(self, server_ip: str, server_port: int) -> None:
2121
try:
@@ -73,7 +73,7 @@ class Client(ABC):
7373
Eine einmal unterbrochene oder getrennte Verbindung kann nicht reaktiviert werden.
7474
"""
7575

76-
__slots__: Final[tuple[str, str]] = ("_socket_wrapper", "_active")
76+
__slots__: Final[tuple[str, str]] = ("_active", "_socket_wrapper")
7777

7878
def __init__(self, server_ip: str, server_port: int) -> None:
7979
"""Es wird eine Verbindung zum durch `server_ip` und `server_port`

nrw/network/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Connection:
2424
reaktiviert werden.
2525
"""
2626

27-
__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
27+
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")
2828

2929
def __init__(self, server_ip: str, server_port: int) -> None:
3030
"""Ein Objekt vom Typ `Connection` wird erstellt. Dadurch wird eine Verbindung

nrw/network/_server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
class _NewConnectionHandler(threading.Thread):
27-
__slots__: Final[tuple[str, str, str]] = ("_server", "_active", "_server_socket")
27+
__slots__: Final[tuple[str, str, str]] = ("_active", "_server", "_server_socket")
2828

2929
def __init__(
3030
self,
@@ -74,8 +74,8 @@ def close(self) -> None:
7474
class _ClientSocketWrapper:
7575
__slots__: Final[tuple[str, str, str]] = (
7676
"_client_socket",
77-
"_to_client",
7877
"_from_client",
78+
"_to_client",
7979
)
8080

8181
def __init__(self, client_socket: socket.socket | None) -> None:
@@ -135,7 +135,7 @@ def close(self) -> None:
135135

136136

137137
class _ClientMessageHandler(threading.Thread):
138-
__slots__: Final[tuple[str, str, str]] = ("_server", "_active", "_socket_wrapper")
138+
__slots__: Final[tuple[str, str, str]] = ("_active", "_server", "_socket_wrapper")
139139

140140
def __init__(self, client_socket: socket.socket | None, server: Server) -> None:
141141
super().__init__()
@@ -210,9 +210,9 @@ class Server(ABC):
210210

211211
__slots__: Final[tuple[str, str, str, str]] = (
212212
"__weakref__",
213+
"_connection_handler",
213214
"_lock",
214215
"_message_handlers",
215-
"_connection_handler",
216216
)
217217

218218
def __init__(self, port: int) -> None:

0 commit comments

Comments
 (0)