-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
161 lines (145 loc) · 4.73 KB
/
pyproject.toml
File metadata and controls
161 lines (145 loc) · 4.73 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[tool.ruff]
line-length = 110
builtins = [
# translation lookup
"_",
# translation lookup
"ngettext",
# translation lookup
"pgettext",
# translation lookup
"npgettext",
]
include = [
"*.py",
"sconstruct",
]
exclude = [
".git",
"__pycache__",
]
[tool.ruff.format]
indent-style = "tab"
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint]
ignore = [
# indentation contains tabs
"W191",
]
[tool.ruff.lint.per-file-ignores]
# sconstruct contains many inbuilt functions not recognised by the lint,
# so ignore F821.
"sconstruct" = ["F821"]
[tool.pyright]
pythonPlatform = "Windows"
typeCheckingMode = "strict"
include = [
"**/*.py",
]
exclude = [
"sconstruct",
".git",
"__pycache__",
# When excluding concrete paths relative to a directory,
# not matching multiple folders by name e.g. `__pycache__`,
# paths are relative to the configuration file.
# skipTranslation is a third-party module.
"addon/appModules/skipTranslation.py",
]
# Tell pyright where to load python code from
extraPaths = [
"./addon",
]
# General config
analyzeUnannotatedFunctions = true
deprecateTypingAliases = true
# Stricter typing
strictParameterNoneValue = true
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
# Compliant rules
reportAbstractUsage = true
reportAssertAlwaysTrue = true
reportAssertTypeFailure = true
reportAssignmentType = true
reportCallInDefaultInitializer = true
reportConstantRedefinition = true
reportDeprecated = true
reportDuplicateImport = true
reportFunctionMemberAccess = true
reportGeneralTypeIssues = true
reportImportCycles = true
reportIncompatibleMethodOverride = true
reportIncompleteStub = true
reportInconsistentConstructor = true
reportInconsistentOverload = true
reportInvalidStringEscapeSequence = true
reportInvalidStubStatement = true
reportInvalidTypeArguments = true
reportInvalidTypeForm = true
reportInvalidTypeVarUse = true
reportMatchNotExhaustive = true
reportMissingModuleSource = true
reportMissingSuperCall = true
reportNoOverloadImplementation = true
reportOperatorIssue = true
reportOptionalCall = true
reportOptionalContextManager = true
reportOptionalIterable = true
reportOptionalOperand = true
reportOverlappingOverload = true
reportPossiblyUnboundVariable = true
reportPrivateImportUsage = true
reportPrivateUsage = true
reportPropertyTypeMismatch = true
reportRedeclaration = true
reportReturnType = true
reportSelfClsParameterName = true
reportTypeCommentUsage = true
reportTypedDictNotRequiredAccess = true
reportUnboundVariable = true
reportUnhashable = true
reportUninitializedInstanceVariable = true
reportUnknownLambdaType = true
reportUnnecessaryCast = true
reportUnnecessaryComparison = true
reportUnnecessaryContains = true
reportUnnecessaryIsInstance = true
reportUnnecessaryTypeIgnoreComment = true
reportUnsupportedDunderAll = true
reportUntypedClassDecorator = true
reportUntypedNamedTuple = true
reportUnusedClass = true
reportUnusedCoroutine = true
reportUnusedExcept = true
reportUnusedExpression = true
reportUnusedFunction = true
reportUnusedImport = true
reportUnusedVariable = true
reportWildcardImportFromLibrary = true
# Can be enabled by generating type stubs for modules via pyright CLI
reportMissingTypeStubs = false
# Bad rules
# These are sorted alphabetically and should be enabled and moved to compliant rules section when resolved.
reportArgumentType = false # Unexpected argument types
reportAttributeAccessIssue = false # ConfigObj attribute access
reportCallIssue = false # Mostly ConfigObj getitem/setitem
reportImplicitOverride = false # Some methods override abstract or base class methods
reportImplicitStringConcatenation = false # Long text split into multiple lines to keep them under line length limit
reportIncompatibleVariableOverride = false # ConfigObj is a mutable mapping
reportIndexIssue = false # ConfigObj is a mapping
reportMissingImports = false # wxPython and NVDA Core modules
reportMissingParameterType = false # Mostly wxPython and NVDA Core/gestures/classes
reportMissingTypeArgument = false # collections.ChainMap is a mapping
reportOptionalMemberAccess = false # Objects een as None when in fact they can be instantiated
reportOptionalSubscript = false # ConfigObj is seen as None when in fact it is not
reportUndefinedVariable = false # _ = gettext.gettext call
reportUnknownArgumentType = false # Mostly Python types
reportUnknownMemberType = false # NVDA Core attributes
reportUnknownParameterType = false # Mostly NVDA Core and unknown Python parameter types
reportUnknownVariableType = false # Mostly NVDA Core content
reportUntypedBaseClass = false # wxPython and NVDA Core classes
reportUntypedFunctionDecorator = false # Script decorator
reportUnusedCallResult = false # Functions returning something but not needed (notably Studio API calls)