Code Monkey home page Code Monkey logo

actions-codespell's Introduction

Codespell with GitHub Actions -- including annotations for Pull Requests

This GitHub Actions runs codespell over your code. Any warnings or errors will be annotated in the Pull Request.

Usage

uses: codespell-project/actions-codespell@master

Possible use for checking the pull request

# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell

name: Codespell
on: 
  pull_request_target:

jobs:
  codespell:
    name: Check for spelling errors
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Get changed files
      id: changed-files
      uses: tj-actions/[email protected]

    - name: Get the latest dictionary
      run: |
        wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt

    - name: Get the latest rare dictionary
      run: |
        wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary_rare.txt    

    - uses: codespell-project/actions-codespell@master
      with:
        dictionary: dictionary.txt,dictionary_rare.txt
        path: ${{ steps.changed-files.outputs.all_changed_files }}

Parameter: check_filenames

If set, check file names for spelling mistakes as well.

This parameter is optional; by default codespell will only check the file contents.

uses: codespell-project/actions-codespell@master
with:
  check_filenames: true

Parameter: check_hidden

If set, check hidden files (those starting with ".") for spelling mistakes as well.

This parameter is optional; by default codespell will not check hidden files.

uses: codespell-project/actions-codespell@master
with:
  check_hidden: true

Parameter: exclude_file

File with lines that should not be checked for spelling mistakes.

This parameter is optional; by default codespell will check all lines.

uses: codespell-project/actions-codespell@master
with:
  exclude_file: src/foo

Parameter: skip

Comma-separated list of files to skip (it accepts globs as well).

This parameter is optional; by default codespell won't skip any files.

uses: codespell-project/actions-codespell@master
with:
  skip: foo,bar

Parameter: dictionary

Comma-separated list of custom dictionaries to use. This parameter is optional; by default codespell will use the builtin dictionaries.

uses: codespell-project/actions-codespell@master
with:
  dictionary: dictionary.txt,dictionary2.txt

Parameter: builtin

Comma-separated list of builtin dictionaries to use.

This parameter is optional; by default codespell will use its default selection of built in dictionaries.

uses: codespell-project/actions-codespell@master
with:
  builtin: clear,rare

Parameter: dictionary

custom dictionary file that contains spelling corrections. If this flag is not specified or equals "-" then the default dictionary is used. This parameter is optional;

uses: codespell-project/actions-codespell@master
with:
  dictionary: dictionary.txt

Parameter: ignore_words_file

File that contains words which will be ignored by codespell. File must contain one word per line. Words are case sensitive based on how they are written in the dictionary file.

This parameter is optional; by default codespell will check all words for typos.

uses: codespell-project/actions-codespell@master
with:
  ignore_words_file: .codespellignore

Parameter: ignore_words_list

Comma-separated list of words which will be ignored by codespell. Words are case sensitive based on how they are written in the dictionary file.

This parameter is optional; by default codespell will check all words for typos.

uses: codespell-project/actions-codespell@master
with:
  ignore_words_list: abandonned,ackward

Parameter: path

Indicates the path to run codespell in. This can be useful if your project has code you don't want to spell check for some reason.

This parameter is optional; by default codespell will run on your whole repository.

uses: codespell-project/actions-codespell@master
with:
  path: src

Parameter: only_warn

Only warn about problems. All errors and warnings are annotated in Pull Requests, but it will act like everything was fine anyway. (In other words, the exit code is always 0.)

This parameter is optional; setting this to any value will enable it.

uses: codespell-project/actions-codespell@master
with:
  only_warn: 1

actions-codespell's People

Contributors

peternewman avatar truebrain avatar larsoner avatar floriansimmer avatar per1234 avatar dimitripapadopoulos avatar

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.