Commit 1aac1232 authored by Amy Qualls's avatar Amy Qualls

Merge branch 'vale-sub-rules-1' into 'master'

Make stricter alert box rules

See merge request gitlab-org/gitlab!43676
parents 814a1f88 c8021e2a
---
# Error: gitlab.AlertBoxCaution
#
# Makes sure DANGER: alert boxes follow standard formatting.
#
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
extends: substitution
message: "CAUTION: alert boxes must be of the format 'CAUTION: **Caution:**'. 'Caution' can be replaced with 'Warning' or 'Important'."
level: warning
nonword: true
scope: raw
swap:
'CAUTION: *?\*\*.*\*\*': 'CAUTION: \*\*(?:Caution|Warning|Important):\*\*'
---
# Error: gitlab.AlertBoxDanger
#
# Makes sure DANGER: alert boxes follow standard formatting.
#
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
extends: substitution
message: "DANGER: alert boxes must be of the format 'DANGER: **Warning:**'. 'Warning' can be replaced with 'Important', 'Deprecated', or 'Required'."
level: warning
nonword: true
scope: raw
swap:
'DANGER: *?\*\*.*\*\*': 'DANGER: \*\*(?:Warning|Important|Deprecated|Required):\*\*'
---
# Error: gitlab.AlertBoxNoteTip
#
# Makes sure NOTE: and TIP: alert boxes follow standard formatting.
#
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
extends: substitution
message: "NOTE: and TIP: alert boxes must be of the format 'NOTE: **Note:**' or 'TIP: **Tip:**"
level: warning
nonword: true
scope: raw
swap:
'NOTE: *?\*\*.*\*\*': 'NOTE: \*\*Note:\*\*'
'TIP: *?\*\*.*\*\*': 'TIP: \*\*Tip:\*\*'
......@@ -3,9 +3,7 @@
#
# Makes sure alert boxes follow standard formatting.
#
# Checks for 4 known issues:
# - Alert boxes with no colon, or colon outside the bold text
# - Known incorrect capitalization of the most commonly used alert box text
# Checks for 2 formatting issues:
# - Alert boxes with the note text on the same line
# - Alert boxes using blockquote formatting, like "> **Note:**"
#
......@@ -16,7 +14,5 @@ link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#alert
level: error
scope: raw
raw:
- '((NOTE|TIP|CAUTION|DANGER): \*\*[^:]*\*\*)|'
- '((NOTE: \*\*(NOTE|note):\*\*)|(TIP: \*\*(TIP|tip):\*\*)|(CAUTION: \*\*(CAUTION|caution):\*\*)|(DANGER: \*\*(DANGER|danger):\*\*))|'
- '((NOTE|TIP|CAUTION|DANGER): \*\*.*\*\*.+)|'
- '((\n[> ]*(\*){1,2}(NOTE|Note|note|TIP|Tip|tip|CAUTION|Caution|caution|DANGER|Danger|danger):(\*){1,2}))'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment