We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68f24fa commit 69f140fCopy full SHA for 69f140f
domdf_python_tools/dates.py
@@ -187,7 +187,7 @@ def utc_timestamp_to_datetime(
187
if sys.version_info <= (3, 7, 2):
188
MonthsType = OrderedDict
189
else:
190
- MonthsType = typing.OrderedDict[str, str] # type: ignore
+ MonthsType = typing.OrderedDict[str, str] # type: ignore # noqa: TYP006
191
192
#: Mapping of 3-character shortcodes to full month names.
193
months: MonthsType = OrderedDict(
domdf_python_tools/delegators.py
@@ -119,10 +119,7 @@ def _f(f: _C) -> _C:
119
120
elif tuple(from_params.keys()) == ("self", "args", "kwargs"):
121
f.__signature__ = from_sig.replace( # type: ignore
122
- parameters=[
123
- from_params["self"],
124
- *to_sig.parameters.values(),
125
- ]
+ parameters=[from_params["self"], *to_sig.parameters.values()]
126
)
127
128
copy_annotations(f)
domdf_python_tools/import_tools.py
@@ -143,11 +143,11 @@ def discover_entry_points(
143
match_func: Optional[Callable[[Any], bool]] = None,
144
) -> List[Any]:
145
"""
146
- Returns a list of entry points in the given category,
147
- optionally filtered by ``match_func``.
+ Returns a list of entry points in the given category, optionally filtered by ``match_func``.
148
149
:param group_name: The entry point group name, e.g. ``'entry_points'``.
150
- :param match_func: Function taking an object and returning :py:obj:`True` if the object is to be included in the output.
+ :param match_func: Function taking an object and returning :py:obj:`True`
+ if the object is to be included in the output.
151
:default match_func: :py:obj:`None`, which includes all objects.
152
153
:return: List of matching objects.
domdf_python_tools/paths.py
@@ -316,7 +316,7 @@ class PathPlus(pathlib.Path):
316
Defaults to Unix line endings (``LF``) on all platforms.
317
318
319
- __slots__ = ('_accessor', )
+ __slots__ = ("_accessor", )
320
321
def __new__(cls, *args, **kwargs): # noqa D102
322
if cls is PathPlus:
domdf_python_tools/terminal_colours.pyi
@@ -75,8 +75,8 @@ style_stack: List[str]
75
76
def code_to_chars(code) -> str: ...
77
def set_title(title: str) -> str: ...
78
-def clear_screen(mode: int = 2) -> str: ...
79
-def clear_line(mode: int = 2) -> str: ...
+def clear_screen(mode: int = ...) -> str: ...
+def clear_line(mode: int = ...) -> str: ...
80
81
82
def strip_ansi(value: str) -> str: ...
@@ -102,17 +102,17 @@ class AnsiCodes(ABC):
102
103
class AnsiCursor:
104
105
- def UP(self, n: int = 1) -> str: ...
106
- def DOWN(self, n: int = 1) -> str: ...
107
- def FORWARD(self, n: int = 1) -> str: ...
108
- def BACK(self, n: int = 1) -> str: ...
109
- def POS(self, x: int = 1, y: int = 1) -> str: ...
+ def UP(self, n: int = ...) -> str: ...
+ def DOWN(self, n: int = ...) -> str: ...
+ def FORWARD(self, n: int = ...) -> str: ...
+ def BACK(self, n: int = ...) -> str: ...
+ def POS(self, x: int = ..., y: int = ...) -> str: ...
110
111
112
class AnsiFore(AnsiCodes):
113
114
_stack = fore_stack
115
- _reset = "\033[39m"
+ _reset = ...
116
117
BLACK: Colour
118
RED: Colour
domdf_python_tools/versions.py
@@ -73,18 +73,18 @@ class Version(Tuple[int, int, int]):
73
74
@property # type: ignore
- def major(self):
+ def major(self): # noqa: D102
return self[0]
- def minor(self):
+ def minor(self): # noqa: D102
return self[1]
83
84
- def patch(self):
+ def patch(self): # noqa: D102
85
return self[2]
86
87
- def __new__(cls, major=0, minor=0, patch=0) -> "Version":
+ def __new__(cls, major=0, minor=0, patch=0) -> "Version": # noqa: D102
88
t: "Version" = super().__new__(cls, (int(major), int(minor), int(patch))) # type: ignore
89
90
return t
@@ -254,7 +254,7 @@ def _asdict(self) -> Dict[str, int]:
254
255
def _replace(self, **kwargs) -> "Version":
256
257
- Return a new instance of the named tuple replacing specified fields with new values:
+ Return a new instance of the named tuple replacing specified fields with new values.
258
259
:param kwargs:
260
tests/test_stringlist.py
@@ -119,15 +119,15 @@ def test_start_of_line_indents(self):
assert StringList("Hello\n World", convert_indents=True) == ["Hello", "\tWorld"]
def test_negative_getitem(self):
- sl = StringList(['', '', "hello", "world", '', '', 'abc', "1234"])
+ sl = StringList(['', '', "hello", "world", '', '', "abc", "1234"])
assert sl[-1] == "1234"
sl[-1] += "5678"
- assert sl == ['', '', "hello", "world", '', '', 'abc', "12345678"]
+ assert sl == ['', '', "hello", "world", '', '', "abc", "12345678"]
assert sl[-2] == "abc"
129
sl[-2] += "def"
130
- assert sl == ['', '', "hello", "world", '', '', 'abcdef', "12345678"]
+ assert sl == ['', '', "hello", "world", '', '', "abcdef", "12345678"]
131
132
def test_indent_size(self):
133
sl = StringList(['', '', "hello", "world", '', '', '', "1234"])
0 commit comments