Skip to content

[Feature Request]: Add a reusable “text-quality” workflow for spelling, grammar & style checks #189

@tyrann0us

Description

@tyrann0us

Is your feature request related to a problem?

It is frustrating when typos, misspellings, or small grammatical slips sneak through code reviews and end up in user-facing strings, documentation, or comments.
Manually checking these errors and writing suggestions is very time-consuming, so reviewers have less time for the actual code review. Therefore, often no attention is paid to text quality at all.

Describe the desired solution

Please add a text-quality.yml (or similar) reusable workflow (and companion docs) that can be dropped into any consuming repo with uses: inpsyde/reusable-workflows/.github/workflows/text-quality.yml@main.

Suggested features:

  1. Fast typo scan – run Typos (https://github.com/crate-ci/typos) over the entire tree on every PR.
  2. AST-aware spell-check – run CSpell (https://github.com/streetsidesoftware/cspell-action) on source files to catch mistakes in identifiers, string literals, and comments while recognising domain-specific names.
  3. Optional grammar/style pass – expose a RUN_GRAMMAR_JOB boolean input that, when true, launches a second job with LanguageTool via https://github.com/reviewdog/action-languagetool (Markdown & TXT only).
  4. Outputs – surface annotations inline on PRs and fail the job on errors so the calling repo can decide whether to block merges (continue-on-error default false).

Describe the alternatives that you have considered

Describe the alternatives that you have considered

  • Vale – powerful but heavier to configure; requires organisation-wide style guides.
  • Codespell – simple, but its opinionated dictionary causes more false positives in WordPress/PHP projects than Typos.
  • check-spelling – great learning mode, yet adds per-repo maintenance overhead and slower first-run times.

Additional context

Below is a minimal outline that could live inside text-quality.yml; inputs and caching are omitted for brevity (untested!):

name: text-quality
on:
  workflow_call:
    inputs:
      RUN_GRAMMAR_JOB:
        description: "Run LanguageTool grammar job"
        required: false
        default: false
jobs:
  spelling:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: crate-ci/typos-action@v1
        with:
          files: "**"
          write_changes: false

      - uses: streetsidesoftware/cspell-action@v7
        with:
          files: "**/*.{php,js,ts,tsx,md}"
          config: .github/cspell.json
  grammar:
    if: ${{ inputs.RUN_GRAMMAR_JOB == 'true' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: reviewdog/action-languagetool@v1
        with:
          reporter: github-pr-check
          patterns: "**/*.{md,txt}"
          language: en-US

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions