0.02
Repository is archived
No release in over a year
Danger plugin for textlint.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 2.14
>= 0
~> 13.0
~> 3.4
>= 0
~> 0.10.0
= 3.7.1

Runtime

 Project Readme

danger-textlint

Gem Version

Danger plugin for textlint.

Installation

$ gem install danger-textlint

danger-textlint needs textlint to lint your files. Please check the installation guide and install it before you run Danger.

danger-textlint will first try local node_modules/.bin/textlint then the global textlint.
My recommend is installing textlint in local. Create package.json (npm init) and then install (npm i textlint).

Usage

Run textlint and send violations as inline comment.
# Lint added and modified files only
textlint.lint
Keep severity until warning. It allows merging pull request if there are violations remaining.
textlint.max_severity = "warn"
textlint.lint

Attributes

config_file - .textlintrc path

max_severity - Set max danger reporting severity choice: nil or "warn"

Methods

lint - Execute textlint and send comment

Usage(Github Actions)

Puts this code into your .github/workflows/

name: "textlint"
on:
  pull_request:

jobs:
  textlint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Setup node version
      uses: actions/setup-node@v2
      with:
        node-version: '14'
        cache: 'npm'
    - run: npm ci

    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3
        bundler-cache: true
    - run: bundle exec danger
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.