Skip to content
Merged

Add Vale #11258

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d0b897b
Add Vale config
dbreseman May 26, 2026
e3afa81
Disable Vale check on some files
dbreseman May 26, 2026
50c52b2
Gitignore the Vale Microsoft styles
dbreseman May 26, 2026
8244ff0
Add GH action
dbreseman May 26, 2026
22c6730
Add readmes and setup guide
dbreseman May 27, 2026
d37d32f
Update scopes and actions
dbreseman May 27, 2026
da795e2
Update foreign.yml quick fix
dbreseman May 27, 2026
cf21716
Add capitalization terms
dbreseman May 27, 2026
721311b
Update vale.ini for foreign.yml
dbreseman May 27, 2026
0cb989f
Troubleshoot list intros
dbreseman May 28, 2026
2417392
Revert vale-off in claude.md
dbreseman May 28, 2026
1f0f75e
Update readme and setup guide
dbreseman May 28, 2026
605939d
Update based on feedback
dbreseman May 28, 2026
119e47d
Merge branch 'development' into db-vale
dbreseman May 29, 2026
73f07a7
Clarify readme
dbreseman May 29, 2026
c875d63
Update Action
dbreseman May 29, 2026
15a51e0
Fix min alert level syntax
dbreseman May 29, 2026
66fdb29
Add known issue
dbreseman May 29, 2026
622b6c1
Add link fields
dbreseman May 29, 2026
18769d5
Add troubleshooting instruction
dbreseman May 29, 2026
0863920
Minor rule updates
dbreseman Jun 1, 2026
0b14f5a
Merge branch 'development' into db-vale
dbreseman Jun 1, 2026
3bd0832
Add end-user
dbreseman Jun 2, 2026
3ea4e49
Add acronyms
dbreseman Jun 2, 2026
9842c51
Add configuration detail to setup guide
dbreseman Jun 3, 2026
1c0f6b4
Remove forwards (false positive)
dbreseman Jun 3, 2026
0c53345
Adjust severity
dbreseman Jun 3, 2026
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/vale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Vale Linting

# Trigger on PRs that change Markdown files
on:
pull_request:
paths:
- 'content/en/docs/**/*.md'

# Allow reading repo contents and posting PR comments
permissions:
contents: read
pull-requests: write

jobs:
vale:
# Only run on Mendix repo, not forks, and not on draft PRs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this mean it won't run on developer-submitted PRs?
Would it be better to run it on all PRs that target development?
Perhaps we can extend it to that if it is successful?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, and you're right—this will only include internal PRs rather than all PRs that target development. I think let's plan to expand it in a week if we're happy with how it's going?

if: github.repository_owner == 'mendix' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
# Cancel old runs when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Run Vale
uses: vale-cli/vale-action@v2
with:
files: '.' # Check all changed files in the PR
version: 3.14.2
fail_on_error: false
reporter: github-pr-review
vale_flags: '--minAlertLevel=error' # Only flag errors, not warnings or suggestions
filter_mode: diff_context # Only check around changed lines, not entire files
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ hugo.exe
/.claude/audit.log
/.claude/settings.local.json
/.mcp.json
/.vale/styles/Microsoft/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this something that the Vale package creates itself?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes! It's the Microsoft package from Vale: https://github.com/vale-cli/packages#available-styles


# For Mac users
.DS_Store
Expand Down
106 changes: 106 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Vale configuration for Mendix documentation
# See: https://vale.sh/docs/topics/config/

StylesPath = .vale/styles
MinAlertLevel = suggestion

# Packages to sync from vale.sh
# Microsoft = Microsoft Writing Style Guide
Packages = Microsoft

