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

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Apr 4, 2025

Vale is a lint-like tool for prose. It helps enforce style guidelines and other rules on natural-language text. The idea is to use Vale during the changeset review process to help find possible problems earlier. This will reduce the likelihood that we need to make changeset changes during a release, which can slow the release down.

This change adds a Vale config that uses the Microsoft style guide, plus some custom terms for our team to demonstrate those features.

This change also includes a GitHub Actions workflow that runs Vale on any changesets in PRs and adds comments for any issues it finds. It seems that suggestion-level issues are not added as comments. As we identify types of issues that should be caught, we can update the vale config much like we do with our linter config.

Example

To see example comments generated by the workflow, see tylerbutler#31

@github-actions github-actions bot added changeset-present dependencies Pull requests that update a dependency file base: main PRs targeted against main branch labels Apr 4, 2025
!.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.

tylerbutler added a commit that referenced this pull request Apr 7, 2025
…on (#24251)

Our custom changeset metadata is in its own separate front-matter
section. However, most tools do not recognize more than one front-matter
section, so this has not been an ideal solution when we want to use
other tools on our changesets (e.g. review tools, formatters, linting
tools, etc.).

This change condenses the fron matter into a single section, using `__`
to prefix fluid-specific properties.

We already have to remove custom metadata when producing changelogs so
that process has just been updated to remove the custom properties
rather than the second front matter section.

The motivator for this change is to make it easier to use markdown-aware
tools with our changesets. See
#24252 for an example.
@github-actions github-actions bot added the area: build Build related issues label Apr 9, 2025
@tylerbutler tylerbutler marked this pull request as ready for review April 10, 2025 22:51
@tylerbutler tylerbutler requested a review from a team as a code owner April 10, 2025 22:51
Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Should we do something now about the Vale comment about capitalizing front matter section names?

Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
@tylerbutler
Copy link
Member Author

Should we do something now about the Vale comment about capitalizing front matter section names?

I think that's an old comment related to the old changeset format. It interpreted

---
section: tree
---

As a heading becasue of the underlining - it didn't treat it as a front-matter section. With the new format it treats it as front matter.

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

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

Let's take it for a spin!

@tylerbutler tylerbutler merged commit ee24404 into microsoft:main Apr 12, 2025
33 checks passed
@tylerbutler tylerbutler deleted the vale branch April 12, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants