Pattern: Malformed comment
Issue: -
This rule enforces the position and formatting of comments.
- Use
require-starting-space
to require a space character right after the#
. Set totrue
to enable,false
to disable. min-spaces-from-content
is used to visually separate inline comments from content. It defines the minimal required number of spaces between a comment and its preceding content.
-
With
comments: {require-starting-space: true}
the following code snippet would PASS:
# This sentence # is a block comment
the following code snippet would PASS:
############################## ## This is some documentation
the following code snippet would FAIL:
#This sentence #is a block comment
-
With
comments: {min-spaces-from-content: 2}
the following code snippet would PASS:
x = 2 ^ 127 - 1 # Mersenne prime number
the following code snippet would FAIL:
x = 2 ^ 127 - 1 # Mersenne prime number