docsig 0.89.0__tar.gz → 0.90.1__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.89.0 → docsig-0.90.1}/PKG-INFO +5 -5
- {docsig-0.89.0 → docsig-0.90.1}/README.rst +4 -4
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_check.py +3 -3
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_config.py +0 -7
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_directives.py +8 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_main.py +0 -1
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_module.py +16 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_report.py +11 -9
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_version.py +1 -1
- {docsig-0.89.0 → docsig-0.90.1}/pyproject.toml +6 -5
- {docsig-0.89.0 → docsig-0.90.1}/LICENSE +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/LICENSES/SPHINX_LICENSE +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/__init__.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/__main__.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_core.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_decorators.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_files.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_hooks.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_parsers.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_stub.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_utils.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/_vendor/sphinx/ext/napoleon.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/messages.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/plugin/__init__.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/plugin/_flake8.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/plugin/_validate_pyproject.py +0 -0
- {docsig-0.89.0 → docsig-0.90.1}/docsig/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docsig
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.90.1
|
|
4
4
|
Summary: Check signature params for proper documentation
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -82,7 +82,7 @@ Description-Content-Type: text/x-rst
|
|
|
82
82
|
.. |VS Code Build| image:: https://github.com/jshwi/docsig/actions/workflows/build-vscode-extension.yaml/badge.svg
|
|
83
83
|
:target: https://github.com/jshwi/docsig/actions/workflows/build-vscode-extension.yaml.yaml
|
|
84
84
|
:alt: Build
|
|
85
|
-
.. |VS Code Extension| image:: https://img.shields.io/badge/vscode%20extension-v1.0.
|
|
85
|
+
.. |VS Code Extension| image:: https://img.shields.io/badge/vscode%20extension-v1.0.1-007ACC
|
|
86
86
|
:target: https://marketplace.visualstudio.com/items?itemName=jshwi.docsig
|
|
87
87
|
:alt: VS Code Extension Version
|
|
88
88
|
|
|
@@ -206,7 +206,7 @@ ensure your installation has registered `docsig`
|
|
|
206
206
|
.. code-block:: console
|
|
207
207
|
|
|
208
208
|
$ flake8 --version
|
|
209
|
-
7.3.0 (docsig: 0.
|
|
209
|
+
7.3.0 (docsig: 0.90.1, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
|
|
210
210
|
|
|
211
211
|
And now use `flake8` to lint your files
|
|
212
212
|
|
|
@@ -292,7 +292,7 @@ Standalone
|
|
|
292
292
|
|
|
293
293
|
repos:
|
|
294
294
|
- repo: https://github.com/jshwi/docsig
|
|
295
|
-
rev: v0.
|
|
295
|
+
rev: v0.90.1
|
|
296
296
|
hooks:
|
|
297
297
|
- id: docsig
|
|
298
298
|
args:
|
|
@@ -311,7 +311,7 @@ or integrated with ``flake8``
|
|
|
311
311
|
hooks:
|
|
312
312
|
- id: flake8
|
|
313
313
|
additional_dependencies:
|
|
314
|
-
- docsig==0.
|
|
314
|
+
- docsig==0.90.1
|
|
315
315
|
args:
|
|
316
316
|
- "--sig-check-class"
|
|
317
317
|
- "--sig-check-dunders"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
.. |VS Code Build| image:: https://github.com/jshwi/docsig/actions/workflows/build-vscode-extension.yaml/badge.svg
|
|
55
55
|
:target: https://github.com/jshwi/docsig/actions/workflows/build-vscode-extension.yaml.yaml
|
|
56
56
|
:alt: Build
|
|
57
|
-
.. |VS Code Extension| image:: https://img.shields.io/badge/vscode%20extension-v1.0.
|
|
57
|
+
.. |VS Code Extension| image:: https://img.shields.io/badge/vscode%20extension-v1.0.1-007ACC
|
|
58
58
|
:target: https://marketplace.visualstudio.com/items?itemName=jshwi.docsig
|
|
59
59
|
:alt: VS Code Extension Version
|
|
60
60
|
|
|
@@ -178,7 +178,7 @@ ensure your installation has registered `docsig`
|
|
|
178
178
|
.. code-block:: console
|
|
179
179
|
|
|
180
180
|
$ flake8 --version
|
|
181
|
-
7.3.0 (docsig: 0.
|
|
181
|
+
7.3.0 (docsig: 0.90.1, mccabe: 0.7.0, pycodestyle: 2.14.0, pyflakes: 3.4.0) CPython 3.10.19 on Darwin
|
|
182
182
|
|
|
183
183
|
And now use `flake8` to lint your files
|
|
184
184
|
|
|
@@ -264,7 +264,7 @@ Standalone
|
|
|
264
264
|
|
|
265
265
|
repos:
|
|
266
266
|
- repo: https://github.com/jshwi/docsig
|
|
267
|
-
rev: v0.
|
|
267
|
+
rev: v0.90.1
|
|
268
268
|
hooks:
|
|
269
269
|
- id: docsig
|
|
270
270
|
args:
|
|
@@ -283,7 +283,7 @@ or integrated with ``flake8``
|
|
|
283
283
|
hooks:
|
|
284
284
|
- id: flake8
|
|
285
285
|
additional_dependencies:
|
|
286
|
-
- docsig==0.
|
|
286
|
+
- docsig==0.90.1
|
|
287
287
|
args:
|
|
288
288
|
- "--sig-check-class"
|
|
289
289
|
- "--sig-check-dunders"
|
|
@@ -47,9 +47,9 @@ def _run_check(
|
|
|
47
47
|
parent,
|
|
48
48
|
config,
|
|
49
49
|
):
|
|
50
|
-
|
|
51
|
-
if
|
|
52
|
-
failures.append(
|
|
50
|
+
result = _check_function(child, config)
|
|
51
|
+
if result:
|
|
52
|
+
failures.append(result)
|
|
53
53
|
|
|
54
54
|
# recurse for either class methods or, if enabled, nested functions
|
|
55
55
|
if not isinstance(child, _Function) or config.check.nested:
|
|
@@ -173,17 +173,10 @@ def build_parser() -> _ArgumentParser:
|
|
|
173
173
|
action="store_true",
|
|
174
174
|
help="check property return values",
|
|
175
175
|
)
|
|
176
|
-
parser.add_argument(
|
|
177
|
-
"-p",
|
|
178
|
-
action="store_true",
|
|
179
|
-
help=_argparse.SUPPRESS,
|
|
180
|
-
dest="check_protected",
|
|
181
|
-
)
|
|
182
176
|
parser.add_argument(
|
|
183
177
|
"--check-protected",
|
|
184
178
|
action="store_true",
|
|
185
179
|
help="check protected functions and classes",
|
|
186
|
-
dest="check_protected",
|
|
187
180
|
)
|
|
188
181
|
parser.add_argument(
|
|
189
182
|
"--check-protected-class-methods",
|
|
@@ -174,6 +174,14 @@ class Directives(dict[int, tuple[Comments, _Messages]]):
|
|
|
174
174
|
comments = scoped_comments
|
|
175
175
|
messages = scoped_messages
|
|
176
176
|
else:
|
|
177
|
+
# keep disable on this line even if an earlier
|
|
178
|
+
# token already recorded an empty entry (e.g.
|
|
179
|
+
# a string arg before an inline comment)
|
|
180
|
+
directives[lineno] = (
|
|
181
|
+
Comments(scoped_comments),
|
|
182
|
+
_Messages(scoped_messages),
|
|
183
|
+
)
|
|
184
|
+
|
|
177
185
|
# defer scoped state for the next line without
|
|
178
186
|
# changing module-level messages
|
|
179
187
|
pending_inline = (
|
|
@@ -109,6 +109,22 @@ class Parent: # pylint: disable=too-many-instance-attributes
|
|
|
109
109
|
subnode.lineno or 0,
|
|
110
110
|
(_Comments(), _Messages()),
|
|
111
111
|
)
|
|
112
|
+
|
|
113
|
+
# astroid sets lineno to the first decorator
|
|
114
|
+
# inline disable on the def line is at fromlineno
|
|
115
|
+
fromlineno = getattr(subnode, "fromlineno", 0)
|
|
116
|
+
if (
|
|
117
|
+
isinstance(subnode, _ast.nodes.FunctionDef)
|
|
118
|
+
and fromlineno
|
|
119
|
+
and fromlineno != (subnode.lineno or 0)
|
|
120
|
+
):
|
|
121
|
+
more_comments, more_disabled = self._directives.get(
|
|
122
|
+
fromlineno,
|
|
123
|
+
(_Comments(), _Messages()),
|
|
124
|
+
)
|
|
125
|
+
comments.extend(more_comments)
|
|
126
|
+
disabled.extend(more_disabled)
|
|
127
|
+
|
|
112
128
|
comments.extend(parent_comments)
|
|
113
129
|
disabled.extend(parent_disabled)
|
|
114
130
|
if isinstance(
|
|
@@ -13,6 +13,7 @@ import json as _json
|
|
|
13
13
|
import os as _os
|
|
14
14
|
import sys as _sys
|
|
15
15
|
import typing as _t
|
|
16
|
+
from dataclasses import dataclass as _dataclass
|
|
16
17
|
from warnings import warn as _warn
|
|
17
18
|
|
|
18
19
|
import astroid as _ast
|
|
@@ -71,7 +72,8 @@ class Failures(list["Failure"]):
|
|
|
71
72
|
"""Sequence of Failure instances (one per function checked)."""
|
|
72
73
|
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
@_dataclass(frozen=True, order=True)
|
|
76
|
+
class Diagnostic: # pylint: disable=too-few-public-methods
|
|
75
77
|
"""Single reported issue."""
|
|
76
78
|
|
|
77
79
|
name: str
|
|
@@ -83,7 +85,7 @@ class Failed(_t.NamedTuple):
|
|
|
83
85
|
new: bool = False
|
|
84
86
|
|
|
85
87
|
|
|
86
|
-
class Failure(list[
|
|
88
|
+
class Failure(list[Diagnostic]):
|
|
87
89
|
"""Collect docstring and signature failures for one function.
|
|
88
90
|
|
|
89
91
|
Runs configured checks and appends Failed entries for each
|
|
@@ -137,7 +139,7 @@ class Failure(list[Failed]):
|
|
|
137
139
|
**kwargs: _t.Any,
|
|
138
140
|
) -> None:
|
|
139
141
|
self._retcode.add(int(not value.new))
|
|
140
|
-
failed =
|
|
142
|
+
failed = Diagnostic(
|
|
141
143
|
self._name,
|
|
142
144
|
value.ref,
|
|
143
145
|
value.description.format(**kwargs),
|
|
@@ -416,15 +418,15 @@ def report(
|
|
|
416
418
|
retcodes = RetCode()
|
|
417
419
|
output = []
|
|
418
420
|
obj = []
|
|
419
|
-
for
|
|
420
|
-
retcodes.add(
|
|
421
|
+
for result in failures:
|
|
422
|
+
retcodes.add(result.retcode)
|
|
421
423
|
path_prefix = f"{file}:" if file is not None else ""
|
|
422
|
-
header = f"{path_prefix}{
|
|
424
|
+
header = f"{path_prefix}{result.lineno} in {result.name}"
|
|
423
425
|
if not config.no_ansi and _sys.stdout.isatty():
|
|
424
426
|
header = f"\033[35m{header}\033[0m"
|
|
425
427
|
|
|
426
428
|
output.append(header)
|
|
427
|
-
for item in
|
|
429
|
+
for item in result:
|
|
428
430
|
extra = None
|
|
429
431
|
if item.hint:
|
|
430
432
|
extra = f"hint: {item.hint}"
|
|
@@ -444,9 +446,9 @@ def report(
|
|
|
444
446
|
|
|
445
447
|
obj.append(
|
|
446
448
|
{
|
|
447
|
-
"line": None if
|
|
449
|
+
"line": None if result.retcode == 2 else item.lineno,
|
|
448
450
|
"message": msg,
|
|
449
|
-
"exit":
|
|
451
|
+
"exit": result.retcode,
|
|
450
452
|
},
|
|
451
453
|
)
|
|
452
454
|
|
|
@@ -29,7 +29,7 @@ maintainers = [
|
|
|
29
29
|
name = "docsig"
|
|
30
30
|
readme = "README.rst"
|
|
31
31
|
requires-python = ">=3.10"
|
|
32
|
-
version = "0.
|
|
32
|
+
version = "0.90.1"
|
|
33
33
|
|
|
34
34
|
[project.entry-points."flake8.extension"]
|
|
35
35
|
SIG = "docsig.plugin:Flake8"
|
|
@@ -47,7 +47,7 @@ line-length = 79
|
|
|
47
47
|
allow_dirty = true
|
|
48
48
|
commit = true
|
|
49
49
|
commit_args = "-sS"
|
|
50
|
-
current_version = "0.
|
|
50
|
+
current_version = "0.90.1"
|
|
51
51
|
message = "bump: version {current_version} → {new_version}"
|
|
52
52
|
sign_tags = true
|
|
53
53
|
tag = true
|
|
@@ -102,6 +102,7 @@ omit = [
|
|
|
102
102
|
|
|
103
103
|
[tool.deptry.per_rule_ignores]
|
|
104
104
|
DEP004 = [
|
|
105
|
+
"docutils",
|
|
105
106
|
"flake8",
|
|
106
107
|
"git",
|
|
107
108
|
"pytest",
|
|
@@ -147,25 +148,25 @@ deptry = ">=0.16.1,<0.26.0"
|
|
|
147
148
|
flynt = "^1.0.1"
|
|
148
149
|
gitpython = "^3.1.43"
|
|
149
150
|
isort = ">=5.13.2,<9.0.0"
|
|
150
|
-
mypy = ">=
|
|
151
|
+
mypy = ">=2.2.0,<3.0"
|
|
151
152
|
pre-commit = ">=3.3.3,<5.0.0"
|
|
152
153
|
pylint = "^4.0.6"
|
|
153
154
|
tomli = "^2.0.1"
|
|
154
155
|
tomli-w = "^1.0.0"
|
|
155
156
|
towncrier = ">=23.11,<26.0"
|
|
156
|
-
tox = "^4.56.
|
|
157
|
+
tox = "^4.56.4"
|
|
157
158
|
validate-pyproject = {extras = ["all", "store"], version = "^0.25"}
|
|
158
159
|
vulture = "^2.11"
|
|
159
160
|
|
|
160
161
|
[tool.poetry.group.docs.dependencies]
|
|
161
162
|
Sphinx = ">=7,<8.2"
|
|
163
|
+
docutils = ">=0.18,<0.22"
|
|
162
164
|
furo = ">=2024.4.27,<2026.0.0"
|
|
163
165
|
myst-parser = ">=3.0.1,<5.0.0"
|
|
164
166
|
pytest = "9.1.1"
|
|
165
167
|
pyyaml = "^6.0.1"
|
|
166
168
|
roman-numerals = "4.1.0"
|
|
167
169
|
sphinx-copybutton = "^0.5.2"
|
|
168
|
-
sphinx-jsonschema = "^1.19.2"
|
|
169
170
|
sphinx-markdown-builder = ">=0.5.5,<0.7.0"
|
|
170
171
|
sphinx-sitemap = "^2.9.0"
|
|
171
172
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|