@ -30,11 +30,13 @@ def check(conf, token, prev, next, context):
for comment in get_comments_between_tokens ( token , next ) :
for comment in get_comments_between_tokens ( token , next ) :
if ( conf [ ' min-spaces-from-content ' ] != - 1 and
if ( conf [ ' min-spaces-from-content ' ] != - 1 and
not isinstance ( token , yaml . StreamStartToken ) and
not isinstance ( token , yaml . StreamStartToken ) and
comment . line == token . end_mark . line + 1 and
comment . line == token . end_mark . line + 1 ) :
comment . pointer - token . end_mark . pointer <
# Sometimes token end marks are on the next line
conf [ ' min-spaces-from-content ' ] ) :
if token . end_mark . buffer [ token . end_mark . pointer - 1 ] != ' \n ' :
yield LintProblem ( comment . line , comment . column ,
if ( comment . pointer - token . end_mark . pointer <
' too few spaces before comment ' )
conf [ ' min-spaces-from-content ' ] ) :
yield LintProblem ( comment . line , comment . column ,
' too few spaces before comment ' )
if ( conf [ ' require-starting-space ' ] and
if ( conf [ ' require-starting-space ' ] and
comment . pointer + 1 < len ( comment . buffer ) and
comment . pointer + 1 < len ( comment . buffer ) and