Vale CMS Need more than a rule playground? Explore
Home

Code & data

Vale for code and data

The prose inside files that aren’t prose: comments, API descriptions, and the log.

A repository has prose all through it that no docs linter reads: doc comments, the descriptions in an OpenAPI spec, a commit’s subject and body. Vale finds it. Tree-sitter grammars lift comments out of source code, a View pulls named fields out of JSON and YAML, and a TextFSM template splits a commit message into its parts, so a rule reaches a commit subject the way it reaches a heading.

Start with this config

Commit messages against Conventional Commits, and doc comments against their language’s conventions. Grammars has vale sync fetch the parsers that find the comments. For the descriptions in an OpenAPI spec, add the View from the Views docs.

.vale.ini

StylesPath = styles
Packages = Commits, Comments
Grammars = go, java, kotlin

[COMMIT_EDITMSG]
BasedOnStyles = Commits, Conventional

[*.{go,java,kt}]
BasedOnStyles = Vale, Comments

Then download the packages it names and run Vale over the project:

$ vale sync
$ vale .

Formats

Where this kind of writing lives. Vale parses each one, so rules see the prose and skip the markup, the code, and the URLs.