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.
Files changed (59) hide show
  1. constricter/__init__.py +17 -6
  2. constricter/__main__.py +1 -1
  3. constricter/cli/__init__.py +2 -0
  4. constricter/{baseline.py → cli/baseline.py} +1 -1
  5. constricter/cli/command.py +726 -0
  6. constricter/{config.py → cli/config.py} +62 -2
  7. constricter/{explain.py → cli/explain.py} +38 -3
  8. constricter/cli/guard.py +129 -0
  9. constricter/cli/hints.py +789 -0
  10. constricter/cli/options.py +601 -0
  11. constricter/cli/paths.py +51 -0
  12. constricter/{report.py → cli/report.py} +156 -16
  13. constricter/fix/__init__.py +2 -0
  14. constricter/fix/doubts.py +288 -0
  15. constricter/fix/fills.py +226 -0
  16. constricter/fix/fixes.py +192 -0
  17. constricter/fix/guesses.py +211 -0
  18. constricter/fix/hinted.py +242 -0
  19. constricter/fix/imports.py +174 -0
  20. constricter/fix/inference.py +748 -0
  21. constricter/fix/known.py +189 -0
  22. constricter/fix/members.py +197 -0
  23. constricter/fix/opened.py +74 -0
  24. constricter/fix/project.py +491 -0
  25. constricter/fix/returned.py +384 -0
  26. constricter/fix/returns.py +193 -0
  27. constricter/fix/stdlib.json +15351 -0
  28. constricter/fix/stdlib.py +186 -0
  29. constricter/fix/targets.py +184 -0
  30. constricter/noqa.py +1 -1
  31. constricter/notebook.py +4 -3
  32. constricter/offences.py +246 -0
  33. constricter/plugins/__init__.py +2 -0
  34. constricter/{flake8_plugin.py → plugins/flake8.py} +35 -2
  35. constricter/{pylint_plugin.py → plugins/pylint.py} +49 -7
  36. constricter/rules/__init__.py +2 -0
  37. constricter/rules/annotations.py +657 -0
  38. constricter/rules/checker.py +808 -0
  39. constricter/rules/flow.py +485 -0
  40. constricter/rules/narrowing.py +51 -0
  41. constricter/rules/parsed.py +84 -0
  42. constricter/rules/rebinding.py +140 -0
  43. constricter/rules/redundant.py +166 -0
  44. constricter/rules/scope.py +730 -0
  45. constricter/rules/syntax.py +239 -0
  46. constricter/rules/walked.py +75 -0
  47. python_constricter-0.2.5.dist-info/METADATA +378 -0
  48. python_constricter-0.2.5.dist-info/RECORD +53 -0
  49. python_constricter-0.2.5.dist-info/entry_points.txt +6 -0
  50. constricter/annotations.py +0 -653
  51. constricter/checker.py +0 -824
  52. constricter/cli.py +0 -857
  53. constricter/fixes.py +0 -28
  54. constricter/project.py +0 -254
  55. python_constricter-0.2.3.dist-info/METADATA +0 -606
  56. python_constricter-0.2.3.dist-info/RECORD +0 -22
  57. python_constricter-0.2.3.dist-info/entry_points.txt +0 -6
  58. {python_constricter-0.2.3.dist-info → python_constricter-0.2.5.dist-info}/WHEEL +0 -0
  59. {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.checker import (
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
- Coverage,
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.3"
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
@@ -3,7 +3,7 @@
3
3
 
4
4
  import sys
5
5
 
6
- from constricter.cli import main
6
+ from constricter.cli.command import main
7
7
 
8
8
  if __name__ == "__main__": # not when `--jobs` workers import it
9
9
  sys.exit(main())
@@ -0,0 +1,2 @@
1
+ # SPDX-License-Identifier: MIT
2
+ """The `constricter` command (`command.main`): its options, the files it checks, and how it reports."""
@@ -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.checker import Offence
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