Skip to content

Commit 639a7c6

Browse files
mikalsandeadrienverge
authored andcommitted
comments: Tell how many spaces are expected in 'min-spaces-from-content'
When telling someone that there are too few spaces before a comment it can be useful to include how many were expected.
1 parent 0f2fbb0 commit 639a7c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

yamllint/rules/comments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def check(conf, comment):
9090
comment.pointer - comment.token_before.end_mark.pointer <
9191
conf['min-spaces-from-content']):
9292
yield LintProblem(comment.line_no, comment.column_no,
93-
'too few spaces before comment')
93+
'too few spaces before comment: expected '
94+
f'{conf["min-spaces-from-content"]}')
9495

9596
if conf['require-starting-space']:
9697
text_start = comment.pointer + 1

0 commit comments

Comments
 (0)