python-constricter 0.2.3__py3-none-any.whl → 0.2.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- constricter/__init__.py +17 -6
- constricter/__main__.py +1 -1
- constricter/cli/__init__.py +2 -0
- constricter/{baseline.py → cli/baseline.py} +1 -1
- constricter/cli/command.py +726 -0
- constricter/{config.py → cli/config.py} +62 -2
- constricter/{explain.py → cli/explain.py} +38 -3
- constricter/cli/guard.py +129 -0
- constricter/cli/hints.py +789 -0
- constricter/cli/options.py +601 -0
- constricter/cli/paths.py +51 -0
- constricter/{report.py → cli/report.py} +156 -16
- constricter/fix/__init__.py +2 -0
- constricter/fix/doubts.py +288 -0
- constricter/fix/fills.py +226 -0
- constricter/fix/fixes.py +192 -0
- constricter/fix/guesses.py +211 -0
- constricter/fix/hinted.py +242 -0
- constricter/fix/imports.py +174 -0
- constricter/fix/inference.py +748 -0
- constricter/fix/known.py +189 -0
- constricter/fix/members.py +197 -0
- constricter/fix/opened.py +74 -0
- constricter/fix/project.py +491 -0
- constricter/fix/returned.py +384 -0
- constricter/fix/returns.py +193 -0
- constricter/fix/stdlib.json +15351 -0
- constricter/fix/stdlib.py +186 -0
- constricter/fix/targets.py +184 -0
- constricter/noqa.py +1 -1
- constricter/notebook.py +4 -3
- constricter/offences.py +246 -0
- constricter/plugins/__init__.py +2 -0
- constricter/{flake8_plugin.py → plugins/flake8.py} +35 -2
- constricter/{pylint_plugin.py → plugins/pylint.py} +49 -7
- constricter/rules/__init__.py +2 -0
- constricter/rules/annotations.py +657 -0
- constricter/rules/checker.py +808 -0
- constricter/rules/flow.py +485 -0
- constricter/rules/narrowing.py +51 -0
- constricter/rules/parsed.py +84 -0
- constricter/rules/rebinding.py +140 -0
- constricter/rules/redundant.py +166 -0
- constricter/rules/scope.py +730 -0
- constricter/rules/syntax.py +239 -0
- constricter/rules/walked.py +75 -0
- python_constricter-0.2.5.dist-info/METADATA +378 -0
- python_constricter-0.2.5.dist-info/RECORD +53 -0
- python_constricter-0.2.5.dist-info/entry_points.txt +6 -0
- constricter/annotations.py +0 -653
- constricter/checker.py +0 -824
- constricter/cli.py +0 -857
- constricter/fixes.py +0 -28
- constricter/project.py +0 -254
- python_constricter-0.2.3.dist-info/METADATA +0 -606
- python_constricter-0.2.3.dist-info/RECORD +0 -22
- python_constricter-0.2.3.dist-info/entry_points.txt +0 -6
- {python_constricter-0.2.3.dist-info → python_constricter-0.2.5.dist-info}/WHEEL +0 -0
- {python_constricter-0.2.3.dist-info → python_constricter-0.2.5.dist-info}/licenses/LICENSE.md +0 -0
constricter/__init__.py
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
# SPDX-License-Identifier: MIT
|
|
2
2
|
"""Every local variable typed where it's first bound."""
|
|
3
3
|
|
|
4
|
-
from constricter.
|
|
4
|
+
from constricter.offences import (
|
|
5
5
|
COMMENT_TYPED_TARGET,
|
|
6
6
|
DEFAULT_CHECKS,
|
|
7
|
+
FIX_KINDS,
|
|
7
8
|
LEVELS,
|
|
9
|
+
LONG_TUPLE,
|
|
10
|
+
MAX_LENGTH,
|
|
11
|
+
MISMATCHED_TYPE,
|
|
12
|
+
NARROWABLE_TYPE,
|
|
8
13
|
NESTED_TYPE,
|
|
9
14
|
NESTING,
|
|
10
15
|
REDUNDANT_TYPE,
|
|
11
16
|
UNANNOTATED,
|
|
12
17
|
UNANNOTATED_MEMBER,
|
|
13
18
|
UNTYPED_TARGET,
|
|
19
|
+
UNUSED_UNION_MEMBER,
|
|
14
20
|
VAGUE_TYPE,
|
|
15
21
|
Checks,
|
|
16
|
-
|
|
22
|
+
FixPolicy,
|
|
17
23
|
Level,
|
|
18
24
|
Offence,
|
|
19
|
-
annotation_coverage,
|
|
20
|
-
check_source,
|
|
21
|
-
check_tree,
|
|
22
25
|
)
|
|
26
|
+
from constricter.rules.checker import Coverage, annotation_coverage, check_source, check_tree
|
|
23
27
|
|
|
24
|
-
__version__ = "0.2.
|
|
28
|
+
__version__ = "0.2.5"
|
|
25
29
|
__all__ = [
|
|
26
30
|
"COMMENT_TYPED_TARGET",
|
|
27
31
|
"DEFAULT_CHECKS",
|
|
32
|
+
"FIX_KINDS",
|
|
28
33
|
"LEVELS",
|
|
34
|
+
"LONG_TUPLE",
|
|
35
|
+
"MAX_LENGTH",
|
|
36
|
+
"MISMATCHED_TYPE",
|
|
37
|
+
"NARROWABLE_TYPE",
|
|
29
38
|
"NESTED_TYPE",
|
|
30
39
|
"NESTING",
|
|
31
40
|
"REDUNDANT_TYPE",
|
|
32
41
|
"UNANNOTATED",
|
|
33
42
|
"UNANNOTATED_MEMBER",
|
|
34
43
|
"UNTYPED_TARGET",
|
|
44
|
+
"UNUSED_UNION_MEMBER",
|
|
35
45
|
"VAGUE_TYPE",
|
|
36
46
|
"Checks",
|
|
37
47
|
"Coverage",
|
|
48
|
+
"FixPolicy",
|
|
38
49
|
"Level",
|
|
39
50
|
"Offence",
|
|
40
51
|
"__version__",
|
constricter/__main__.py
CHANGED
|
@@ -13,7 +13,7 @@ from pathlib import Path
|
|
|
13
13
|
from typing import Final, TypeAlias, cast
|
|
14
14
|
|
|
15
15
|
from constricter import jsonc
|
|
16
|
-
from constricter.
|
|
16
|
+
from constricter.offences import Offence
|
|
17
17
|
|
|
18
18
|
VERSION: Final = 1
|
|
19
19
|
Entries: TypeAlias = dict[str, dict[str, int]] # file -> "CODE name" -> count
|