Skip to content

misspell

GitHub stars autofix GitHub release (latest SemVer) GitHub last commit GitHub commit activity GitHub contributors

misspell detects and corrects commonly misspelled english words

misspell documentation

misspell - GitHub

Configuration in MegaLinter

Variable Description Default value
SPELL_MISSPELL_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
SPELL_MISSPELL_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Include every file
SPELL_MISSPELL_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
SPELL_MISSPELL_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
- list_of_files: Call the linter with the list of files as argument
- project: Call the linter from the root of the project
list_of_files
SPELL_MISSPELL_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
Exclude every file
SPELL_MISSPELL_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
SPELL_MISSPELL_PRE_COMMANDS List of bash commands to run before the linter None
SPELL_MISSPELL_POST_COMMANDS List of bash commands to run after the linter None
SPELL_MISSPELL_DISABLE_ERRORS Run linter but consider errors as warnings false
SPELL_MISSPELL_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0

MegaLinter Flavours

This linter is available in the following flavours

Flavor Description Embedded linters Info
all Default MegaLinter Flavor 114 Docker Image Size (tag) Docker Pulls
cupcake MegaLinter for the most commonly used languages 82 Docker Image Size (tag) Docker Pulls
documentation MegaLinter for documentation projects 48 Docker Image Size (tag) Docker Pulls
dotnet Optimized for C, C++, C# or VB based projects 60 Docker Image Size (tag) Docker Pulls
go Optimized for GO based projects 50 Docker Image Size (tag) Docker Pulls
java Optimized for JAVA based projects 51 Docker Image Size (tag) Docker Pulls
javascript Optimized for JAVASCRIPT or TYPESCRIPT based projects 57 Docker Image Size (tag) Docker Pulls
php Optimized for PHP based projects 51 Docker Image Size (tag) Docker Pulls
python Optimized for PYTHON based projects 59 Docker Image Size (tag) Docker Pulls
ruby Optimized for RUBY based projects 48 Docker Image Size (tag) Docker Pulls
rust Optimized for RUST based projects 48 Docker Image Size (tag) Docker Pulls
salesforce Optimized for Salesforce based projects 51 Docker Image Size (tag) Docker Pulls
swift Optimized for SWIFT based projects 48 Docker Image Size (tag) Docker Pulls
terraform Optimized for TERRAFORM based projects 53 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • If this linter is active, all files linted by all other active linters will be linted

How the linting is performed

  • misspell is called once with the list of files as arguments (list_of_files CLI lint mode)

Example calls

misspell myfile.any

Help content

Usage of misspell:
  -debug
      Debug matching, very slow
  -error
      Exit with 2 if misspelling found
  -f string
      'csv', 'sqlite3' or custom Golang template for output
  -i string
      ignore the following corrections, comma separated
  -j int
      Number of workers, 0 = number of CPUs
  -legal
      Show legal information and exit
  -locale string
      Correct spellings using locale perferances for US or UK.  Default is to use a neutral variety of English.  Setting locale to US will correct the British spelling of 'colour' to 'color'
  -o string
      output file or [stderr|stdout|] (default "stdout")
  -q  Do not emit misspelling output
  -source string
      Source mode: auto=guess, go=golang source, text=plain or markdown-like text (default "auto")
  -v  Show version and exit
  -w  Overwrite file with corrections (default is just to display)

Installation on mega-linter Docker image

  • Dockerfile commands :
RUN ML_THIRD_PARTY_DIR="/third-party/misspell" \
    && mkdir -p ${ML_THIRD_PARTY_DIR} \
    && curl --retry 10 --retry-all-errors -L -o ${ML_THIRD_PARTY_DIR}/install-misspell.sh https://git.io/misspell \
    && sh .${ML_THIRD_PARTY_DIR}/install-misspell.sh \
    && find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \
    && find /tmp -path '/tmp/tmp.*' -type f -name 'misspell*' -delete -o -type d -empty -delete