Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/TypoCI/spellcheck-action

GitHub Action for checking code & Pull Requests for spelling mistakes
https://github.com/TypoCI/spellcheck-action

actionshackathon code-quality docker github-action ruby

Last synced: 3 months ago
JSON representation

GitHub Action for checking code & Pull Requests for spelling mistakes

Awesome Lists containing this project

README

        


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


Typo CI - Spellcheck Action


Checks for spelling mistakes within code via a GitHub Action



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](https://github.com/marketplace/typo-ci/) 👈**

## Installation

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

```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:

```yml
# 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](https://github.com/TypoCI/spellcheck-action/tree/master/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](https://github.com/en-wl/wordlist) and they are stored in [db/dict/imported](https://github.com/TypoCI/spellcheck-action/tree/master/db/dict/imported).

Other languages have been imported via NPM from [wooorm/dictionaries](https://github.com/wooorm/dictionaries).

## Testing

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