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

[docs-infra] Add vale for style-guide lint on docs #3178

Merged
merged 17 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
23 changes: 23 additions & 0 deletions .github/workflows/vale-action.yml
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}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ test-results
.yarn-playwright-cache

/test/regressions/screenshots/**

# vale downloaded config
Janpot marked this conversation as resolved.
Show resolved Hide resolved
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
.github/styles/
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
29 changes: 29 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Config vale. More information at https://docs.errata.ai/vale/config
StylesPath = .github/styles
MinAlertLevel = suggestion

# To update writing-rules package:
# 1. Go on material-ui repo on the docs folder
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
# 2. Update/create YAML files
# 3. run `pnpm docs:zipRules` to generate the zip files.
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
# 4. You can test locally by replacing the url by the file path of the generated zip
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
Packages = Google, https://github.com/mui/material-ui/raw/master/docs/writing-rules.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have no guarantees that master is the active branch:

Suggested change
Packages = Google, https://github.com/mui/material-ui/raw/master/docs/writing-rules.zip
Packages = Google, https://github.com/mui/material-ui/raw/HEAD/docs/writing-rules.zip

handled in #3293.


[*.md]
# Ignore code injection which start with {{...
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
BlockIgnores = {{.*

# Custom syle
BasedOnStyles = writing-rules



# Google:
Google.FirstPerson = YES # Avoid first-person pronouns such as I, me, ...'.
Google.GenderBias = YES # Avoid gendered profession
Google.OxfordComma = YES
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
Google.Quotes = YES # Commas and periods go inside quotation marks.
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
Google.Spelling = YES #In general, use American spelling (word ending with 'nised' or 'logue')
bharatkashyap marked this conversation as resolved.
Show resolved Hide resolved
Google.We = YES # Try to avoid using first-person plural
Google.Latin = YES # Try to avoid latin expressions e.g. and i.e.

Loading