Skip to content

build: Add vale configuration and demonstrate usage #24252

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

Merged
merged 16 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 35 additions & 0 deletions .github/workflows/pr-changeset-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "pr-changeset-review"

# This workflow runs lint-like checks against changesets in PRs. The linting tool used is called Vale. The worflow will
# add comments for any warnings or errors that Vale finds in the changeset.

# To run vale locally against changesets, you can use `pnpm run check:changesets`.

on:
pull_request:
types:
- opened # PR is created
- synchronize # commits added to PR
- reopened # closed PR re-opened
branches:
- main
paths:
- ".changeset/**" # Trigger only when changes are found under .changeset

permissions:
pull-requests: write

jobs:
vale:
name: vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
with:
persist-credentials: false
- uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # ratchet:errata-ai/vale-action@v2.1.1
with:
files: .changeset
vale_flags: "--glob=*-*-*.md"
reporter: github-pr-review
filter_mode: nofilter
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ nyc
*.log
.DS_Store

.vale/*
!.vale/config/

.vale/config/*
!.vale/config/vocabularies/

.vale/config/vocabularies/*
!.vale/config/vocabularies/fluid/
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it enough to have .vale/** and this last line?

Copy link
Member Author

Choose a reason for hiding this comment

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

For reasons I don't understand, no. If you do that, and add a new file under .vale/config/vocabularies/fluid/, it will
still be ignored. My hunch is that it has something to do with precedence of negation and how it works with folder
paths, but I didn't dig into it. FWIW the vale docs follow this pattern and I thought it was unnecssary too.


# Generated Node10 module resolution compatibility files
alpha.d.ts
beta.d.ts
Expand Down
21 changes: 21 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
StylesPath = .vale

MinAlertLevel = suggestion

Packages = Microsoft, MDX, proselint

Vocab = fluid

[*README.md]
Microsoft.We = NO

[*.{md}]
BasedOnStyles = Vale, Microsoft, proselint

; Note that only errors will be reported in GitHub PR comments.
; This seems to be a limitation of the GitHub Action.
; When running locally, all levels will be reported.
Microsoft.Contractions = NO
Microsoft.Passive = NO
Microsoft.Terms = suggestion
Microsoft.Vocab = NO
5 changes: 5 additions & 0 deletions .vale/config/vocabularies/fluid/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fluid Framework
FluidFramework
JavaScript
SharedTree
TypeScript
3 changes: 3 additions & 0 deletions .vale/config/vocabularies/fluid/reject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shared tree
fluid
fluid framework
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"bundle-analysis:run": "flub run bundleStats --dangerfile build-tools/packages/build-cli/lib/library/dangerfile.cjs",
"changeset": "flub changeset add --releaseGroup client",
"check:are-the-types-wrong": "fluid-build --task check:are-the-types-wrong",
"check:changesets": "vale .changeset --glob=*-*-*.md",
"check:format:repo": "biome check .",
"check:versions": "flub check buildVersion -g client --path .",
"check:versions:fix": "flub check buildVersion -g client --path . --fix",
Expand Down Expand Up @@ -172,6 +173,7 @@
"@fluidframework/test-tools": "^1.0.195075",
"@microsoft/api-documenter": "^7.21.6",
"@microsoft/api-extractor": "7.50.1",
"@vvago/vale": "^3.11.2",
"auto-changelog": "^2.4.0",
"c8": "^8.0.1",
"changesets-format-with-issue-links": "^0.3.0",
Expand Down
Loading
Loading