Skip to content

Commit

Permalink
add some styles
Browse files Browse the repository at this point in the history
Signed-off-by: Jo Stichbury <jo_stichbury@mckinsey.com>
  • Loading branch information
stichbury committed Aug 22, 2023
1 parent aacd0ad commit 0eae371
Show file tree
Hide file tree
Showing 14 changed files with 700 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/styles/Kedro/abbreviations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: substitution
message: "Use '%s' instead of abbreviations like '%s'."
ignorecase: true
level: error
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.|eg\.)[\s,]': for example
'\b(?:ie|i\.e\.|ie\.)[\s,]': that is
'\b(?:etc)[\s\n,.]': and more
40 changes: 40 additions & 0 deletions .github/styles/Kedro/contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Started with 18F's guide https://github.com/testthedocs/vale-styles/blob/master/18F/Contractions.yml but changed to not use negative contractions as per GOV.UK style
extends: substitution
message: Use '%s' instead of '%s.'
level: error
ignorecase: true
swap:
it is: it's
it will: it'll
we are: we're
we will: we'll
we have: we've
they are: they're
they will: they'll
that is: that's
that will: that'll
who is: who's
who will: who'll
what is: what's
what will: what'll
where is: where's
where will: where'll
when is: when's
when will: when'll
why is: why's
why will: why'll
how is: how's
how will: how'll
isn't: is not
aren't: are not
wasn't: was not
weren't: were not
haven't: have not
hasn't: has not
won't: will not
don't: do not
doesn't: does not
didn't: did not
can't: cannot
couldn't: could not
shouldn't: should not
13 changes: 13 additions & 0 deletions .github/styles/Kedro/gender.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: "Use a gender-neutral pronoun instead of '%s'."
level: error
ignorecase: true
tokens:
- he/she
- s/he
- \(s\)he
- \bhe\b
- \bhim\b
- \bhis\b
- \bshe\b
- \bher\b
53 changes: 53 additions & 0 deletions .github/styles/Kedro/headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
extends: capitalization
message: "'%s' should use sentence-style capitalization."
level: warning
scope: heading
match: $sentence
exceptions:
- Kedro
- Kedro-Viz
- Airflow
- Amazon
- Amazon Web Services
- AWS Step Functions
- AWS Systems Manager
- Azure
- Azure App Service
- Azure App Service Plan
- Azure Blob Storage
- Azure Event Hub
- CI/CD
- DataCatalog
- Docker
- Docker Compose
- Docker Swarm
- Dockerfile
- GitHub
- GitHub Actions
- Google
- Google Analytics
- Google Cloud
- Google Cloud Functions
- GraphQL
- Heroku
- IDs
- Jenkins
- JFrog
- JFrog Artifactory
- Jira
- Kafka
- Kubernetes
- Kubernetes Engine
- Kubernetes Pod
- Kubernetes Service
- Lambda
- Linux
- MySQL
- Python
- Red Hat
- Redis
- Slack
- Ubuntu
- Unix
- URLs

12 changes: 12 additions & 0 deletions .github/styles/Kedro/inclusive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: substitution
message: "Use '%s' instead of '%s'."
ignorecase: true
level: error
action:
name: replace
swap:
# bad: good
'black ?list': 'disallow list|exclude list'
'master': primary
'slave': secondary
'white ?list': 'allow list|include list'
24 changes: 24 additions & 0 deletions .github/styles/Kedro/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
extends: substitution
message: "Avoid vague text in links like '%s' unless you can pair it with more descriptive text."
link: 'https://github.com/kedro-org/kedro/wiki/Kedro-documentation-style-guide'
ignorecase: true
scope: raw
nonword: true
level: warning

swap:
# For the word 'here' in Markdown and HTML links
'\[here\]\(.*?\)': 'here'
'<a\s*href\s*=\s*".*?".*?>\s*here\s*</a>': 'here'

# For the word 'this' in Markdown and HTML links
'\[this\]\(.*?\)': 'this'
'<a\s*href\s*=\s*".*?".*?>\s*this\s*</a>': 'this'

# For the word 'page' in Markdown and HTML links
'\[page\]\(.*?\)': 'page'
'<a\s*href\s*=\s*".*?".*?>\s*page\s*</a>': 'page'

# For the phrase 'this page' in Markdown and HTML links
'\[this page\]\(.*?\)': 'this page'
'<a\s*href\s*=\s*".*?".*?>\s*this page\s*</a>': 'this page'
6 changes: 6 additions & 0 deletions .github/styles/Kedro/oxfordcomma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: existence
message: "Use the Oxford comma in '%s'."
scope: sentence
level: suggestion
tokens:
- '(?:[^,]+,){1,}\s\w+\s(?:and|or)'
12 changes: 12 additions & 0 deletions .github/styles/Kedro/pronouns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "Avoid first-person singular pronouns such as '%s'."
level: warning
nonword: true
tokens:
- (?<=^|\s)I(?=\s)
- (?<=^|\s)I,(?=\s)
- \bI'm\b
- (?<=\s)[Mm]e\b
- (?<=\s)[Mm]y\b
- (?<=\s)[Mm]ine\b

10 changes: 10 additions & 0 deletions .github/styles/Kedro/quotes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: existence
message: Use straight quotes instead of smart quotes.
level: error
nonword: true
action:
tokens:
-
-
-
-
11 changes: 11 additions & 0 deletions .github/styles/Kedro/sentencelength.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: occurrence
message: "Try to keep your sentence length to 30 words or fewer."
level: suggestion
# Here, we're counting the number of words
# in a sentence.
#
# If there are more than 30, we'll flag it.
scope: sentence
ignorecase: false
max: 30
token: (\w+)
Loading

0 comments on commit 0eae371

Please sign in to comment.