Giter Club home page Giter Club logo

spellcheck-action's Introduction

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 ๐Ÿ‘ˆ

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.

spellcheck-action's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar fdawgs avatar lucaslarson avatar mikerogers0 avatar ollymid avatar pistasjis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ollymid syllogy

spellcheck-action's Issues

Cleanup readme

remove:

๐Ÿ‘‰ If you'd like to use this Action without having to add any files to your repository, consider the Typo CI GitHub App ๐Ÿ‘ˆ

since the app has been removed

duplicatable is spelled wrong

are those things really typos?
i'm not a native speaker but quick google search tells me it's kinda a legit word and a thing.

image

How to add another dictionary?

Lots of frontend in our application is in dutch language, thus we receive a bunch of spelling mistakes as those words are unknown. Is there any chance to add a dutch dictionary, otherwise this becomes useless to us

image

TypoCI is a typo, apparently

I got this in a repo, I know i can just use the .typo-ci.yml to exclude this but it should be fixed upstream.

Dictionary usage and config file location

Hi @MikeRogers0,

Surprisingly we were in the same year in the SoC at UoP, though i studied Computing so we probably didn't share many modules after the first year!

Anyway, really useful action however I have a few questions surrounding usage:

  • The documentation mentions development languages here, do those need to be included under dictionaries: in the .yml file or are they already included by default?
  • Any chance of moving the default location of .typo-ci.yml from the root to .github/typo-ci.yml to be with the other github action config files like dependabot.yml etc, or for the action to look for the file in one place or the other?

Thanks!

Words in excluded_words being flagged as typos

Hi @MikeRogers0,

Not sure if this is just me configuring it incorrectly.
I'm using the following in my repos, located in .github/.typo-ci.yml, with the TypoCI GitHub App (not within a workflow job):

dictionaries:
    - en
    - en_GB
    - javascript

# Any files/folders we should ignore?
excluded_files:
    - ".github/.typo-ci.yml"
    - "node_modules/**/*"
    - "yarn.lock"

# Any typos we should ignore?
excluded_words:
    - fastify
    - fhir
    - hl7
    - nhs

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

During pull requests it will flag fastify and fastify-plugin as potential typos, even though it's in the array of excluded_words.
Example here: https://github.com/Fdawgs/fastify-disablecache/pull/2/checks?check_run_id=1687500011

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.