Skip to content

Commit 290566b

Browse files
committed
remove ruff all to the more practical rules
1 parent 32bbeb3 commit 290566b

File tree

9 files changed

+49
-74
lines changed

9 files changed

+49
-74
lines changed

eventsourcingdb/errors/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
from .internal_error import InternalError
44
from .server_error import ServerError
55
from .validation_error import ValidationError
6+
7+
__all__ = [
8+
"ClientError",
9+
"CustomError",
10+
"InternalError",
11+
"ServerError",
12+
"ValidationError",
13+
]

eventsourcingdb/event/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
from .event import Event
22
from .event_candidate import EventCandidate
3+
4+
__all__ = [
5+
"Event",
6+
"EventCandidate",
7+
]

eventsourcingdb/http_client/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
from .get_post_headers import get_post_headers
33
from .http_client import HttpClient
44
from .response import Response
5+
6+
__all__ = [
7+
"get_get_headers",
8+
"get_post_headers",
9+
"HttpClient",
10+
"Response",
11+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
from .if_event_is_missing_during_observe import IfEventIsMissingDuringObserve
22
from .observe_events_options import ObserveEventsOptions
33
from .observe_from_latest_event import ObserveFromLatestEvent
4+
5+
__all__ = [
6+
"IfEventIsMissingDuringObserve",
7+
"ObserveEventsOptions",
8+
"ObserveFromLatestEvent",
9+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
from .event_type import EventType
22
from .is_event_type import is_event_type
3+
4+
__all__ = [
5+
"EventType",
6+
"is_event_type",
7+
]

eventsourcingdb/read_events/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
from .order import Order
33
from .read_events_options import ReadEventsOptions
44
from .read_from_latest_event import ReadFromLatestEvent
5+
6+
__all__ = [
7+
"IfEventIsMissingDuringRead",
8+
"Order",
9+
"ReadEventsOptions",
10+
"ReadFromLatestEvent",
11+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
from .is_subject import is_subject
2+
3+
__all__ = [
4+
"is_subject",
5+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
from .preconditions import IsSubjectOnEventId, IsSubjectPristine, Precondition
2+
3+
__all__ = [
4+
"IsSubjectOnEventId",
5+
"IsSubjectPristine",
6+
"Precondition",
7+
]

pyproject.toml

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dev = [
1919
"pytest-cov==5.0.0",
2020
"ruff==0.11.13",
2121
"bandit==1.7.7",
22-
"pyright==1.1.402",
22+
"pyright==1.1.403",
2323
]
2424

2525
[build-system]
@@ -39,76 +39,3 @@ include = ["eventsourcingdb/**/*.py", "eventsourcingdb/py.typed"]
3939
[tool.pytest.ini_options]
4040
timeout = 30
4141
asyncio_default_fixture_loop_scope = "function"
42-
43-
[tool.ruff]
44-
# The lint.select option determines which linting rules are enabled
45-
lint.select = ["ALL"] # Enable all rules
46-
47-
# Rules to exclude that are not relevant for this project
48-
lint.ignore = [
49-
# Documentation related
50-
"D100", # Missing docstring in public module/package
51-
"D101", # Missing docstring in public class
52-
"D102", # Missing docstring in public method/function
53-
"D103", # Missing docstring in public function
54-
"D104", # Missing docstring in public package
55-
"D105", # Missing docstring in magic method
56-
"D107", # Missing docstring in __init__ method
57-
"D203", # incorrect-blank-line-before-class (incompatible with D211)
58-
"D213", # multi-line-summary-second-line (incompatible with D212)
59-
60-
# Typing related
61-
"PYI036", # Incorrect __aexit__ annotation
62-
"ANN001", # Missing type annotation for function argument
63-
"ANN202", # Missing return type annotation for private function
64-
"ANN205", # Missing return type annotation for staticmethod
65-
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
66-
67-
# Exception handling
68-
"EM101", # Exception must not use a string literal
69-
"EM102", # Exception must not use an f-string literal
70-
"TRY003", # Avoid specifying long messages outside exception class
71-
"TRY201", # Use raise without specifying exception name
72-
73-
# Assertion in tests
74-
"S101", # Use of `assert` detected
75-
"S105", # Possible hardcoded password
76-
77-
# Import related
78-
"F401", # Imported but unused
79-
"TID252", # Prefer absolute imports over relative imports from parent modules
80-
81-
# Code structure
82-
"PLR0904", # Too few public methods
83-
"PLR0912", # Too many branches
84-
"PLR0913", # Too many instance attributes
85-
"PLR0917", # Too many arguments
86-
"SIM102", # Use a single if statement instead of nested if statements
87-
"SIM105", # Use contextlib.suppress instead of try-except-pass
88-
"C901", # Function is too complex
89-
90-
# Performance
91-
"PERF401", # Use an async list comprehension to create a transformed list
92-
93-
# Style
94-
"COM812", # Trailing comma missing
95-
"A001", # Variable is shadowing a Python builtin
96-
"RET504", # Unnecessary assignment before return statement
97-
"FBT001", # Boolean-typed positional argument in function definition
98-
"FBT002", # Boolean default positional argument in function definition
99-
"PGH003", # Use specific rule codes when ignoring type issues
100-
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
101-
"RUF013", # PEP 484 prohibits implicit Optional
102-
103-
# Logging
104-
"LOG015", # Warning call on root logger
105-
106-
# Path handling
107-
"PTH118", # os.path.join() should be replaced by Path with / operator
108-
"PTH120", # os.path.dirname() should be replaced by Path.parent
109-
"PTH123", # open() should be replaced by Path.open()
110-
111-
# Async
112-
"ASYNC251", # Async functions should not call time.sleep
113-
]
114-
line-length = 100

0 commit comments

Comments
 (0)