Git Product home page Git Product logo

datadog-vale's Introduction

Overview

The Datadog Documentation team implements, maintains, and owns a style guide utilizing the Vale Linter. This repository contains a set of linting rules for Vale based on the Documentation Style Guide.

Setup

  1. Clone this repository.
  2. Install Vale with brew install vale (macOS) or choco install vale (Windows).
  3. Set the StylesPath parameter to styles/Datadog in your .vale.inifile.
  4. Run vale . from the root folder of the repository, or specify a file to lint on using vale /path/to/some/directory.

Usage

Rules are stored in YAML files, and you can set Docshtml to lint on HTML, and Docsmd to lint on Markdown files in your .vale.ini file. Make sure all files are lowercase.

For example, this gender.yml rule raises an error when Vale detects a gendered pronoun in a Markdown file:

extends: existence
message: "Use a gender-neutral pronoun instead of '%s'."
link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#gender"
level: error
ignorecase: true
tokens:
  - he/she

The files in this repository contain settings for the Vale linter (defined in .vale.ini) and style rules published by the Datadog Docs team (defined in styles/Datadog). These can be used as a GitHub Action or locally.

GitHub Action

  1. Add the example linting.yml file to your repository's .github/workflows folder.
  2. (Optional) Update linting.yml styles and config files as necessary.
  3. (Optional) Add your custom .vale.ini file to your repository's root directory.

Example of linting with GitHub Actions:
GitHub Actions linting

Local

  1. Install Vale locally.
  2. Optional for VS Code users:
    • Install vale-vscode through the Marketplace.
    • Set vale.core.useCLI to true in the Extension Settings (Preferences > Extensions > Vale > Use CLI).
    • Restart VS Code.
  3. Download the latest release of the source code.
  4. Unzip the file to your local repository's .github/styles folder.
  5. Add a .vale.ini file to your repository's root directory.
  6. Update your .gitignore:
    # Vale
    .github/styles  # required if the repo uses GitHub Actions
    .vale.ini       # optional
    

Example of local linting with VS Code:
VS Code linting

License

Code—including sample code—in this repository is licensed under the Apache 2.0 license.

datadog-vale's People

Contributors

alai97 avatar brett0000ff avatar buraizu avatar cswatt avatar dayspringjohnson avatar drichards-87 avatar hestonhoffman avatar jhgilbert avatar kayayarai avatar marcotc avatar max-power15 avatar maycmlee avatar nbeckstead-ddog avatar rtrieu avatar ruthnaebeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.