[code-infra] Use vale rules from code-infra package by brijeshb42 · Pull Request #48173 · mui/material-ui (original) (raw)
brijeshb42 added the scope: code-infra
Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).
label
| ``` |
|---|
| ### Testing |
| ### Testing JSDOM |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just to check the error reporting. But since the workflow change is in this PR, it only gets read-only token. So vale cant add annotations to the PR.
Once this PR gets merged, annotation will get added inline.
| if: ${{ matrix.os == 'ubuntu-latest' }} |
|---|
| id: vale-inputs |
| run: | |
| echo "files=$(git ls-files '*.md' '*.mdx' | paste -sd ',' -)" >> $GITHUB_OUTPUT |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do this, vale traverses the whole directory tree, including node_modules and breaks when it encounters symlinks. Even its glob flag doesnt work.
We could also update this to only consider the changed md files in the PR and not all md files.
run: | if [ "${{ github.event_name }}" = "pull_request" ]; then FILES=$(git diff --name-only --diff-filter=ACMR ${{ github.event.pull_request.base.sha }}..HEAD -- '.md' '.mdx' | paste -sd ',' -) else FILES=$(git ls-files '.md' '.mdx' | paste -sd ',' -) fi echo "files=$FILES" >> $GITHUB_OUTPUT echo "version=$(node -p 'require("./package.json").mui.valeVersion')" >> $GITHUB_OUTPUT
| "version": "9.0.0-beta.0", |
|---|
| "private": true, |
| "mui": { |
| "valeVersion": "3.12.0" |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not automatically update through renovate. So we can either keep it as-is (update manually or through custom renovate manager) or add @vvago/vale as a devDepedency back insted of the current pnpm dlx based usage.
| # Required, set by GitHub actions automatically: |
|---|
| # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github\_token-secret |
| token: ${{secrets.GITHUB_TOKEN}} |
| version: ${{ steps.vale-inputs.outputs.version }} |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without flags, it logs warnings as well. So we can pass flags to filter based just on errors similar to what we do in pnpm valelint - vale --filter='.Level==\"error\"'
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates Vale configuration/rules to consume the shared rules shipped from @mui/internal-code-infra, removing the in-repo docs/mui-vale rules bundle and wiring Vale into the main CI workflow.
Changes:
- Point Vale’s
.vale.inito use rules from@mui/internal-code-infrainstead ofdocs/mui-vale.zip. - Remove the
docs/mui-valerule sources and the dedicatedvale-action.ymlworkflow. - Add Vale execution to
.github/workflows/ci.ymland centralize the Vale CLI version inpackage.json.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds a central mui.valeVersion and updates valelint; switches @mui/internal-code-infra to a pkg.pr.new URL. |
| pnpm-lock.yaml | Updates lockfile entries to match the @mui/internal-code-infra source change. |
| .vale.ini | Switches Vale package source from docs/mui-vale.zip to @mui/internal-code-infra. |
| .github/workflows/ci.yml | Runs Vale as part of CI (Ubuntu leg) and adjusts job permissions. |
| .github/workflows/vale-action.yml | Removes the standalone Vale workflow. |
| docs/mui-vale/** (multiple deletions) | Removes the previously vendored MUI Vale rules/styles and related config. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines +47 to +56
| - name: Collect Vale inputs |
|---|
| if: ${{ matrix.os == 'ubuntu-latest' }} |
| id: vale-inputs |
| run: | |
| echo "files=$(git ls-files '*.md' '*.mdx' | paste -sd ',' -)" >> $GITHUB_OUTPUT |
| echo "version=$(node -p 'require("./package.json").mui.valeVersion')" >> $GITHUB_OUTPUT |
| - name: Vale |
| if: ${{ matrix.os == 'ubuntu-latest' }} |
| uses: vale-cli/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1 |
| continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Vale step is added to ci.yml, but this workflow is configured with on.pull_request.paths-ignore: ['docs/**']. As a result, PRs that only touch docs/markdown won’t run this workflow, so Vale won’t run on the changes it’s meant to validate. Consider keeping Vale in a separate workflow that runs on all PRs (or at least on docs/**), or adjusting the CI/CI Check path filters so Vale still executes for docs-only PRs.
Copilot uses AI. Check for mistakes.
| "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.24", |
|---|
| "@mui/internal-bundle-size-checker": "1.0.9-canary.70", |
| "@mui/internal-code-infra": "0.0.4-canary.11", |
| "@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@d11ec04", |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mui/internal-code-infra is pinned to a pkg.pr.new preview URL. Those preview artifacts are intended for temporary testing and can become unavailable over time, which would break installs and make builds less reproducible. Please switch this back to a published version/range (e.g. the canary you had before) and only use pkg.pr.new overrides locally or in short-lived test branches.
| "@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@d11ec04", |
|---|
| "@mui/internal-code-infra": "workspace:^", |
Copilot uses AI. Check for mistakes.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a specific reason to move this from circle to GHA?
Was there a specific reason to move this from circle to GHA?
Both had it actually. Circle has general linting and github has linting with code annotations through the cake action. If we don't need the annotation, we can just keep the circle ci one.
Right, I see. I don't find them particularly useful, but maybe someone on the team?
We can do a team poll to validate if we need it or not. I am assuming it'll help devex team.
Both had it actually. Circle has general linting and github has linting with code annotations
Correct.
I think both are important: It's about the rule that are warning. Rules that are error should break the CI, so easy, only Circle CI, but warnings go silent if they are not shown in the Code diff view as annotations.
This was referenced
Apr 29, 2026
JCQuintas added a commit to JCQuintas/mui-x that referenced this pull request
JCQuintas added a commit to JCQuintas/mui-x that referenced this pull request
This file contains hidden or 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
[ Show hidden characters]({{ revealButtonHref }})