-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
117 lines (103 loc) · 3.28 KB
/
Copy pathpyproject.toml
File metadata and controls
117 lines (103 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "effects"
dynamic = ["version"]
requires-python = ">=3.12"
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov",
"pytest-xdist",
"ruff",
"pyright",
"pre-commit",
"ipdb",
]
[tool.setuptools.dynamic]
version = {attr = "effects.__version__.__version__"}
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--maxfail=1 --disable-warnings -q"
testpaths = ["tests"]
[tool.ruff]
target-version = "py312"
line-length = 100
indent-width = 4
exclude = [
".git",
"__pycache__",
"build",
"dist",
"*.egg-info",
".venv",
"venv",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sorting)
"B", # flake8-bugbear (common bugs)
"C4", # flake8-comprehensions
"UP", # pyupgrade (modern Python patterns)
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # Line too long (handled by formatter)
"ARG001", # Unused function argument (common in effect handlers)
"ARG002", # Unused method argument
"B008", # Do not perform function calls in argument defaults
"B011", # Do not assert False (used in tests)
"B028", # No explicit stacklevel in warnings (not critical)
"SIM108", # Use ternary operator instead of if-else block
"SIM117", # Nested with statements (sometimes clearer)
"UP035", # Deprecated typing imports (ContextManager still widely used)
"UP047", # Use type parameters (not always needed)
"RUF003", # Ambiguous unicode characters (× in comments is fine)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"] # Allow unused imports and star imports
"test_*.py" = ["ARG"] # Test functions often have unused fixtures
[tool.ruff.lint.isort]
known-first-party = ["effects"]
combine-as-imports = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pyright]
include = ["src", "tests"]
exclude = ["**/__pycache__", "build", "dist", "*.egg-info"]
pythonVersion = "3.12"
pythonPlatform = "All"
typeCheckingMode = "standard" # Not strict - allows gradual typing
# Leverage inference while catching real issues
useLibraryCodeForTypes = true
reportMissingTypeStubs = false
reportMissingImports = true
# Don't require type annotations everywhere - let Pyright infer
reportMissingParameterType = "none"
reportUnknownParameterType = "none"
reportMissingTypeArgument = "none"
reportUnknownMemberType = "none"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
reportUnknownVariableType = "none"
# Catch actual problems
reportMatchNotExhaustive = "error" # Catch missed pattern matching cases
reportUnusedVariable = "warning"
reportUnusedImport = "warning"
reportUnusedClass = "warning"
reportUnusedFunction = "warning"
reportPrivateUsage = "warning"
reportDuplicateImport = "warning"
# Effects library specific - these patterns are common
reportIncompatibleMethodOverride = "none" # Effect handlers override differently
reportIncompatibleVariableOverride = "none" # State management patterns