Skip to content

Commit 5037de2

Browse files
committed
add ignore linting rules to have the same result like before with pylint.
1 parent 0ab0b53 commit 5037de2

File tree

3 files changed

+185
-24
lines changed

3 files changed

+185
-24
lines changed

eventsourcingdb/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def __aenter__(self) -> "Client":
3434

3535
async def __aexit__(
3636
self,
37-
exc_type: BaseException | None = None,
37+
exc_type: type[BaseException] | None = None,
3838
exc_val: BaseException | None = None,
3939
exc_tb: TracebackType | None = None,
4040
) -> None:

pyproject.toml

Lines changed: 70 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "eventsourcingdb"
33
version = "1.1.0"
44
description = "The official Python client SDK for EventSourcingDB."
55
authors = [{ name = "the native web GmbH", email = "[email protected]" }]
6-
requires-python = "~=3.11"
6+
requires-python = ">=3.11, <=3.13"
77
readme = "README.md"
88
license = "MIT"
99
dependencies = [
@@ -17,37 +17,89 @@ dev = [
1717
"pytest-timeout==2.4.0",
1818
"pytest-asyncio==0.26.0",
1919
"ruff==0.11.13",
20+
"pytest-cov>=6.1.1",
2021
]
2122

2223
[build-system]
2324
requires = ["hatchling"]
2425
build-backend = "hatchling.build"
2526

26-
# Former pytest.ini
2727
[tool.pytest.ini_options]
2828
timeout = 30
2929
asyncio_default_fixture_loop_scope = "function"
3030

31-
# Remove the Pylint configuration and replace with Ruff configuration
3231
[tool.ruff]
33-
# Enable Pylint (`PL`) and many other linters
34-
lint.select = ["E", "F", "B", "I", "N", "UP", "PL", "PT", "C4", "DTZ", "T10", "EM", "EXE", "ISC", "ICN", "INP", "PIE", "T20", "PYI", "RSE", "SLF", "SIM", "INT", "ARG", "PTH", "PD", "PGH", "RUF"]
32+
# Die lint.select-Option bestimmt, welche Linting-Regeln aktiviert werden
33+
lint.select = ["ALL"] # Alle Regeln aktivieren
34+
35+
# Regeln ausschließen, die für das Projekt nicht relevant sind
3536
lint.ignore = [
36-
# Equivalent to Pylint's missing-module-docstring
37-
"D100",
38-
# Equivalent to missing-class-docstring
39-
"D101",
40-
# Equivalent to missing-function-docstring
41-
"D102",
42-
# Equivalent to too-few-public-methods
43-
"PLR0913",
44-
# Equivalent to too-many-arguments
45-
"PLR0917",
46-
# Equivalent to duplicate-code
47-
"PLR0912"
37+
# Documentation related
38+
"D100", # Missing docstring in public module/package
39+
"D101", # Missing docstring in public class
40+
"D102", # Missing docstring in public method/function
41+
"D103", # Missing docstring in public function
42+
"D104", # Missing docstring in public package
43+
"D105", # Missing docstring in magic method
44+
"D107", # Missing docstring in __init__ method
45+
"D203", # incorrect-blank-line-before-class (incompatible with D211)
46+
"D213", # multi-line-summary-second-line (incompatible with D212)
47+
48+
# Typing related
49+
"PYI036", # Incorrect __aexit__ annotation
50+
"ANN001", # Missing type annotation for function argument
51+
"ANN202", # Missing return type annotation for private function
52+
"ANN205", # Missing return type annotation for staticmethod
53+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
54+
55+
# Exception handling
56+
"EM101", # Exception must not use a string literal
57+
"EM102", # Exception must not use an f-string literal
58+
"TRY003", # Avoid specifying long messages outside exception class
59+
"TRY201", # Use raise without specifying exception name
60+
61+
# Assertion in tests
62+
"S101", # Use of `assert` detected
63+
"S105", # Possible hardcoded password
64+
65+
# Import related
66+
"F401", # Imported but unused
67+
"TID252", # Prefer absolute imports over relative imports from parent modules
68+
69+
# Code structure
70+
"PLR0904", # Too few public methods
71+
"PLR0912", # Too many branches
72+
"PLR0913", # Too many instance attributes
73+
"PLR0917", # Too many arguments
74+
"SIM102", # Use a single if statement instead of nested if statements
75+
"SIM105", # Use contextlib.suppress instead of try-except-pass
76+
"C901", # Function is too complex
77+
78+
# Performance
79+
"PERF401", # Use an async list comprehension to create a transformed list
80+
81+
# Style
82+
"COM812", # Trailing comma missing
83+
"A001", # Variable is shadowing a Python builtin
84+
"RET504", # Unnecessary assignment before return statement
85+
"FBT001", # Boolean-typed positional argument in function definition
86+
"FBT002", # Boolean default positional argument in function definition
87+
"PGH003", # Use specific rule codes when ignoring type issues
88+
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
89+
"RUF013", # PEP 484 prohibits implicit Optional
90+
91+
# Logging
92+
"LOG015", # Warning call on root logger
93+
94+
# Path handling
95+
"PTH118", # os.path.join() should be replaced by Path with / operator
96+
"PTH120", # os.path.dirname() should be replaced by Path.parent
97+
"PTH123", # open() should be replaced by Path.open()
98+
99+
# Async
100+
"ASYNC251", # Async functions should not call time.sleep
48101
]
49102
line-length = 100
50103

51-
# Additional check to generate an .editorconfig file based on pyproject.toml settings
52104
[tool.editorconfig]
53105
generate = true

0 commit comments

Comments
 (0)