docsig 0.59.2__tar.gz → 0.60.0__tar.gz
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.
- {docsig-0.59.2 → docsig-0.60.0}/PKG-INFO +34 -31
- {docsig-0.59.2 → docsig-0.60.0}/README.rst +32 -30
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_config.py +8 -1
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_core.py +7 -4
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_files.py +13 -3
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_main.py +1 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_version.py +1 -1
- {docsig-0.59.2 → docsig-0.60.0}/pyproject.toml +3 -3
- {docsig-0.59.2 → docsig-0.60.0}/LICENSE +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/__init__.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/__main__.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_decorators.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_directives.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_hooks.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_module.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_report.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_stub.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/_utils.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/messages.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/plugin.py +0 -0
- {docsig-0.59.2 → docsig-0.60.0}/docsig/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: docsig
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.60.0
|
|
4
4
|
Summary: Check signature params for proper documentation
|
|
5
5
|
Home-page: https://pypi.org/project/docsig/
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Requires-Dist: Sphinx (>=7.0.0,<8.0.0)
|
|
|
20
20
|
Requires-Dist: arcon (>=0.4.0)
|
|
21
21
|
Requires-Dist: astroid (>=3.0.1,<4.0.0)
|
|
22
22
|
Requires-Dist: pathspec (>=0.12.1,<0.13.0)
|
|
23
|
+
Requires-Dist: wcmatch (>=8.5.2,<9.0.0)
|
|
23
24
|
Project-URL: Documentation, https://docsig.readthedocs.io/en/latest
|
|
24
25
|
Project-URL: Repository, https://github.com/jshwi/docsig
|
|
25
26
|
Description-Content-Type: text/x-rst
|
|
@@ -106,40 +107,42 @@ Commandline
|
|
|
106
107
|
.. code-block:: console
|
|
107
108
|
|
|
108
109
|
usage: docsig [-h] [-V] [-l] [-c | -C] [-D] [-m] [-N] [-o] [-p] [-P] [-i] [-a] [-k] [-T]
|
|
109
|
-
[-I] [-n] [-v] [-s STR] [-d LIST] [-t LIST] [-e PATTERN]
|
|
110
|
+
[-I] [-n] [-v] [-s STR] [-d LIST] [-t LIST] [-e PATTERN] [-E PATH [PATH ...]]
|
|
110
111
|
[path [path ...]]
|
|
111
112
|
|
|
112
113
|
Check signature params for proper documentation
|
|
113
114
|
|
|
114
115
|
positional arguments:
|
|
115
|
-
path
|
|
116
|
+
path directories or files to check
|
|
116
117
|
|
|
117
118
|
optional arguments:
|
|
118
|
-
-h, --help
|
|
119
|
-
-V, --version
|
|
120
|
-
-l, --list-checks
|
|
121
|
-
-c, --check-class
|
|
122
|
-
-C, --check-class-constructor
|
|
123
|
-
|
|
124
|
-
-D, --check-dunders
|
|
125
|
-
-m, --check-protected-class-methods
|
|
126
|
-
-N, --check-nested
|
|
127
|
-
-o, --check-overridden
|
|
128
|
-
-p, --check-protected
|
|
129
|
-
-P, --check-property-returns
|
|
130
|
-
-i, --ignore-no-params
|
|
131
|
-
|
|
132
|
-
-a, --ignore-args
|
|
133
|
-
-k, --ignore-kwargs
|
|
134
|
-
-T, --ignore-typechecker
|
|
135
|
-
-I, --include-ignored
|
|
136
|
-
-n, --no-ansi
|
|
137
|
-
-v, --verbose
|
|
138
|
-
-s STR, --string STR
|
|
139
|
-
-d LIST, --disable LIST
|
|
140
|
-
-t LIST, --target LIST
|
|
141
|
-
-e PATTERN, --exclude PATTERN
|
|
142
|
-
|
|
119
|
+
-h, --help show this help message and exit
|
|
120
|
+
-V, --version show program's version number and exit
|
|
121
|
+
-l, --list-checks display a list of all checks and their messages
|
|
122
|
+
-c, --check-class check class docstrings
|
|
123
|
+
-C, --check-class-constructor check __init__ methods. Note: mutually incompatible
|
|
124
|
+
with -c
|
|
125
|
+
-D, --check-dunders check dunder methods
|
|
126
|
+
-m, --check-protected-class-methods check public methods belonging to protected classes
|
|
127
|
+
-N, --check-nested check nested functions and classes
|
|
128
|
+
-o, --check-overridden check overridden methods
|
|
129
|
+
-p, --check-protected check protected functions and classes
|
|
130
|
+
-P, --check-property-returns check property return values
|
|
131
|
+
-i, --ignore-no-params ignore docstrings where parameters are not
|
|
132
|
+
documented
|
|
133
|
+
-a, --ignore-args ignore args prefixed with an asterisk
|
|
134
|
+
-k, --ignore-kwargs ignore kwargs prefixed with two asterisks
|
|
135
|
+
-T, --ignore-typechecker ignore checking return values
|
|
136
|
+
-I, --include-ignored check files even if they match a gitignore pattern
|
|
137
|
+
-n, --no-ansi disable ansi output
|
|
138
|
+
-v, --verbose increase output verbosity
|
|
139
|
+
-s STR, --string STR string to parse instead of files
|
|
140
|
+
-d LIST, --disable LIST comma separated list of rules to disable
|
|
141
|
+
-t LIST, --target LIST comma separated list of rules to target
|
|
142
|
+
-e PATTERN, --exclude PATTERN regular expression of files or dirs to exclude from
|
|
143
|
+
checks
|
|
144
|
+
-E PATH [PATH ...], --excludes PATH [PATH ...]
|
|
145
|
+
path glob patterns to exclude from checks
|
|
143
146
|
|
|
144
147
|
Options can also be configured with the pyproject.toml file
|
|
145
148
|
|
|
@@ -169,7 +172,7 @@ ensure your installation has registered `docsig`
|
|
|
169
172
|
.. code-block:: console
|
|
170
173
|
|
|
171
174
|
$ flake8 --version
|
|
172
|
-
7.1.0 (docsig: 0.
|
|
175
|
+
7.1.0 (docsig: 0.60.0, mccabe: 0.7.0, pycodestyle: 2.12.0, pyflakes: 3.2.0) CPython 3.8.13 on Darwin
|
|
173
176
|
|
|
174
177
|
And now use `flake8` to lint your files
|
|
175
178
|
|
|
@@ -258,7 +261,7 @@ Standalone
|
|
|
258
261
|
|
|
259
262
|
repos:
|
|
260
263
|
- repo: https://github.com/jshwi/docsig
|
|
261
|
-
rev: v0.
|
|
264
|
+
rev: v0.60.0
|
|
262
265
|
hooks:
|
|
263
266
|
- id: docsig
|
|
264
267
|
args:
|
|
@@ -277,7 +280,7 @@ or integrated with ``flake8``
|
|
|
277
280
|
hooks:
|
|
278
281
|
- id: flake8
|
|
279
282
|
additional_dependencies:
|
|
280
|
-
- docsig==0.
|
|
283
|
+
- docsig==0.60.0
|
|
281
284
|
args:
|
|
282
285
|
- "--sig-check-class"
|
|
283
286
|
- "--sig-check-dunders"
|
|
@@ -80,40 +80,42 @@ Commandline
|
|
|
80
80
|
.. code-block:: console
|
|
81
81
|
|
|
82
82
|
usage: docsig [-h] [-V] [-l] [-c | -C] [-D] [-m] [-N] [-o] [-p] [-P] [-i] [-a] [-k] [-T]
|
|
83
|
-
[-I] [-n] [-v] [-s STR] [-d LIST] [-t LIST] [-e PATTERN]
|
|
83
|
+
[-I] [-n] [-v] [-s STR] [-d LIST] [-t LIST] [-e PATTERN] [-E PATH [PATH ...]]
|
|
84
84
|
[path [path ...]]
|
|
85
85
|
|
|
86
86
|
Check signature params for proper documentation
|
|
87
87
|
|
|
88
88
|
positional arguments:
|
|
89
|
-
path
|
|
89
|
+
path directories or files to check
|
|
90
90
|
|
|
91
91
|
optional arguments:
|
|
92
|
-
-h, --help
|
|
93
|
-
-V, --version
|
|
94
|
-
-l, --list-checks
|
|
95
|
-
-c, --check-class
|
|
96
|
-
-C, --check-class-constructor
|
|
97
|
-
|
|
98
|
-
-D, --check-dunders
|
|
99
|
-
-m, --check-protected-class-methods
|
|
100
|
-
-N, --check-nested
|
|
101
|
-
-o, --check-overridden
|
|
102
|
-
-p, --check-protected
|
|
103
|
-
-P, --check-property-returns
|
|
104
|
-
-i, --ignore-no-params
|
|
105
|
-
|
|
106
|
-
-a, --ignore-args
|
|
107
|
-
-k, --ignore-kwargs
|
|
108
|
-
-T, --ignore-typechecker
|
|
109
|
-
-I, --include-ignored
|
|
110
|
-
-n, --no-ansi
|
|
111
|
-
-v, --verbose
|
|
112
|
-
-s STR, --string STR
|
|
113
|
-
-d LIST, --disable LIST
|
|
114
|
-
-t LIST, --target LIST
|
|
115
|
-
-e PATTERN, --exclude PATTERN
|
|
116
|
-
|
|
92
|
+
-h, --help show this help message and exit
|
|
93
|
+
-V, --version show program's version number and exit
|
|
94
|
+
-l, --list-checks display a list of all checks and their messages
|
|
95
|
+
-c, --check-class check class docstrings
|
|
96
|
+
-C, --check-class-constructor check __init__ methods. Note: mutually incompatible
|
|
97
|
+
with -c
|
|
98
|
+
-D, --check-dunders check dunder methods
|
|
99
|
+
-m, --check-protected-class-methods check public methods belonging to protected classes
|
|
100
|
+
-N, --check-nested check nested functions and classes
|
|
101
|
+
-o, --check-overridden check overridden methods
|
|
102
|
+
-p, --check-protected check protected functions and classes
|
|
103
|
+
-P, --check-property-returns check property return values
|
|
104
|
+
-i, --ignore-no-params ignore docstrings where parameters are not
|
|
105
|
+
documented
|
|
106
|
+
-a, --ignore-args ignore args prefixed with an asterisk
|
|
107
|
+
-k, --ignore-kwargs ignore kwargs prefixed with two asterisks
|
|
108
|
+
-T, --ignore-typechecker ignore checking return values
|
|
109
|
+
-I, --include-ignored check files even if they match a gitignore pattern
|
|
110
|
+
-n, --no-ansi disable ansi output
|
|
111
|
+
-v, --verbose increase output verbosity
|
|
112
|
+
-s STR, --string STR string to parse instead of files
|
|
113
|
+
-d LIST, --disable LIST comma separated list of rules to disable
|
|
114
|
+
-t LIST, --target LIST comma separated list of rules to target
|
|
115
|
+
-e PATTERN, --exclude PATTERN regular expression of files or dirs to exclude from
|
|
116
|
+
checks
|
|
117
|
+
-E PATH [PATH ...], --excludes PATH [PATH ...]
|
|
118
|
+
path glob patterns to exclude from checks
|
|
117
119
|
|
|
118
120
|
Options can also be configured with the pyproject.toml file
|
|
119
121
|
|
|
@@ -143,7 +145,7 @@ ensure your installation has registered `docsig`
|
|
|
143
145
|
.. code-block:: console
|
|
144
146
|
|
|
145
147
|
$ flake8 --version
|
|
146
|
-
7.1.0 (docsig: 0.
|
|
148
|
+
7.1.0 (docsig: 0.60.0, mccabe: 0.7.0, pycodestyle: 2.12.0, pyflakes: 3.2.0) CPython 3.8.13 on Darwin
|
|
147
149
|
|
|
148
150
|
And now use `flake8` to lint your files
|
|
149
151
|
|
|
@@ -232,7 +234,7 @@ Standalone
|
|
|
232
234
|
|
|
233
235
|
repos:
|
|
234
236
|
- repo: https://github.com/jshwi/docsig
|
|
235
|
-
rev: v0.
|
|
237
|
+
rev: v0.60.0
|
|
236
238
|
hooks:
|
|
237
239
|
- id: docsig
|
|
238
240
|
args:
|
|
@@ -251,7 +253,7 @@ or integrated with ``flake8``
|
|
|
251
253
|
hooks:
|
|
252
254
|
- id: flake8
|
|
253
255
|
additional_dependencies:
|
|
254
|
-
- docsig==0.
|
|
256
|
+
- docsig==0.60.0
|
|
255
257
|
args:
|
|
256
258
|
- "--sig-check-class"
|
|
257
259
|
- "--sig-check-dunders"
|
|
@@ -19,7 +19,7 @@ class Parser(_ArgumentParser):
|
|
|
19
19
|
super().__init__(
|
|
20
20
|
version=__version__,
|
|
21
21
|
formatter_class=lambda prog: _HelpFormatter(
|
|
22
|
-
prog, max_help_position=
|
|
22
|
+
prog, max_help_position=40
|
|
23
23
|
),
|
|
24
24
|
description="Check signature params for proper documentation",
|
|
25
25
|
version_short_form="-V",
|
|
@@ -157,6 +157,13 @@ class Parser(_ArgumentParser):
|
|
|
157
157
|
metavar="PATTERN",
|
|
158
158
|
help="regular expression of files or dirs to exclude from checks",
|
|
159
159
|
)
|
|
160
|
+
self.add_argument(
|
|
161
|
+
"-E",
|
|
162
|
+
"--excludes",
|
|
163
|
+
nargs="+",
|
|
164
|
+
metavar="PATH",
|
|
165
|
+
help="path glob patterns to exclude from checks",
|
|
166
|
+
)
|
|
160
167
|
|
|
161
168
|
# deprecated
|
|
162
169
|
self.add_argument(
|
|
@@ -37,7 +37,7 @@ _DEFAULT_EXCLUDES = """\
|
|
|
37
37
|
|\\.tox[\\\\/].*
|
|
38
38
|
|\\.vscode[\\\\/].*
|
|
39
39
|
|_?build[\\\\/].*
|
|
40
|
-
|
|
40
|
+
|.*[\\\\/]__pycache__[\\\\/].*
|
|
41
41
|
|dist[\\\\/].*
|
|
42
42
|
|node_modules[\\\\/].*
|
|
43
43
|
)$
|
|
@@ -331,6 +331,7 @@ def docsig( # pylint: disable=too-many-locals,too-many-arguments
|
|
|
331
331
|
target: _Messages | None = None,
|
|
332
332
|
disable: _Messages | None = None,
|
|
333
333
|
exclude: str | None = None,
|
|
334
|
+
excludes: list[str] | None = None,
|
|
334
335
|
) -> int:
|
|
335
336
|
"""Package's core functionality.
|
|
336
337
|
|
|
@@ -367,20 +368,22 @@ def docsig( # pylint: disable=too-many-locals,too-many-arguments
|
|
|
367
368
|
:param disable: List of errors to disable.
|
|
368
369
|
:param exclude: Regular expression of files and dirs to exclude from
|
|
369
370
|
checks.
|
|
371
|
+
:param excludes: Files or dirs to exclude from checks.
|
|
370
372
|
:return: Exit status for whether test failed or not.
|
|
371
373
|
"""
|
|
372
374
|
if list_checks:
|
|
373
375
|
return int(bool(_print_checks())) # type: ignore
|
|
374
376
|
|
|
375
|
-
|
|
377
|
+
patterns = [_DEFAULT_EXCLUDES]
|
|
376
378
|
if exclude is not None:
|
|
377
|
-
|
|
379
|
+
patterns.append(exclude)
|
|
378
380
|
|
|
379
381
|
if string is None:
|
|
380
382
|
retcode = 0
|
|
381
383
|
paths = _Paths(
|
|
382
384
|
*tuple(_Path(i) for i in path),
|
|
383
|
-
|
|
385
|
+
patterns=patterns,
|
|
386
|
+
excludes=excludes or [],
|
|
384
387
|
include_ignored=include_ignored,
|
|
385
388
|
verbose=verbose,
|
|
386
389
|
)
|
|
@@ -12,6 +12,7 @@ from pathlib import Path as _Path
|
|
|
12
12
|
|
|
13
13
|
from pathspec import PathSpec as _PathSpec
|
|
14
14
|
from pathspec.patterns import GitWildMatchPattern as _GitWildMatchPattern
|
|
15
|
+
from wcmatch.pathlib import Path as _WcPath
|
|
15
16
|
|
|
16
17
|
from ._utils import vprint as _vprint
|
|
17
18
|
|
|
@@ -62,12 +63,18 @@ class _Gitignore(_PathSpec):
|
|
|
62
63
|
super().__init__(map(_GitWildMatchPattern, patterns))
|
|
63
64
|
|
|
64
65
|
|
|
66
|
+
def _glob(path: _Path, pattern: str) -> bool:
|
|
67
|
+
# pylint: disable=no-member
|
|
68
|
+
return _WcPath(str(path)).globmatch(pattern) # type: ignore
|
|
69
|
+
|
|
70
|
+
|
|
65
71
|
class Paths(_t.List[_Path]): # pylint: disable=too-many-instance-attributes
|
|
66
72
|
"""Collect a list of valid paths.
|
|
67
73
|
|
|
68
74
|
:param paths: Path(s) to parse ``Module``(s) from.
|
|
69
|
-
:param
|
|
75
|
+
:param patterns: List pf regular expression of files and dirs to
|
|
70
76
|
exclude from checks.
|
|
77
|
+
:param excludes: Files or dirs to exclude from checks.
|
|
71
78
|
:param include_ignored: Check files even if they match a gitignore
|
|
72
79
|
pattern.
|
|
73
80
|
:param verbose: increase output verbosity.
|
|
@@ -76,11 +83,13 @@ class Paths(_t.List[_Path]): # pylint: disable=too-many-instance-attributes
|
|
|
76
83
|
def __init__( # pylint: disable=too-many-arguments
|
|
77
84
|
self,
|
|
78
85
|
*paths: _Path,
|
|
86
|
+
patterns: list[str],
|
|
79
87
|
excludes: list[str],
|
|
80
88
|
include_ignored: bool = False,
|
|
81
89
|
verbose: bool = False,
|
|
82
90
|
) -> None:
|
|
83
91
|
super().__init__()
|
|
92
|
+
self._patterns = patterns
|
|
84
93
|
self._excludes = excludes
|
|
85
94
|
self._include_ignored = include_ignored
|
|
86
95
|
self._verbose = verbose
|
|
@@ -89,8 +98,9 @@ class Paths(_t.List[_Path]): # pylint: disable=too-many-instance-attributes
|
|
|
89
98
|
self._populate(path)
|
|
90
99
|
|
|
91
100
|
for path in list(self):
|
|
92
|
-
if str(path) != "." and
|
|
93
|
-
_re.match(i, str(path)) for i in self.
|
|
101
|
+
if str(path) != "." and (
|
|
102
|
+
any(_re.match(i, str(path)) for i in self._patterns)
|
|
103
|
+
or any(_glob(path, i) for i in self._excludes)
|
|
94
104
|
):
|
|
95
105
|
_vprint(
|
|
96
106
|
FILE_INFO.format(
|
|
@@ -11,7 +11,7 @@ line-length = 79
|
|
|
11
11
|
allow_dirty = true
|
|
12
12
|
commit = true
|
|
13
13
|
commit_args = "-sS"
|
|
14
|
-
current_version = "0.
|
|
14
|
+
current_version = "0.60.0"
|
|
15
15
|
message = "bump: version {current_version} → {new_version}"
|
|
16
16
|
sign_tags = true
|
|
17
17
|
tag = true
|
|
@@ -132,7 +132,7 @@ maintainers = [
|
|
|
132
132
|
name = "docsig"
|
|
133
133
|
readme = "README.rst"
|
|
134
134
|
repository = "https://github.com/jshwi/docsig"
|
|
135
|
-
version = "0.
|
|
135
|
+
version = "0.60.0"
|
|
136
136
|
|
|
137
137
|
[tool.poetry.dependencies]
|
|
138
138
|
Sphinx = "^7.0.0"
|
|
@@ -140,6 +140,7 @@ arcon = ">=0.4.0"
|
|
|
140
140
|
astroid = "^3.0.1"
|
|
141
141
|
pathspec = "^0.12.1"
|
|
142
142
|
python = "^3.8.1"
|
|
143
|
+
wcmatch = "^8.5.2"
|
|
143
144
|
|
|
144
145
|
[tool.poetry.group.dev.dependencies]
|
|
145
146
|
black = "^24.4.2"
|
|
@@ -160,7 +161,6 @@ vulture = "^2.11"
|
|
|
160
161
|
|
|
161
162
|
[tool.poetry.group.docs.dependencies]
|
|
162
163
|
furo = "^2024.4.27"
|
|
163
|
-
incremental = "22.10.0"
|
|
164
164
|
myst-parser = "^3.0.1"
|
|
165
165
|
pytest = "^8.2.0"
|
|
166
166
|
pyyaml = "^6.0.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|