@@ -473,22 +473,23 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing,
473473 # closing bracket matches indentation of opening bracket's line
474474 if hang_closing :
475475 yield start , "E133 closing bracket is missing indentation"
476+ elif indent [depth ] and start [1 ] < indent [depth ]:
477+ if visual_indent is not True :
478+ # visual indent is broken
479+ yield (start , "E128 continuation line "
480+ "under-indented for visual indent" )
481+ elif hang == 4 or (indent_next and rel_indent [row ] == 8 ):
482+ # hanging indent is verified
483+ if close_bracket and not hang_closing :
484+ yield (start , "E123 closing bracket does not match "
485+ "indentation of opening bracket's line" )
476486 elif visual_indent is True :
477487 # visual indent is verified
478488 if not indent [depth ]:
479489 indent [depth ] = start [1 ]
480490 elif visual_indent in (text , str ):
481491 # ignore token lined up with matching one from a previous line
482492 pass
483- elif indent [depth ] and start [1 ] < indent [depth ]:
484- # visual indent is broken
485- yield (start , "E128 continuation line "
486- "under-indented for visual indent" )
487- elif hang == 4 or (indent_next and rel_indent [row ] == 8 ):
488- # hanging indent is verified
489- if close_bracket and not hang_closing :
490- yield (start , "E123 closing bracket does not match "
491- "indentation of opening bracket's line" )
492493 else :
493494 # indent is broken
494495 if hang <= 0 :
0 commit comments