Skip to content
Snippets Groups Projects
Commit 5a0be06a authored by Evan Read's avatar Evan Read
Browse files

Apply split Vale rules

- Splits a section of value rules into gitlab_base.
- Corrects line length violations incurred by the new rules.
parent 1e1b878e
No related branches found
No related tags found
2 merge requests!153heptapod#1722: making 17.3 the new stable,!152Merge upstream Omnibus GitLab into Omnibus Heptapod
Showing
with 10 additions and 362 deletions
...@@ -16,7 +16,12 @@ ...@@ -16,7 +16,12 @@
style: "atx" style: "atx"
hr-style: # MD035 hr-style: # MD035
style: "---" style: "---"
line-length: false # MD013 line-length: # MD013
code_blocks: false
tables: false
headings: true
heading_line_length: 100
line_length: 800
no-duplicate-heading: # MD024 no-duplicate-heading: # MD024
siblings_only: true siblings_only: true
no-emphasis-as-heading: false # MD036 no-emphasis-as-heading: false # MD036
......
...@@ -6,4 +6,7 @@ ...@@ -6,4 +6,7 @@
MinAlertLevel = suggestion MinAlertLevel = suggestion
[*.md] [*.md]
BasedOnStyles = gitlab BasedOnStyles = gitlab_base, gitlab_docs
# Ignore SVG markup
TokenIgnores = (\*\*\{\w*\}\*\*)
---
# Error: gitlab.AlertBoxStyle
#
# Makes sure alert boxes are used with block quotes. Checks for 3 formatting issues:
#
# - Alert boxes inside a block quote ('>')
# - Alert boxes with the note text on the same line
# - Alert boxes using words other than 'NOTE' or 'WARNING'
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Update the format of the '%s' alert box. View the style guide for details."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#alert-boxes
level: error
nonword: true
scope: raw
raw:
- '(\n *\> *(?:NOTE|WARNING)|'
- '\n\n(NOTE|WARNING):[^\n]|'
- '\n\n *(?:> )?\**(Note|note|TIP|Tip|tip|CAUTION|Caution|caution|DANGER|Danger|danger|Warning|warning):.*)'
---
# Warning: gitlab.BadPlurals
#
# Don't write plural words with the '(s)' construction. 'HTTP(S)' is acceptable.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Rewrite '%s' to be plural without parentheses."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#s
level: warning
ignorecase: true
raw:
- '\b\w+\(s\)(?<!http\(s\))'
# Warning: gitlab.Badges-Offerings
#
# Tests the offering information in the tier badges that appear below topic titles.
#
# For a list of all options, see https://docs.gitlab.com/ee/development/documentation/styleguide/#available-product-tier-badges
extends: existence
message: "Offerings should be comma-separated, without `and`, and must be capitalized. Example: `GitLab.com, Self-managed, GitLab Dedicated`."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/#available-product-tier-badges
level: error
scope: raw
raw:
- (?<=\n\*\*Offering:\*\* )(Dedicated|[^\n]*(SaaS|self-managed|Self-Managed|GitLab dedicated|and|GitLab Dedicated,|, GitLab\.com|, Dedicated))
# Warning: gitlab.Badges-Tiers
#
# Tests the tier information in the tier badges that appear below topic titles.
#
# For a list of all options, see https://docs.gitlab.com/ee/development/documentation/styleguide/#available-product-tier-badges
extends: existence
message: "Tiers should be capitalized, comma-separated, and ordered lowest to highest."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/#available-product-tier-badges
level: error
scope: raw
raw:
- (?<=\n\*\*Tier:\*\*)[^\n]*(free|premium|ultimate|, Free|Ultimate,)
---
# Error: gitlab.British
#
# Checks that US spelling is used instead of British spelling.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: substitution
message: "Use the US spelling '%s' instead of the British '%s'."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language
level: error
ignorecase: true
swap:
aeon: eon
aeroplane: airplane
ageing: aging
aluminium: aluminum
anaemia: anemia
anaesthesia: anesthesia
analyse: analyze
annexe: annex
apologise: apologize
authorise: authorize
authorised: authorized
authorisation: authorization
authorising: authorizing
behaviour: behavior
busses: buses
calibre: caliber
categorise: categorize
categorised: categorized
categorises: categorizes
categorising: categorizing
centre: center
cheque: check
civilisation: civilization
civilise: civilize
colour: color
cosy: cozy
cypher: cipher
dependant: dependent
defence: defense
distil: distill
draught: draft
encyclopaedia: encyclopedia
enquiry: inquiry
enrol: enroll
enrolment: enrollment
enthral: enthrall
# equalled: equaled // Under discussion
# equalling: equaling // Under discussion
favourite: favorite
fibre: fiber
fillet: filet
flavour: flavor
furore: furor
fulfil: fulfill
gaol: jail
grey: gray
humour: humor
honour: honor
initialled: initialed
initialling: initialing
instil: instill
jewellery: jewelry
labelling: labeling
labelled: labeled
labour: labor
libellous: libelous
licence: license
likeable: likable
liveable: livable
lustre: luster
manoeuvre: maneuver
marvellous: marvelous
matt: matte
meagre: meager
metre: meter
modelling: modeling
moustache: mustache
neighbour: neighbor
normalise: normalize
offence: offense
optimise: optimize
optimised: optimized
optimising: optimizing
organise: organize
orientated: oriented
paralyse: paralyze
plough: plow
pretence: pretense
programme: program
pyjamas: pajamas
rateable: ratable
realise: realize
recognise: recognize
reconnoitre: reconnoiter
rumour: rumor
sabre: saber
saleable: salable
saltpetre: saltpeter
sceptic: skeptic
sepulchre: sepulcher
signalling: signaling
sizeable: sizable
skilful: skillful
sombre: somber
smoulder: smolder
speciality: specialty
spectre: specter
splendour: splendor
standardise: standardize
standardised: standardized
sulphur: sulfur
theatre: theater
travelled: traveled
traveller: traveler
travelling: traveling
unshakeable: unshakable
wilful: willful
yoghurt: yogurt
---
# Error: gitlab.CIConfigFile
#
# Checks that the `.gitlab-ci.yml` file is referenced properly.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Change the file name to be exactly '.gitlab-ci.yml'."
link: https://docs.gitlab.com/ee/development/documentation/versions.html
level: error
scope: raw
raw:
- '(?!`\.gitlab-ci\.yml`)`.?gitlab.?ci.?ya?ml`'
---
# Error: gitlab.CodeblockFences
#
# Ensures all codeblock language tags use the full name, not aliases.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Instead of '%s' for the code block, use yaml, ruby, plaintext, markdown, javascript, shell, go, python, dockerfile, or typescript."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#code-blocks
level: error
scope: raw
raw:
- '\`\`\`(yml|rb|text|md|bash|sh\n|js\n|golang\n|py\n|docker\n|ts)'
---
# Error: gitlab.CommandStringsQuoted
#
# Ensures all code blocks wrap URL strings in quotation marks.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "For the command example, use double quotes around the URL: %s"
link: https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html#curl-commands
level: error
scope: raw
nonword: true
tokens:
- '(curl|--url)[^"\]\n]+?https?:\/\/[^ \n]*'
---
# Warning: gitlab.CurrentStatus
#
# Checks for words that indicate a product or feature may change in the future.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Remove '%s'. The documentation reflects the current state of the product."
level: warning
ignorecase: true
link: https://docs.gitlab.com/ee/development/documentation/versions.html#promising-features-in-future-versions
tokens:
- currently
---
# Warning: gitlab.DefaultBranch
#
# Do not refer to the default branch as the 'master' branch, if possible.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Use 'default branch' or `main` instead of `master`, when possible."
level: warning
ignorecase: true
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#default-branch
scope: raw
raw:
- '\`master\`'
---
# Suggestion: gitlab.Dropdown
#
# Catches many ways the phrase 'dropdown list' can be fumbled.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Use 'dropdown list'."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#dropdown-list
level: warning
ignorecase: true
tokens:
- drop-down( [\w]*)?
- dropdown(?! list)
---
# Warning: gitlab.EOLWhitespace
#
# Checks that there is no useless whitespace at the end of lines.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Remove whitespace characters from the end of the line."
link: https://docs.gitlab.com/ee/development/documentation/versions.html
level: warning
scope: raw
raw:
- ' +\n'
---
# Warning: gitlab.ElementDescriptors
#
# Suggests the correct way to describe a button.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "If possible, rewrite to remove 'button'."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#button
level: warning
ignorecase: true
scope: raw
raw:
- \*\*[^*]+\*\*\s+button
---
# Warning: gitlab.FutureTense
#
# Checks for use of future tense in sentences. Present tense is strongly preferred.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Instead of future tense '%s', use present tense."
ignorecase: true
level: warning
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#future-tense
raw:
- "(going to( |\n|[[:punct:]])[a-zA-Z]*|"
- "will( |\n|[[:punct:]])[a-zA-Z]*|"
- "won't( |\n|[[:punct:]])[a-zA-Z]*|"
- "[a-zA-Z]*'ll( |\n|[[:punct:]])[a-zA-Z]*)"
---
# Warning: gitlab.GitLabFlavoredMarkdown
#
# Checks for unclear use of GLFM or GLM instead of GitLab/GitHub Flavored Markdown
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: substitution
message: "Use '%s' instead of '%s' when possible."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html
level: warning
ignorecase: true
swap:
GLFM: "GitLab Flavored Markdown"
GFM: "GitLab Flavored Markdown' or 'GitHub Flavored Markdown"
---
# Warning: gitlab.HeadingContent
#
# Checks for generic, unhelpful subheadings.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Rename the heading '%s', or re-purpose the content elsewhere."
level: warning
link: https://docs.gitlab.com/ee/development/documentation/topic_types/concept.html#concept-topic-titles
ignorecase: true
nonword: true
scope: raw
tokens:
- '\#+ How it works'
- '\#+ Limitations'
- '\#+ Overview'
- '\#+ Use cases?'
- '\#+ Important notes?'
---
# Suggestion: gitlab.HeadingDepth
#
# Checks that there are no headings greater than 3 levels
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "Refactor the section or page to avoid headings greater than H5."
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#heading-levels-in-markdown
level: suggestion
scope: raw
raw:
- '(?<=\n)#{6,}\s.*'
---
# Warning: gitlab.HistoryItems
#
# Ensures history items are properly formatted.
#
extends: existence
message: "History items must always start with '> -', one item per line, even if there is only one item."
link: https://docs.gitlab.com/ee/development/documentation/versions.html#add-a-version-history-item
level: error
scope: raw
raw:
- '(?m)(?<=^#+[^\n]*\n\n)> [^-]|'
- '^> - [^\n]*\n[^\n>`]'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment