Proofreading Text with textlint and reviewdog on CircleCI

Published: (March 15, 2026 at 07:09 AM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Overview

Automate Japanese text proofreading for documents stored in a GitHub repository using textlint, reviewdog, and CircleCI.

Directory Structure

.
├── .circleci
│   └── config.yml
├── README.md
├── documents
│   ├── はじめに.md
│   └── おわりに.md
├── images
├── .textlintrc
├── package-lock.json
└── package.json

Initial Setup

npm init -y

Install textlint and Required Rules

npm install --save-dev \
  textlint \
  textlint-rule-preset-ja-spacing \
  textlint-rule-preset-ja-technical-writing \
  textlint-rule-spellcheck-tech-word \
  textlint-rule-preset-jtf-style \
  textlint-rule-preset-japanese

.textlintrc Configuration

{
  "filters": {},
  "rules": {
    "preset-ja-spacing": true,
    "preset-ja-technical-writing": true,
    "preset-japanese": true,
    "preset-jtf-style": true,
    "spellcheck-tech-word": true
  }
}

CircleCI Configuration (.circleci/config.yml)

version: 2
jobs:
  build:
    docker:
      - image: vvakame/review:latest
        environment:
          REVIEWDOG_VERSION: latest
    steps:
      - checkout
      - restore_cache:
          keys:
            - npm-cache-{{ checksum "package-lock.json" }}
      - run:
          name: Setup
          command: npm install
      - save_cache:
          key: npm-cache-{{ checksum "package-lock.json" }}
          paths:
            - ./node_modules
      - run:
          name: Install reviewdog
          command: |
            curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh \
            | sh -s $REVIEWDOG_VERSION
      - run:
          name: Lint Japanese documents
          command: |
            "$(npm bin)/textlint" -f checkstyle documents/*.md | tee check_result
      - run:
          name: Reviewdog
          command: |
            if [ -n "$REVIEWDOG_GITHUB_API_TOKEN" ]; then
              cat check_result | ./bin/reviewdog -f=checkstyle -name=textlint -reporter=github-pr-review
            fi
          when: on_fail

How It Works

  1. textlint scans all Markdown files under documents/ and outputs results in Checkstyle format.
  2. The output is saved to check_result.
  3. reviewdog reads check_result and posts comments on the associated GitHub Pull Request (if the REVIEWDOG_GITHUB_API_TOKEN environment variable is set).

References

0 views
Back to Blog

Related posts

Read more »

Travigo

Travel as fast as you speak with Gemini! Where live agents meet immersive storytelling & 3D navigation. This project was created for entering the Gemini Live Ag...

Micro games

Hey Gamers! 👾 As part of the Rapid Games Prototyping module, we are tasked with reviewing a peer's game. The challenge is to analyse a prototype built in just...