Skip to content

Vale.sh Integration

Francisco Cabrera edited this page Jan 19, 2024 · 4 revisions

This repository uses vale.sh to help tech writers and contributors adhere to Microsoft's writing styling guidelines. Vale is a command-line tool that allows you to check your writing for grammar and spelling errors against a set of style rules.

Vale configuration

To use Vale linting in this project, the repository has already been configured with the .vale.ini file, which contains the rules to check against. For more information about these rules, see Vale configuration.

This repository is configured to follow the Microsoft Styling Guide. Styling configuration can be found at styles/Microsoft.

Vale cli locally

To use the Vale cli locally, you must install the vale-cli. Once installed, using the Terminal, move to the parent folder of the document you want to check. Finally, run the command vale <name-of-file>.md to apply the linter to the document and get the detailed report. cli-local terminal

Vale with WSL

To use the Vale cli locally with WSL, you must install the vale-snap using the following command: sudo snap install vale --edge.

Vale + Visual Studio Code Integration

To integrate Vale with Visual Studio Code, you can use the Vale VSCode extension. Follow the steps below to complete the Vale installation and use the extension:

  1. Install the vale.sh cli.
  2. Open Visual Studio Code and click on the Extensions icon on the left-hand side of the window to navigate to the Extensions Marketplace.
  3. Search for "Vale VSCode" in the search bar and install the extension by clicking the "Install" button.
  4. After installation, restart the Visual Studio Code instance.
  5. Ensure that you have a Vale configuration available within your project. Configuration should be already created under docs\.vale.ini.
  6. Start using Vale to lint your content. Open a file in Visual Studio Code and Vale.sh will run automatically. Any errors or warnings will be displayed in the Problems output tab at the bottom of the Visual Studio Code window.

Vale VSCode

Vale CI Integration

Every time a contributor creates a pull request, the vale-action is triggered to check the modified content. This allows reviewers to surface errors easily. A report is automatically generated, and all errors must be fixed before the pull request can be merged.

Vale CI Integration