Skip to content

Commit afc6067

Browse files
authored
[code-infra] Use vale rules from code-infra package (#48173)
1 parent 32978b5 commit afc6067

14 files changed

Lines changed: 35 additions & 266 deletions

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2.1
22
orbs:
3-
code-infra: https://raw.githubusercontent.com/mui/mui-public/3feee347096f50b441cad3087743bd1c5aef8651/.circleci/orbs/code-infra.yml
3+
code-infra: https://raw.githubusercontent.com/mui/mui-public/12844f2b6b11babab17bd3d1f799359ea25d1db7/.circleci/orbs/code-infra.yml
44
aws-cli: circleci/aws-cli@5.4.1
55
aws-s3: circleci/aws-s3@4.1.3
66

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
os: [macos-latest, windows-latest, ubuntu-latest]
3030
permissions:
3131
contents: read
32+
pull-requests: write
3233
steps:
3334
- run: echo '${{ github.actor }}'
3435
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -66,3 +67,27 @@ jobs:
6667
- name: Debug export-detail.json on when pnpm docs:build fails with EMFILE error
6768
if: failure()
6869
run: cat ./docs/.next/export-detail.json || true
70+
- name: Extract Vale version
71+
if: ${{ matrix.os == 'ubuntu-latest' }}
72+
id: vale-version
73+
run: |
74+
VERSION=$(node -p "(require('./package.json').config && require('./package.json').config.valeVersion) || ''")
75+
echo "vale_version=$VERSION" >> $GITHUB_OUTPUT
76+
- name: Cache Vale binary
77+
if: ${{ matrix.os == 'ubuntu-latest' }}
78+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
79+
with:
80+
path: node_modules/.cache/mui-vale
81+
key: ${{ runner.os }}-mui-vale-${{ steps.vale-version.outputs.vale_version }}
82+
- uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
83+
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
84+
if: ${{ matrix.os == 'ubuntu-latest' }}
85+
with:
86+
version: ${{ steps.vale-version.outputs.vale_version }}
87+
# Errors should be more visible
88+
fail_on_error: true
89+
# The other reports don't work, not really https://github.com/reviewdog/reviewdog#reporters
90+
reporter: github-pr-check
91+
# Required, set by GitHub actions automatically:
92+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
93+
token: ${{secrets.GITHUB_TOKEN}}

.github/workflows/vale-action.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.vale.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
StylesPath = .github/styles
33
MinAlertLevel = warning
44

5-
# To update mui-vale package:
6-
# 1. Go to the docs folder
7-
# 2. Update/create YAML files
8-
# 3. Run `pnpm docs:zipRules` to generate the zip files
9-
# 4. You can test locally by replacing the url with the file path of the generated zip
10-
Packages = Google, docs/mui-vale.zip
5+
Packages = Google, ./node_modules/@mui/internal-code-infra/vale
116

127
[formats]
138
mdx = md

docs/mui-vale.zip

-4.67 KB
Binary file not shown.

docs/mui-vale/.vale.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/mui-vale/styles/MUI/CorrectReferenceAllCases.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/mui-vale/styles/MUI/CorrectRererenceCased.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/mui-vale/styles/MUI/GoogleLatin.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/mui-vale/styles/MUI/MuiBrandName.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)