-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[core] Setup vale for enforcing style guides #39633
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f09e241
[core] Setup vale for enforcing style guides
alexfauquette 67fb59c
standard naming
alexfauquette 69ed422
renam sub-components -> subcomponents
alexfauquette 660f21d
Update .github/styles/Blog/ComposedWords.yml
alexfauquette 6eb20f3
Apply suggestions from code review
alexfauquette 25eb704
fix
alexfauquette faf77b3
Update .vale.ini
alexfauquette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extends: substitution | ||
message: To be consistent with the rest of the documentation, consider using '%s' instead of '%s'. | ||
level: warning | ||
ignorecase: true | ||
# swap maps tokens in form of bad: good | ||
# for more information: https://vale.sh/docs/topics/styles/#substitution | ||
swap: | ||
sub-component: subcomponent | ||
sub-components: subcomponents | ||
'sub component': subcomponent | ||
'sub components': subcomponents | ||
'use-case': 'use case' | ||
'use-case': 'use case' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends: substitution | ||
message: To be consistent with capitalization, consider using '%s' instead of '%s'. | ||
level: warning | ||
ignorecase: false | ||
# swap maps tokens in form of bad: good | ||
# for more information: https://vale.sh/docs/topics/styles/#substitution | ||
swap: | ||
api: API | ||
Api: API | ||
typescript: TypeScript | ||
Typescript: TypeScript | ||
ts: TypeScript | ||
TS: TypeScript | ||
javascript: JavaScript | ||
Javascript: JavaScript | ||
css: CSS | ||
Css: CSS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extends: substitution | ||
message: Do you mean '%s' instead of '%s'? | ||
level: warning | ||
ignorecase: true | ||
# swap maps tokens in form of bad: good | ||
# for more information: https://vale.sh/docs/topics/styles/#substitution | ||
swap: | ||
bellow: below | ||
eg: e.g. | ||
eg.: e.g. | ||
'e.g ': 'e.g. ' | ||
alexfauquette marked this conversation as resolved.
Show resolved
Hide resolved
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Vale action | ||
|
||
on: [pull_request] | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
vale: | ||
name: runner / vale | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: errata-ai/vale-action@c4213d4de3d5f718b8497bd86161531c78992084 # v2.0.1 | ||
with: | ||
reporter: github-pr-review | ||
files: docs/data | ||
env: | ||
# Required, set by GitHub actions automatically: | ||
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Config vale. More information at https://docs.errata.ai/vale/config | ||
StylesPath = .github/styles | ||
MinAlertLevel = suggestion | ||
|
||
Packages = Google | ||
|
||
[*.md] | ||
# Ignore code injection which start with {{... | ||
BlockIgnores = {{.* | ||
|
||
# Custom syle | ||
# BasedOnStyles = Blog | ||
|
||
Blog.ComposedWords = YES | ||
Blog.NamingConventions = YES | ||
Blog.Typos = YES | ||
|
||
# Google: | ||
Google.FirstPerson = YES # Avoid first-person pronouns such as I, me, ...'. | ||
Google.GenderBias = YES # Avoid gendered profession | ||
Google.OxfordComma = YES | ||
Google.Quotes = YES # Commas and periods go inside quotation marks. | ||
Google.Spelling = YES #In general, use American spelling (word ending with 'nised' or 'logue') | ||
Google.We = YES # Try to avoid using first-person plural | ||
alexfauquette marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Those rules are not repected a lot | ||
# Google.Passive = YES # In general, use active voice instead of passive voice. | ||
# Google.Will = YES # Avoid using will | ||
alexfauquette marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# False positives with "1st" nearly no use in our doc | ||
# Google.Units = YES # Put a nonbreaking space between the number and the unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reminds me: can we add a rule to avoid Latinisms altogether? (etc., e.g., i.e.) - they're often confusing to non-native English speakers, and the latter two in particular are frequently misused. "etc." can always be cut or replaced with "and more", and "e.g" and "i.e." can be replaced with "for example."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Google has a Latin packge to detect
eg
andie
: https://github.com/errata-ai/Google/tree/master/Google