Skip to content

Commit 32f71f7

Browse files
fix(pre-commit): fix pre-commit errors
Also remove lookahead from `re_param_line` as tests pass without it.
1 parent 3aaba09 commit 32f71f7

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Using "default" in parameter signatures of NumPy doctrings emitted a `missing-param`
22
error.
33

4-
Closes #6211
4+
Closes #6211

doc/whatsnew/fragments/7360.false_negative

-1
This file was deleted.

pylint/extensions/_check_docs_utils.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ class NumpyDocstring(GoogleDocstring):
737737
\s* (?P<param_name>\*{{0,2}}\w+)(\s?(:|\n)) # identifier with potential asterisks
738738
\s*
739739
(?P<param_type>
740-
(?!=\n)
741740
(
742741
({GoogleDocstring.re_multiple_type}) # default type declaration
743742
(,\s+optional|,\s+{re_default_param})? # optional 'optional' indication
@@ -802,15 +801,15 @@ def match_param_docs(self) -> tuple[set[str], set[str]]:
802801

803802
# check if parameter has description only
804803
re_only_desc = re.match(r"\s*(\*{0,2}\w+)\s*:?\n\s*\w*$", entry)
805-
print(f're_only_desc: {re_only_desc}')
804+
print(f"re_only_desc: {re_only_desc}")
806805
if re_only_desc:
807-
param_name = match.group('param_name')
808-
param_desc = match.group('param_type')
806+
param_name = match.group("param_name")
807+
param_desc = match.group("param_type")
809808
param_type = None
810809
else:
811-
param_name = match.group('param_name')
812-
param_type = match.group('param_type')
813-
param_desc = match.group('param_desc')
810+
param_name = match.group("param_name")
811+
param_type = match.group("param_type")
812+
param_desc = match.group("param_desc")
814813

815814
if param_type:
816815
params_with_type.add(param_name)

0 commit comments

Comments
 (0)