docsig 0.49.0__tar.gz → 0.49.2__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.49.0 → docsig-0.49.2}/PKG-INFO +2 -2
- {docsig-0.49.0 → docsig-0.49.2}/README.rst +1 -1
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_display.py +2 -1
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_hooks.py +9 -4
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_main.py +1 -1
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_report.py +1 -1
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_version.py +1 -1
- {docsig-0.49.0 → docsig-0.49.2}/pyproject.toml +1 -1
- {docsig-0.49.0 → docsig-0.49.2}/LICENSE +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/__init__.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/__main__.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_config.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_core.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_decorators.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_directives.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_message.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_module.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_stub.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/_utils.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/messages.py +0 -0
- {docsig-0.49.0 → docsig-0.49.2}/docsig/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: docsig
|
|
3
|
-
Version: 0.49.
|
|
3
|
+
Version: 0.49.2
|
|
4
4
|
Summary: Check signature params for proper documentation
|
|
5
5
|
Home-page: https://pypi.org/project/docsig/
|
|
6
6
|
License: MIT
|
|
@@ -223,7 +223,7 @@ It can be added to your .pre-commit-config.yaml as follows:
|
|
|
223
223
|
|
|
224
224
|
repos:
|
|
225
225
|
- repo: https://github.com/jshwi/docsig
|
|
226
|
-
rev: v0.49.
|
|
226
|
+
rev: v0.49.2
|
|
227
227
|
hooks:
|
|
228
228
|
- id: docsig
|
|
229
229
|
args:
|
|
@@ -5,6 +5,7 @@ docsig._display
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations as _
|
|
7
7
|
|
|
8
|
+
import sys as _sys
|
|
8
9
|
import typing as _t
|
|
9
10
|
from collections import UserString as _UserString
|
|
10
11
|
|
|
@@ -187,7 +188,7 @@ class Display(_t.Dict[str, _t.List[Failures]]):
|
|
|
187
188
|
|
|
188
189
|
def __init__(self, no_ansi: bool = False) -> None:
|
|
189
190
|
super().__init__()
|
|
190
|
-
self._ansi = not no_ansi
|
|
191
|
+
self._ansi = not no_ansi and _sys.stdout.isatty()
|
|
191
192
|
|
|
192
193
|
def __getitem__(self, key: str) -> list[Failures]:
|
|
193
194
|
if key not in super().__iter__():
|
|
@@ -9,9 +9,14 @@ from os import environ as _e
|
|
|
9
9
|
import click as _click
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def pretty_print_error() -> None:
|
|
13
|
-
"""Print user friendly commandline error if debug not enabled.
|
|
12
|
+
def pretty_print_error(no_ansi: bool = False) -> None:
|
|
13
|
+
"""Print user friendly commandline error if debug not enabled.
|
|
14
|
+
|
|
15
|
+
:param no_ansi: Disable ANSI output.
|
|
16
|
+
"""
|
|
14
17
|
if _e.get("DOCSIG_DEBUG", None) != "1":
|
|
15
|
-
_sys.excepthook = lambda x, y, _:
|
|
16
|
-
f"{_click.style(x.__name__, fg='red', bold=True)}: {y}"
|
|
18
|
+
_sys.excepthook = lambda x, y, _: _click.echo(
|
|
19
|
+
f"{_click.style(x.__name__, fg='red', bold=True)}: {y}",
|
|
20
|
+
file=_sys.stderr,
|
|
21
|
+
color=not no_ansi and _sys.stderr.isatty(),
|
|
17
22
|
)
|
|
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
|