@@ -74,51 +74,40 @@ lint.select = [
7474 " ALL" ,
7575]
7676lint.ignore = [
77- " ANN001" , # Missing type annotation for function argument
78- " ANN002" , # Missing type annotation for *args
79- " ANN202" , # Missing return type annotation for private function
80- " ANN204" , # Missing return type annotation for special method
81- " ANN205" , # Missing return type annotation for staticmethod
82- " ANN206" , # Missing return type annotation for classmethod
83- " ANN401" , # Dynamically typed expressions (typing.Any)
84- " ARG001" , # Unused function argument
85- " ARG005" , # Unused lambda argument
86- " B905" , # zip-without-explicit-strict (conflicts with ty on 3.8)
87- " C901" , # Too complex
88- " COM812" , # Conflict with formatter
89- " CPY" , # No copyright statements
90- " D" , # Docstring rules
91- " DOC" , # Docstring content rules
92- " E501" , # Line too long (formatter handles it)
93- " FBT" , # Boolean positional arguments
94- " INP001" , # Implicit namespace package
95- " ISC001" , # Conflict with formatter
96- " PLC0415" , # import at top level
97- " PLR0904" , # Too many public methods
98- " PLR0911" , # Too many return statements
99- " PLR0912" , # Too many branches
100- " PLR0913" , # Too many arguments
101- " PLR0914" , # Too many local variables
102- " PLR0915" , # Too many statements
103- " PLR0917" , # Too many positional arguments
104- " PLR1702" , # Too many nested blocks
105- " PLR2004" , # Magic value used in comparison
106- " PLR6301" , # Method could be a function
107- " PTH" , # Use pathlib (existing code uses os.path)
108- " PYI024" , # Use `typing.NamedTuple` instead of `collections.namedtuple`
109- " RUF067" , # __init__ module should only contain re-exports
110- " S104" , # Possible binding to all interface
111- " S404" , # subprocess module is possibly insecure
112- " S603" , # `subprocess` call: check for execution of untrusted input
113- " SLF001" , # Private member accessed
114- " TID252" , # Prefer absolute imports over relative (internal package uses relative)
115- " TRY301" , # Abstract `raise` to an inner function
77+ " COM812" , # Conflict with formatter
78+ " CPY" , # No copyright statements
79+ " D203" , # `one-blank-line-before-class` and `no-blank-line-before-class` are incompatible
80+ " D212" , # `multi-line-summary-first-line` and `multi-line-summary-second-line` are incompatible
81+ " DOC201" , # `return` is not documented in docstring
82+ " DOC402" , # `yield` is not documented in docstring
83+ " DOC501" , # `raises` is not documented in docstring
84+ " ISC001" , # Conflict with formatter
85+ " S104" , # Possible binding to all interface
86+ ]
87+ lint.per-file-ignores."docs/**/*.py" = [
88+ " INP001" , # no __init__.py in docs directory
89+ ]
90+ lint.per-file-ignores."src/py_discovery/_discovery.py" = [
91+ " PTH" , # shim resolution uses string-based os.path for consistency with env variables
92+ ]
93+ lint.per-file-ignores."src/py_discovery/_py_info.py" = [
94+ " PTH" , # must use os.path — file runs as subprocess script with only stdlib
95+ ]
96+ lint.per-file-ignores."src/py_discovery/_windows/_pep514.py" = [
97+ " PTH" , # os.path.exists is monkeypatched in tests; pathlib.Path.exists bypasses the mock
11698]
11799lint.per-file-ignores."tests/**/*.py" = [
100+ " D" , # don't care about documentation in tests
101+ " FBT" , # don't care about booleans as positional arguments in tests
118102 " INP001" , # no implicit namespace
119- " PLC2701" , # Private imports
103+ " PLC0415" , # imports inside test functions (conditional on mocking)
104+ " PLC2701" , # private imports needed to test internal APIs
105+ " PLR0913" , # too many arguments (pytest fixtures)
106+ " PLR2004" , # Magic value used in comparison
120107 " S101" , # asserts allowed in tests
121- " S102" , # use of exec
108+ " S404" , # subprocess import
109+ " S603" , # `subprocess` call: check for execution of untrusted input
110+ " SLF001" , # private member access needed to test internals
122111]
123112lint.per-file-ignores."tests/windows/winreg_mock_values.py" = [
124113 " F821" , # undefined name (winreg available only on Windows)
@@ -173,5 +162,15 @@ paths.source = [
173162src.exclude = [ " tests/windows/winreg_mock_values.py" ]
174163
175164[[tool .ty .overrides ]]
176- include = [ " src/py_discovery/_py_info.py" , " tests/test_py_info_extra.py" ]
165+ include = [ " src/py_discovery/_py_info.py" , " src/py_discovery/_py_spec.py" ]
166+ rules.unused-ignore-comment = " ignore"
167+ rules.invalid-argument-type = " ignore"
168+ rules.invalid-return-type = " ignore"
169+ rules.no-matching-overload = " ignore"
170+
171+ [[tool .ty .overrides ]]
172+ include = [ " tests/**/*.py" ]
177173rules.unused-ignore-comment = " ignore"
174+ rules.invalid-argument-type = " ignore"
175+ rules.no-matching-overload = " ignore"
176+ rules.unresolved-attribute = " ignore"
0 commit comments