Back to directory
TypoCI avatar
TypoCI / spellcheck-action

spellcheck-action

GitHub Action for checking code & Pull Requests for spelling mistakes

43

Stars

3

Forks

1

Watchers

MIT

License

Typo CI Logo - It's a sword surrounded by brackets

Typo CI - Spellcheck Action

Checks for spelling mistakes within code via a GitHub Action

MikeRogers0 RSpec passing

👉 If you'd like to use this Action without having to add any files to your repository, consider the Typo CI GitHub App 👈

Installation

Copy add the following to .github/workflows/spellcheck.yml:

# Add to: .github/workflows/spellcheck.yml
name: Typo CI

on:
  push:
    branches-ignore:
      - master
jobs:
  spellcheck:
    name: Typo CI (GitHub Action)
    runs-on: ubuntu-latest
    timeout-minutes: 4
    if: "!contains(github.event.head_commit.message, '[ci skip]')"
    steps:
    - name: TypoCheck
      uses: typoci/spellcheck-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

You can tweak how Typo CI analyses your code by adding a .typo-ci.yml file to the root of your repository (You can also add it within your .github folder). Here is a sample file:

# This is a sample .typo-ci.yml file, it's used to configure how Typo CI will behave.
# Add it to the root of your project and push it to github.
---

# What language dictionaries should it use? By default Typo CI will select 'en' & 'en_GB'
# Currently Typo CI supports:
# de
# en
# en_GB
# es
# fr
# it
# nl
# pt
# pt_BR
# tr
dictionaries:
  - en
  - en_GB

# Any files/folders we should ignore?
excluded_files:
  - "vendor/**/*"
  - "node_modules/**/*"
  - "*.key"
  - "*.enc"
  - "*.min.css"
  - "*.css.map"
  - "*.min.js"
  - "*.js.map"
  - "*.mk"
  - "package-lock.json"
  - "yarn.lock"
  - "Gemfile.lock"
  - ".typo-ci.yml"
  - ".github/.typo-ci.yml"

# Any words we should ignore?
excluded_words:
  - typoci

# Would you like filenames to also be spellchecked?
spellcheck_filenames: true

Dictionaries

Development Languages

To help the spell checker detect words that are valid in the programming world, I've created a collection of language specific dictionaries which are stored in db/dict/contextual.

These are pragmatically generated by analysing open source projects.

Spoken Language Dictionaries

The en, en_GB & pt_BR dictionaries were built from https://github.com/en-wl/wordlist and they are stored in db/dict/imported.

Other languages have been imported via NPM from wooorm/dictionaries.

Testing

  • Run docker-compose run --rm web bin/setup & docker-compose run --rm web rspec.

Releases

Apr 28, 2021

1.1.0

Download .zip

Merged pull requests:

Removing Sentry Raven #127 (MikeRogers0) Using CSpell dictionaries over relying on maintaining my own #126 (MikeRogers0) Allowing the use of .github/.typo-ci.yml #124 (MikeRoger...

Apr 7, 2021

1.0.0

Download .zip

Merged pull requests:

Ranking Experiment: Starting the Action Name with A #121 (MikeRogers0) Adding currencies to word list #120 (MikeRogers0) Removing license requirements & switching to MIT #119 (M...

Mar 25, 2021

0.4.0

Download .zip

Adding support for Dutch (nl) language #115 (MikeRogers0) Bumping mimemagic to latest #114 (MikeRogers0) Adding cron, cronjob & typoci words #113 (MikeRogers0) build(docker): quote command expansion #...

Dec 16, 2020

0.3.0

Download .zip

This updates to Ruby 2.7.2 along with bumping all the libraries to their latest version.

Aug 17, 2020

0.2.0

Download .zip

I managed to get the build time down from 1 minute to a few seconds using a prebuilt docker image.