Skip to content

Commit ab417e9

Browse files
committed
Map changed msg for RST303 and RST304
A bit of a hack as change from rst-lint to rstcheck was not quite transparent.
1 parent c576839 commit ab417e9

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

flake8_rst_docstrings.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,22 @@ def run(self):
10761076
# 4 - severe --> RST4## codes
10771077
#
10781078
# Map the string to a unique code:
1079-
if rst_error.startswith("(INFO/1) "):
1079+
if rst_error.startswith('(INFO/1) No directive entry for "'):
1080+
# Upgrade level and change to old rst-lint wording
1081+
level = 3
1082+
rst_error = (
1083+
'(ERROR/3) Unknown directive type "%s".'
1084+
% rst_error.split(' "', 1)[1].split('"', 1)[0]
1085+
)
1086+
elif rst_error.startswith('(INFO/1) No role entry for "'):
1087+
# Upgrade level and change to old rst-lint wording
1088+
level = 3
1089+
rst_error = (
1090+
'(ERROR/3) Unknown interpreted text role "%s".'
1091+
% rst_error.split(' "', 1)[1].split('"', 1)[0]
1092+
)
1093+
1094+
elif rst_error.startswith("(INFO/1) "):
10801095
level = 1
10811096
elif rst_error.startswith("(WARNING/2) "):
10821097
level = 2

0 commit comments

Comments
 (0)