# Ignore patterns
[*.{md,mdx}]
# Ignore code blocks
BlockIgnores = (?s) *```(?:[\w\{\}]+)?$(.+?)^ *```
# Ignore front matter (YAML blocks at start of file), anchor IDs in headings, and Hugo shortcodes
# Rules can use explicit scope lists (paragraph, heading, list, table, blockquote) to exclude this content
TokenIgnores = (\A---\s*\n(.|\n)+?\n---\s*\n), (\{#[^\}]+\}), (\{\{[^\}]+\}\})

# Markdown files use both Microsoft and custom Mendix styles
BasedOnStyles = Microsoft, Mendix

# ============================================================================
# Microsoft Style Guide Rule Overrides
# ============================================================================
# The following rules are disabled or adjusted to align with Mendix style guide
# requirements documented in content/en/docs/community-tools/contribute-to-mendix-docs/style-guide/

# Acronyms
# Microsoft requires title case for acronym definitions; Mendix allows sentence case too
# Replacement: Mendix.Acronyms accepts sentence-case definitions
Microsoft.Acronyms = NO

# Contractions
# Microsoft requires contractions; Mendix prohibits them
# Mendix style guide: "Do not use contractions. Write 'it is' and not 'it's.'"
Microsoft.Contractions = NO

# Dashes
# Microsoft removes all spaces around em/en dashes; Mendix has context-specific rules
# Mendix style guide: Em dashes (—) have no spaces; en dashes (–) have spaces except in number ranges
# Replacement: Mendix.Dashes enforces en dash spacing in number ranges and between words
# Mendix.ListIntroductions enforces en dashes (not em dashes) for list item introductions
Microsoft.Dashes = NO

# Foreign
# Microsoft's i.e./e.g. replacements remove spacing incorrectly when applied as quick fixes
# Replacement: Mendix.Foreign provides correct spacing and punctuation in replacements
Microsoft.Foreign = NO

# General URL
# Microsoft prefers "address" over "URL"; Mendix does not
Microsoft.GeneralURL = NO

# Heading Acronyms
# Microsoft prohibits acronyms in headings; Mendix does not
Microsoft.HeadingAcronyms = NO

# Heading Capitalization
# Microsoft suggests sentence-style; Mendix requires title case
# Mendix style guide: "Use title case for titles and headings"
# Replacement: Mendix.HeadingTitleCase enforces title case capitalization
Microsoft.Headings = NO

# Heading Punctuation
# Microsoft prohibits all end punctuation; Mendix allows question marks
# Replacement: Mendix.HeadingPunctuation prohibits periods, exclamation marks, and colons but allows question marks
Microsoft.HeadingPunctuation = NO

# Passive
# Too many that don't need changes
Microsoft.Passive = NO

# Plurals
# Reduce severity to warning because some UI labels (e.g., "**Commit object(s)**" generate false positives)
Microsoft.Plurals = warning

# Quotes
# Reduce severity to warning because punctuation is meant to be part of the quoted material in some technical writing use cases
Microsoft.Quotes = warning

# Spacing
# Technical content like **StationConnector.Administrator** triggers false positives
Microsoft.Spacing = NO

# Terms
# Too far off from Mendix terminology guidance
Microsoft.Terms = NO

# Vocab
# Too far off from Mendix terminology guidance
Microsoft.Vocab = NO

# ============================================================================
# Path-Specific Overrides
# ============================================================================

# First-Person Plural
# Release notes allow first-person plural "we"
[content/en/docs/releasenotes/*.md]
Microsoft.We = NO

# Product Names
# Disable deprecated product name checks in historical documentation
# These versions used older terminology that may have been accurate at the time
[content/en/docs/{refguide8,refguide9,refguide10,howto8,howto9,howto10}/**/*.md]
Mendix.ProductNames = NO
54 changes: 54 additions & 0 deletions .vale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Vale Configuration for Mendix Documentation

[Vale](https://vale.sh/docs/) lints the documentation with both Microsoft Writing Style Guide rules and custom Mendix rules to catch style violations, grammar issues, and terminology inconsistencies. It matches text against patterns and rules defined in the .vale/styles YAML files, providing deterministic feedback based on these configurable rules.

It applies in the following contexts:

* **GitHub PRs**: Runs automatically on PRs marked "Ready for review" and posts inline comments on changed lines. Only shows errors (warnings and suggestions are hidden).
* **Local**: Install Vale for immediate, offline feedback in VS Code while editing. Shows all levels: suggestions, warnings, and errors.

Need to install Vale? See [SETUP.md](/.vale/SETUP.md) for installation steps.

## File Structure

```
.vale.ini # Main configuration
.vale/
styles/
Microsoft/ # Synced from vale.sh (gitignored)
Mendix/ # Custom rules (committed to Git)
*.yml # Mendix-specific style rules
RULES.md # Complete list of Mendix custom rules and overrides
README.md # Rule documentation
```

## What the Rules Check

Vale is configured to enforce both general writing best practices and Mendix-specific standards:

* **Microsoft Style Guide rules**: Grammar, punctuation, readability, inclusive language, and general technical writing conventions
* **Mendix custom rules**: Product terminology, capitalization standards, forbidden phrases, link formatting, and documentation-specific patterns

Rules are categorized by severity:
* **Suggestions**: Recommendations that improve clarity but aren't mandatory
* **Warnings**: Style violations that should be fixed before merging
* **Errors**: Critical issues that must be resolved

Each rule uses an `action` type to define what it checks:

* `suggest`: Offers alternative phrasing or improvements
* `replace`: Identifies text to replace with specific alternatives
* `remove`: Flags text to delete (for example, redundant words)
* `existence`: Detects the presence of forbidden patterns or phrases
* `substitution`: Finds patterns and suggests substitutions
* `occurrence`: Checks for repeated or missing patterns
* `conditional`: Applies rules based on context

For a complete list of custom Mendix rules and overrides, see [Custom Mendix Rules](/.vale/styles/Mendix/RULES.md).

## Read More

* [Vale Documentation](https://vale.sh/docs/)
* [Microsoft Style Guide Package](https://github.com/errata-ai/Microsoft)
* [Vale Rule Syntax](https://vale.sh/docs/topics/styles/)
* [Custom Mendix Rules](/.vale/styles/Mendix/RULES.md)
73 changes: 73 additions & 0 deletions .vale/SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Vale Setup Guide

Vale is configured but not yet installed. This guide walks you through setup.

## Why Install Locally?

* **Immediate feedback** - See violations as you write, not after pushing
* **Faster iteration** - Fix issues before creating a PR
* **More feedback** - See suggestions and warnings locally; the GitHub Action is configured to only show errors

**Note:** Even without local installation, your PRs will be checked automatically by a GitHub Action: [.github/workflows/vale.yml](../.github/workflows/vale.yml).

## Installation (Choose One)

### For macOS

1. Download [Homebrew](https://brew.sh/) if you don't already have it.
2. In your terminal, run the following command:

```bash
brew install vale
```

### For Windows

1. On https://github.com/vale-cli/vale/releases, download the Windows version from Assets
2. Right-click the zip file and select **Extract All**
3. Open PowerShell and run:

```powershell
# Create a bin directory for your tools
mkdir $HOME\bin -Force

# Move vale.exe there (adjust the path if you extracted it elsewhere)
Move-Item $HOME\Downloads\vale_*_Windows_64-bit\vale.exe $HOME\bin\

# Add to PATH
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$currentPath;$HOME\bin", "User")
```

## Post-Installation

After installing Vale:

1. **Verify the installation worked:**

```bash
vale --version
```

2. **Sync the Microsoft Style Guide rules:**

Switch to the docs directory (`cd docs`), then run:

```bash
vale sync
```

This downloads Microsoft's style pack to `.vale/styles/Microsoft/`.

If you get a `Runtime error: No sources provided` error, verify that there is a `.vale.ini` file in the root of the docs repository (and that you are also in the root of the docs repository).

3. **Install VS Code extension:**
- Install the [Vale VS Code extension](https://marketplace.visualstudio.com/items?itemName=ChrisChinchilla.vale-vscode).
- Restart VS Code.
- Open any `.md` file in `content/en/docs/`.
- Violations show as squiggly underlines in the file and appear in the **Problems** tab in the bottom pane.
- Many Vale rules support automatic fixes—hover over an underlined issue and click **Quick Fix** or click the lightbulb icon next to flagged text in the **Problems** tab.
- Save changes to rerun the linter.
- If desired, you can adjust the extension's settings in VS Code to show a different minimum alert level. For example, if you set `minAlertLevel` to `warning`, it will only report warnings and errors, not suggestions.

4. **If you have open PRs:** Merge `development` into your branch to get the Vale configuration files.
76 changes: 76 additions & 0 deletions .vale/styles/Mendix/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
extends: conditional
message: "Define '%s' on first use."
link: https://docs.mendix.com/community-tools/contribute-to-mendix-docs/style-guide/grammar-formatting/#acronyms-and-initialisms
level: suggestion
ignorecase: false
scope:
- paragraph
- heading
- list
- table
- blockquote
# Ensures that the existence of 'first' implies the existence of 'second'.
# Known issue: Doesn't recognize hyperlinks for acronym definitions
# Modified from Microsoft.Acronyms to accept sentence-case definitions (e.g., "personal access token (PAT)" not just "Personal Access Token (PAT)")
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Za-z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I presume this also covers jar and zip which I tend to see in lowercase.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, those won't be flagged—the regex only matches capitalized acronyms, so anything lowercase will just slip through.

- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DOM
- DPI
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we have MDA and MPR here? The acronyms don't actually make much sense (even if you can remember what they are). Are there any other Mendix acronyms which don't need explaining?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll add those. I'm sure we will come up with more acronyms to add as we go along, so this will be a growing list.

- MDA
- MPR
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- REPL
- REST
- RSA
- SAP
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
Loading
Loading