danger-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
- Clone this repo
- Run
bundle install
to setup dependencies. - Run
bundle exec rake spec
to run the tests. - Use
bundle exec guard
to automatically have tests run as you make changes. - Make your changes.