mirror of https://github.com/docker/docs.git
add vale code formatting checks
This commit is contained in:
parent
a521dc7678
commit
597d898942
|
@ -0,0 +1,9 @@
|
|||
extends: existence
|
||||
message: "Indent nested code blocks by 3 spaces and double-nested code blocks by 5 spaces."
|
||||
link: https://docs.docker.com/contribute/style/formatting/#best-practice-for-commands
|
||||
level: warning
|
||||
scope: raw
|
||||
# check for 1, 2, 4, 6 or more spaces at start of line before code fence (```)
|
||||
#If not indented by 3 spaces at first level or 5 spaces at second level, then a hidden space is inserted and copied by the copy code feature.
|
||||
raw:
|
||||
- '(?m:^[ ]{4}\`\`\`|^[ ]{6,}\`\`\`|^[ ]{1}\`\`\`|^[ ]{2}\`\`\`)'
|
|
@ -0,0 +1,8 @@
|
|||
extends: existence
|
||||
message: "If you expect users to copy and run the command, specify output in a separate code block."
|
||||
link: https://docs.docker.com/contribute/style/formatting/#best-practice-for-commands
|
||||
level: warning
|
||||
scope: raw
|
||||
#check for console code fence followed by one line with $ or #, and not ending in `or \. Followed by more lines without $ or # and terminated by code fence
|
||||
raw:
|
||||
- '(?m:\`\`\`console\n+(\s*.*(\$|#).*[^\`\\]$)([^\$#(\`\`\`)]+\n)\s*\`\`\`)'
|
|
@ -0,0 +1,8 @@
|
|||
extends: existence
|
||||
message: "If you expect users to copy and run the command, specify one command per code block."
|
||||
link: https://docs.docker.com/contribute/style/formatting/#best-practice-for-commands
|
||||
level: warning
|
||||
scope: raw
|
||||
#check for console code fence followed by two or more newlines with $ or #
|
||||
raw:
|
||||
- '(?m:\`\`\`console\n+(\s*.*(\$|#).*\n){2,})'
|
Loading…
Reference in New Issue