0.0
The project is in a healthy, maintained state
Danger plugin for typos.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

danger-typos

Danger plugin for typos.

Installation

$ gem install danger-typos

typos also needs to be installed before you run Danger.

Usage

Add this to Dangerfile.

typos.run

If you want to specify typos bin file, you can set a bin path to the binary_path parameter.

typos.binary_path = "path/to/typos"
typos.run

To use a custom config file, set the config_path parameter.

typos.run config_path: "_typos.toml"

Example

GitHub actions

name: Danger

on: [pull_request]

jobs:
  danger:
    runs-on: ubuntu-latest
    if: github.event_name  == 'pull_request'
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.4
        bundler-cache: true

    - name: Install typos
      uses: baptiste0928/cargo-install@v3
      with:
        crate: typos-cli
        version: 1.30.1

    - run: bundle exec danger
      env:
        DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GitHub actions

directly install typos from binary

name: Danger

on: [pull_request]

jobs:
  danger:
    runs-on: ubuntu-latest
    if: github.event_name  == 'pull_request'
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.4
        bundler-cache: true

    - name: Install typos
      run: |
        wget https://github.com/crate-ci/typos/releases/download/v1.30.1/typos-v1.30.1-x86_64-unknown-linux-musl.tar.gz
        tar xf typos-v1.30.1-x86_64-unknown-linux-musl.tar.gz
        mkdir -p $HOME/.cargo/bin
        mv typos $HOME/.cargo/bin/
        echo "$HOME/.cargo/bin" >> $GITHUB_PATH
        typos --version

    - run: bundle exec danger
      env:
        DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}