Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vale config #16398

Merged
merged 7 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/styles/cloudflare/Contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# Warning: cloudflare.Contractsion
#
# Suggests alternatives for common contractions.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/

extends: substitution
message: "Use '%s' instead of '%s'."
link: https://developers.cloudflare.com/style-guide/grammar/parts-of-speech/contractions/
level: error
ignorecase: true
action:
name: replace
swap:
are not: aren't
cannot: can't
could not: couldn't
did not: didn't
do not: don't
does not: doesn't
has not: hasn't
have not: haven't
how is: how's
is not: isn't

'it is(?!\.)': it's
'it''s(?=\.)': it is

should not: shouldn't

"that is(?![.,])": that's
'that''s(?=\.)': that is

'they are(?!\.)': they're
'they''re(?=\.)': they are

was not: wasn't

'we are(?!\.)': we're
'we''re(?=\.)': we are

'we have(?!\.)': we've
'we''ve(?=\.)': we have

were not: weren't

'what is(?!\.)': what's
'what''s(?=\.)': what is

'when is(?!\.)': when's
'when''s(?=\.)': when is

'where is(?!\.)': where's
'where''s(?=\.)': where is

will not: won't
18 changes: 18 additions & 0 deletions .github/styles/cloudflare/LatinTerms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# Warning: cloudflare.LatinTerms
#
# Checks for use of Latin terms.
# Uses https://github.com/errata-ai/Google/blob/master/Google/Latin.yml for ideas.
kodster28 marked this conversation as resolved.
Show resolved Hide resolved
#
# For a list of all options, see https://vale.sh/docs/topics/styles/

extends: substitution
message: "Use '%s' instead of '%s', but consider rewriting the sentence."
link: https://developers.cloudflare.com/style-guide/grammar/parts-of-speech/abbreviations/#ie-vs-eg
level: warning
nonword: true
ignorecase: true
swap:
'\b(?:e\.?g[\s.,;:])': for example
'\b(?:i\.?e[\s.,;:])': that is
'\bvia\b': "with', 'through', or 'by using"
47 changes: 0 additions & 47 deletions .github/styles/cloudflare/ShellCodeBlocks.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
StylesPath = .github/styles
MinAlertLevel = suggestion
IgnoredScopes = code, tt, img, url, a
SkippedScopes = script, style, pre, figure, code

[formats]
yml = yaml
mdx = md

[*]
# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs, and angle brackets.
TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[)

[*.md]
BasedOnStyles = cloudflare
BlockIgnores = (?s) *({{< ?code-block [^>]* >}}.*?{{< ?/ ?code-block >}})

[*.yaml]
BasedOnStyles = cloudflare
Loading