Skip to content

Commit

Permalink
MNT Add linting of language stucture/style
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Nov 1, 2023
1 parent 49ecac9 commit c9bdd34
Show file tree
Hide file tree
Showing 30 changed files with 456 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
StylesPath = .vale/styles

Vocab = Silverstripe

MinAlertLevel = suggestion

; Don't check inside heading anchors, i.e. inside {#my-anchor}
WordTemplate = "[^#]\b(?:%s)\b[^}]"

[*.md]
BasedOnStyles = Silverstripe-cms, openly #Vale
17 changes: 17 additions & 0 deletions .vale/styles/Silverstripe-cms/Condescending.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
extends: existence
message: Using '%s' may come across as condescending.
link: https://css-tricks.com/words-avoid-educational-writing/
level: error
ignorecase: true
tokens:
- obvious
- obviously
- simple
- simply
- easy
- easily
- of course
- clearly
- everyone knows
- naturally
51 changes: 51 additions & 0 deletions .vale/styles/Silverstripe-cms/Gendered.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
extends: substitution
message: "Consider using '%s' instead of '%s'."
ignorecase: true
level: warning
action:
name: replace
swap:
man: person
men: people
boy: person
boys: people
woman: person
women: people
girl: person
girls: people
he: they
him: them
his: their
she: they
her: them
hers: their
air(?:m[ae]n|wom[ae]n): pilot(s)
anchor(?:m[ae]n|wom[ae]n): anchor(s)
camera(?:m[ae]n|wom[ae]n): camera operator(s)
chair(?:m[ae]n|wom[ae]n): chair(s)
door(?:m[ae]|wom[ae]n): concierge(s)
fire(?:m[ae]n|wom[ae]n): firefighter(s)
fisher(?:m[ae]n|wom[ae]n): fisher(s)
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
ladylike: courteous
land(?:lady|lord): building manager
mail(?:m[ae]n|wom[ae]n): mail carriers
man and wife: spouses
husband: spouse
wife: spouse
mankind: humankind
manmade: manufactured|artificial|synthetic|machine-made|constructed
manned: staffed|crewed|piloted
manpower: human resources|workforce|personnel|staff|labor|personnel|labor force|staffing|combat
personnel
middle(?:m[ae]n|wom[ae]n): intermediary
police(?:m[ae]n|wom[ae]n): police officer(s)
repair(?:m[ae]n|wom[ae]n): technician(s)
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
steward(?:ess)?: flight attendant
unmanned: robotic|automated
workmanship: quality construction|expertise
waitress: waiter
work(?:m[ae]n|wom[ae]n): worker(s)
8 changes: 8 additions & 0 deletions .vale/styles/Silverstripe-cms/Hedging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "'%s' is hedging."
ignorecase: true
level: error
tokens:
- I would argue that
- ', so to speak'
- to a certain degree
18 changes: 18 additions & 0 deletions .vale/styles/Silverstripe-cms/Race.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
extends: substitution
message: Consider using '%s' instead of '%s'.
ignorecase: true
level: warning
action:
name: replace
swap:
master copy: pass key|original
master key: pass key|original
master plan: grand scheme|guiding principles
master the art: become skilled
master: main|primary|hub|reference
masters: main|primaries|hubs|references
masterful: skilled|authoritative|commanding
mastermind: genius|creator|instigator|oversee|launch|originate
masterpiece: "work of genius|chef d\u2019oeuvre"
masterplan: vision|comprehensive plan
12 changes: 12 additions & 0 deletions .vale/styles/Silverstripe-cms/Repetition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Error: gitlab.Repetition
#
# Checks for duplicate words, like `the the` or `and and`.
#
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/Repetition.yml
extends: repetition
message: '"%s" is repeated.'
level: error
alpha: true
tokens:
- '[^\s]+'
31 changes: 31 additions & 0 deletions .vale/styles/Silverstripe-cms/Terms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
extends: substitution
message: Use '%s' instead of '%s'.
level: error
ignorecase: true
swap:
"(?:LetsEncrypt|Let's Encrypt)": Let's Encrypt
"Mac ?OS ?X": macOS
"mongoDB": MongoDB
"node[.]?js": Node.js
"mysql": MySQL
"Post?gr?e(?:SQL)": PostgreSQL
"java[ -]?scripts?": JavaScript
centOS: CentOS
cloudflare: Cloudflare
debian: Debian
homebrew: Homebrew
kubernetes: Kubernetes
markdown: Markdown
macOS: macOS
npm: NPM
ubuntu: Ubuntu
yaml: YAML (or yml for syntax highlighting code blocks)
url: URL
urls: URLs
uri: URI
uris: URIs
gpu: GPU
typescript: TypeScript
'getters?': getter method(s)
'setters?': setter method(s)
'dataobjects?': 'models(s)|record(s) (or wrap it in backticks if referencing `DataObject` specifically)'
6 changes: 6 additions & 0 deletions .vale/styles/Silverstripe-cms/Todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: "'%s' left in text."
ignorecase: true
level: error
tokens:
- todo
15 changes: 15 additions & 0 deletions .vale/styles/Silverstripe-cms/Typography.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends: substitution
message: Use '%s' instead of '%s'.
level: error
nonword: true
ignorecase: true
swap:
'': '...'
'\(c\)': ©
'\(tm\)':
'\(r\)': ®
'×': 'x'
'[“”„]': '"'
'[‘’‚]': "'"
'[‹«]': "<"
'[›»]': ">"
26 changes: 26 additions & 0 deletions .vale/styles/Silverstripe-cms/US-to-GB.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
extends: substitution
message: Use '%s' instead of '%s'.
level: error
ignorecase: true
swap:
apologize: apologise
armor: armour
behavior: behaviour
centralize: centralise
color: colour
customize: customise
decentralize: decentralise
defence: defense
emphasize: emphasise
finalize: finalise
flavor: flavour
labeled: labelled
labor: labour
localize: localise
offense: offence
organize: organise
organized: organised
organizing: organising
recognize: recognise
theater: theatre
unauthorized: unauthorised
43 changes: 43 additions & 0 deletions .vale/styles/Vocab/Silverstripe/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Silverstripe
CMS
third-party
GraphQL
middleware
namespace
namespaced
Silverstripe
CMS
third-party
GraphQL
dev
hardcode
namespace
autoload
config
PHPDoc
Packagist
phar
upgrader
webroot
webserver
webservers
validator
transifex
subfolder
preconfigured
misconfigured
Nginx
Bitnami
sendmail
Lighttpd
performant
changelog
hostname
previewable
shortcode
unversioned
changeset
unpublish
unpublished
unpublishing
scaffolded
7 changes: 7 additions & 0 deletions .vale/styles/openly/A11Y.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: substitution
message: Consider using '%s' instead of '%s'
ignorecase: true
level: error
swap:
(?:click|press): "'select'"
23 changes: 23 additions & 0 deletions .vale/styles/openly/Anthropomorphism.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
extends: existence
ignorecase: true
level: warning
message: "Don't attribute human qualities to software or hardware."
raw:
- \b(?:PC|computer|object|machine|software|hardware|data|database|engine|message|command|interface)\b\s*
tokens:
- sees
- tells
- thinks
- wants
- cares
- realizes
- assumes
- knows
- remembers
- decides
- knows
- refuses
- demands
- understands
- behaves
8 changes: 8 additions & 0 deletions .vale/styles/openly/HeadingsPunctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: existence
message: Do not use '%s' at the end of headings
link: https://github.com/Openly/docs/blob/master/STYLE.md#capitalization-and-punctuation
scope: heading
level: warning
raw:
- '(?:\:|\.)$'
29 changes: 29 additions & 0 deletions .vale/styles/openly/Hedging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
extends: existence
message: "Consider removing '%s'"
ignorecase: true
level: warning
tokens:
- appear to be
- arguably
- as far as I know
- could
- from my point of view
- hopefully
- I believe
- I doubt
- I think
- in general
- In my opinion
- likely
- might
- more or less
- perhaps
- possibly
- presumably
- probably
- seem(s)?
- somewhat
- to my knowledge
- unlikely
- usually
21 changes: 21 additions & 0 deletions .vale/styles/openly/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 TestTheDocs - Incubator

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions .vale/styles/openly/Link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
message: "Don't use '%s' as the content of a link."
extends: existence
ignorecase: true
scope: raw
level: error
tokens:
- '\[here\]\('
8 changes: 8 additions & 0 deletions .vale/styles/openly/Quotes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: existence
message: 'Punctuation should be inside the quotes.'
level: error
nonword: true
tokens:
- '"[^"]+"[.,?]'
- "'[^']+'[.,?]"
8 changes: 8 additions & 0 deletions .vale/styles/openly/SentenceLength.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
message: "Write short sentences (less than 25 words)."
extends: occurrence
link: http://styleguide.mailchimp.com/writing-for-accessibility/#header-3-use-plain-language
scope: sentence
level: warning
max: 25
token: \b(\w+)\b
15 changes: 15 additions & 0 deletions .vale/styles/openly/Spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: spelling
message: "Did you really mean '%s'?"
level: error
code: false
ignore:
- openly/tech-terms/security.txt
- openly/tech-terms/blockchain.txt
- openly/tech-terms/devops.txt
- openly/tech-terms/general.txt
- openly/tech-terms/techwriting.txt
- openly/tech-terms/mobile.txt
- openly/tech-terms/linux.txt
- openly/tech-terms/monitoring.txt
- openly/tech-terms/apis.txt
2 changes: 2 additions & 0 deletions .vale/styles/openly/tech-terms/apis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
api
grpc
Loading

0 comments on commit c9bdd34

Please sign in to comment.