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 11 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
4 changes: 1 addition & 3 deletions .changeset/salty-tools-carry.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

Cleanup of several tree and schema alpha APIs for content import and export

Check failure on line 7 in .changeset/salty-tools-carry.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'APIs'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'APIs'?", "location": {"path": ".changeset/salty-tools-carry.md", "range": {"start": {"line": 7, "column": 42}}}, "severity": "ERROR"}

A new `TreeSchema` type has been introduced which extends `SimpleTreeSchema` but contains `TreeNodeSchema` instead of `SimpleNodeSchema`.

Expand Down
4 changes: 1 addition & 3 deletions .changeset/true-doors-ring.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
"@fluidframework/container-loader": minor
---
---
"section": feature
"__section": feature
---

Blobs in Detached Container Supported by Default

It is no longer necessary or supported to provide `detachedBlobStorage` to the Loader. This functionality is now provided by default, and the deprecated `IDetachedBlobStorage` will be removed in the 2.40.0 release.
The new behavior can be disabled by setting `Fluid.Container.MemoryBlobStorageEnabled` to `false`. This flag will also be removed in the 2.40.0 release if no issues are reported.

Check warning on line 9 in .changeset/true-doors-ring.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Microsoft.Accessibility] Don't use language (such as 'disabled') that defines people by their disability. Raw Output: {"message": "[Microsoft.Accessibility] Don't use language (such as 'disabled') that defines people by their disability.", "location": {"path": ".changeset/true-doors-ring.md", "range": {"start": {"line": 9, "column": 25}}}, "severity": "INFO"}
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 issues 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@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
1 change: 1 addition & 0 deletions .vale/config/vocabularies/fluid/reject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shared tree
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.10.0",
"auto-changelog": "^2.4.0",
"c8": "^8.0.1",
"changesets-format-with-issue-links": "^0.3.0",
Expand Down
Loading
Loading