duty 1.3.0__py3-none-any.whl → 1.4.0__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.
- duty/callables/__init__.py +32 -24
- duty/callables/build.py +76 -0
- duty/callables/git_changelog.py +178 -0
- duty/callables/griffe.py +227 -0
- duty/callables/twine.py +284 -0
- duty/cli.py +2 -0
- duty/context.py +6 -1
- duty/tools/__init__.py +48 -0
- duty/tools/_autoflake.py +138 -0
- duty/tools/_base.py +66 -0
- duty/tools/_black.py +184 -0
- duty/tools/_blacken_docs.py +115 -0
- duty/tools/_build.py +84 -0
- duty/tools/_coverage.py +721 -0
- duty/tools/_flake8.py +230 -0
- duty/tools/_git_changelog.py +186 -0
- duty/tools/_griffe.py +226 -0
- duty/tools/_interrogate.py +160 -0
- duty/tools/_isort.py +579 -0
- duty/tools/_mkdocs.py +271 -0
- duty/tools/_mypy.py +502 -0
- duty/tools/_pytest.py +483 -0
- duty/tools/_ruff.py +451 -0
- duty/tools/_safety.py +97 -0
- duty/tools/_ssort.py +44 -0
- duty/tools/_twine.py +289 -0
- {duty-1.3.0.dist-info → duty-1.4.0.dist-info}/METADATA +2 -1
- duty-1.4.0.dist-info/RECORD +53 -0
- {duty-1.3.0.dist-info → duty-1.4.0.dist-info}/WHEEL +1 -1
- duty-1.3.0.dist-info/RECORD +0 -30
- {duty-1.3.0.dist-info → duty-1.4.0.dist-info}/entry_points.txt +0 -0
- {duty-1.3.0.dist-info → duty-1.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""Callable for [Interrogate](https://github.com/econchick/interrogate)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Literal
|
|
6
|
+
|
|
7
|
+
from duty.tools._base import Tool
|
|
8
|
+
|
|
9
|
+
_BADGE_STYLE = Literal["flat", "flat-square", "flat-square-modified", "for-the-badge", "plastic", "social"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class interrogate(Tool): # noqa: N801
|
|
13
|
+
"""Call [Interrogate](https://github.com/econchick/interrogate)."""
|
|
14
|
+
|
|
15
|
+
cli_name = "interrogate"
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
*src: str,
|
|
20
|
+
verbose: int | None = None,
|
|
21
|
+
quiet: bool | None = None,
|
|
22
|
+
fail_under: float | None = None,
|
|
23
|
+
exclude: str | None = None,
|
|
24
|
+
ignore_init_method: bool | None = None,
|
|
25
|
+
ignore_init_module: bool | None = None,
|
|
26
|
+
ignore_magic: bool | None = None,
|
|
27
|
+
ignore_module: bool | None = None,
|
|
28
|
+
ignore_nested_functions: bool | None = None,
|
|
29
|
+
ignore_nested_classes: bool | None = None,
|
|
30
|
+
ignore_private: bool | None = None,
|
|
31
|
+
ignore_property_decorators: bool | None = None,
|
|
32
|
+
ignore_setters: bool | None = None,
|
|
33
|
+
ignore_semiprivate: bool | None = None,
|
|
34
|
+
ignore_regex: str | None = None,
|
|
35
|
+
whitelist_regex: str | None = None,
|
|
36
|
+
output: str | None = None,
|
|
37
|
+
config: str | None = None,
|
|
38
|
+
color: bool | None = None,
|
|
39
|
+
omit_covered_files: bool | None = None,
|
|
40
|
+
generate_badge: str | None = None,
|
|
41
|
+
badge_format: Literal["png", "svg"] | None = None,
|
|
42
|
+
badge_style: _BADGE_STYLE | None = None,
|
|
43
|
+
) -> None:
|
|
44
|
+
"""Run `interrogate`.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
src: Format the directories and file paths.
|
|
48
|
+
verbose: Level of verbosity.
|
|
49
|
+
quiet: Do not print output.
|
|
50
|
+
fail_under: Fail when coverage % is less than a given amount.
|
|
51
|
+
exclude: Exclude PATHs of files and/or directories.
|
|
52
|
+
ignore_init_method: Ignore `__init__` method of classes.
|
|
53
|
+
ignore_init_module: Ignore `__init__.py` modules.
|
|
54
|
+
ignore_magic: Ignore all magic methods of classes.
|
|
55
|
+
ignore_module: Ignore module-level docstrings.
|
|
56
|
+
ignore_nested_functions: Ignore nested functions and methods.
|
|
57
|
+
ignore_nested_classes: Ignore nested classes.
|
|
58
|
+
ignore_private: Ignore private classes, methods, and functions starting with two underscores.
|
|
59
|
+
ignore_property_decorators: Ignore methods with property setter/getter decorators.
|
|
60
|
+
ignore_setters: Ignore methods with property setter decorators.
|
|
61
|
+
ignore_semiprivate: Ignore semiprivate classes, methods, and functions starting with a single underscore.
|
|
62
|
+
ignore_regex: Regex identifying class, method, and function names to ignore.
|
|
63
|
+
whitelist_regex: Regex identifying class, method, and function names to include.
|
|
64
|
+
output: Write output to a given FILE.
|
|
65
|
+
config: Read configuration from pyproject.toml or setup.cfg.
|
|
66
|
+
color: Toggle color output on/off when printing to stdout.
|
|
67
|
+
omit_covered_files: Omit reporting files that have 100% documentation coverage.
|
|
68
|
+
generate_badge: Generate a shields.io status badge (an SVG image) in at a given file or directory.
|
|
69
|
+
badge_format: File format for the generated badge.
|
|
70
|
+
badge_style: Desired style of shields.io badge.
|
|
71
|
+
"""
|
|
72
|
+
cli_args = list(src)
|
|
73
|
+
|
|
74
|
+
if verbose:
|
|
75
|
+
cli_args.append("--verbose")
|
|
76
|
+
cli_args.append(str(verbose))
|
|
77
|
+
|
|
78
|
+
if quiet:
|
|
79
|
+
cli_args.append("--quiet")
|
|
80
|
+
|
|
81
|
+
if fail_under:
|
|
82
|
+
cli_args.append("--fail-under")
|
|
83
|
+
cli_args.append(str(fail_under))
|
|
84
|
+
|
|
85
|
+
if exclude:
|
|
86
|
+
cli_args.append("--exclude")
|
|
87
|
+
cli_args.append(exclude)
|
|
88
|
+
|
|
89
|
+
if ignore_init_method:
|
|
90
|
+
cli_args.append("--ignore-init-method")
|
|
91
|
+
|
|
92
|
+
if ignore_init_module:
|
|
93
|
+
cli_args.append("--ignore-init-module")
|
|
94
|
+
|
|
95
|
+
if ignore_magic:
|
|
96
|
+
cli_args.append("--ignore-magic")
|
|
97
|
+
|
|
98
|
+
if ignore_module:
|
|
99
|
+
cli_args.append("--ignore-module")
|
|
100
|
+
|
|
101
|
+
if ignore_nested_functions:
|
|
102
|
+
cli_args.append("--ignore-nested-functions")
|
|
103
|
+
|
|
104
|
+
if ignore_nested_classes:
|
|
105
|
+
cli_args.append("--ignore-nested-classes")
|
|
106
|
+
|
|
107
|
+
if ignore_private:
|
|
108
|
+
cli_args.append("--ignore-private")
|
|
109
|
+
|
|
110
|
+
if ignore_property_decorators:
|
|
111
|
+
cli_args.append("--ignore-property-decorators")
|
|
112
|
+
|
|
113
|
+
if ignore_setters:
|
|
114
|
+
cli_args.append("--ignore-setters")
|
|
115
|
+
|
|
116
|
+
if ignore_semiprivate:
|
|
117
|
+
cli_args.append("--ignore-semiprivate")
|
|
118
|
+
|
|
119
|
+
if ignore_regex:
|
|
120
|
+
cli_args.append("--ignore-regex")
|
|
121
|
+
cli_args.append(ignore_regex)
|
|
122
|
+
|
|
123
|
+
if whitelist_regex:
|
|
124
|
+
cli_args.append("--whitelist-regex")
|
|
125
|
+
cli_args.append(whitelist_regex)
|
|
126
|
+
|
|
127
|
+
if output:
|
|
128
|
+
cli_args.append("--output")
|
|
129
|
+
cli_args.append(output)
|
|
130
|
+
|
|
131
|
+
if omit_covered_files:
|
|
132
|
+
cli_args.append("--omit-covered-files")
|
|
133
|
+
|
|
134
|
+
if generate_badge:
|
|
135
|
+
cli_args.append("--generate-badge")
|
|
136
|
+
cli_args.append(generate_badge)
|
|
137
|
+
|
|
138
|
+
if badge_format:
|
|
139
|
+
cli_args.append("--badge-format")
|
|
140
|
+
cli_args.append(badge_format)
|
|
141
|
+
|
|
142
|
+
if badge_style:
|
|
143
|
+
cli_args.append("--badge-style")
|
|
144
|
+
cli_args.append(badge_style)
|
|
145
|
+
|
|
146
|
+
if config:
|
|
147
|
+
cli_args.append("--config")
|
|
148
|
+
cli_args.append(config)
|
|
149
|
+
|
|
150
|
+
if color is True:
|
|
151
|
+
cli_args.append("--color")
|
|
152
|
+
elif color is False:
|
|
153
|
+
cli_args.append("--no-color")
|
|
154
|
+
|
|
155
|
+
super().__init__(cli_args)
|
|
156
|
+
|
|
157
|
+
def __call__(self) -> None:
|
|
158
|
+
from interrogate.cli import main as run_interrogate
|
|
159
|
+
|
|
160
|
+
return run_interrogate(self.cli_args)
|