@@ -118,8 +118,12 @@ def check_default_role(file, lines, options=None):
118118 before_match = line [: match .start ()]
119119 after_match = line [match .end () :]
120120 stripped_line = line .strip ()
121- if (stripped_line .startswith ("|" ) and stripped_line .endswith ("|" ) and
122- stripped_line .count ("|" ) >= 4 and "|" in match .group (0 )):
121+ if (
122+ stripped_line .startswith ("|" )
123+ and stripped_line .endswith ("|" )
124+ and stripped_line .count ("|" ) >= 4
125+ and "|" in match .group (0 )
126+ ):
123127 return # we don't handle tables yet.
124128 if re .search (rst .ROLE_TAG + "$" , before_match ):
125129 # It's not a default role: it starts with a tag.
@@ -267,7 +271,10 @@ def check_role_with_double_backticks(file, lines, options=None):
267271 before = paragraph [: inline_literal .start ()]
268272 if re .search (rst .ROLE_TAG + "$" , before ):
269273 error_offset = paragraph [: inline_literal .start ()].count ("\n " )
270- yield paragraph_lno + error_offset , "role use a single backtick, double backtick found."
274+ yield (
275+ paragraph_lno + error_offset ,
276+ "role use a single backtick, double backtick found." ,
277+ )
271278 paragraph = (
272279 paragraph [: inline_literal .start ()] + paragraph [inline_literal .end () :]
273280 )
@@ -288,9 +295,15 @@ def check_missing_space_before_role(file, lines, options=None):
288295 if match :
289296 error_offset = paragraph [: match .start ()].count ("\n " )
290297 if looks_like_glued (match ):
291- yield paragraph_lno + error_offset , f"missing space before role ({ match .group (0 )} )."
298+ yield (
299+ paragraph_lno + error_offset ,
300+ f"missing space before role ({ match .group (0 )} )." ,
301+ )
292302 else :
293- yield paragraph_lno + error_offset , f"role missing opening tag colon ({ match .group (0 )} )."
303+ yield (
304+ paragraph_lno + error_offset ,
305+ f"role missing opening tag colon ({ match .group (0 )} )." ,
306+ )
294307
295308
296309@checker (".rst" , ".po" )
@@ -459,4 +472,4 @@ def check_dangling_hyphen(file, lines, options):
459472 for lno , line in enumerate (lines ):
460473 stripped_line = line .rstrip ("\n " )
461474 if re .match (r".*[a-z]-$" , stripped_line ):
462- yield lno + 1 , f "Line ends with dangling hyphen"
475+ yield lno + 1 , "Line ends with dangling hyphen"
0 commit comments