From 4fe693505c34d7b279b33bdd9e518263aebc499d Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Wed, 21 Aug 2024 14:04:19 +0200 Subject: [PATCH] feat(linter): add codespell linter Add the codespell linter which uses a dictionary of common misspellings and ignores unknown words. Signed-off-by: Roger Luethi --- .automation/generated/linter-helps.json | 120 +++++++++ .../generated/linter-links-previews.json | 7 +- .automation/generated/linter-versions.json | 1 + .../test/spell_codespell/spell_bad_1.md | 2 + .../test/spell_codespell/spell_fix_1.md | 2 + .../test/spell_codespell/spell_good_1.md | 2 + .cspell.json | 2 + .github/workflows/deploy-BETA-linters.yml | 1 + .github/workflows/deploy-DEV-linters.yml | 1 + .github/workflows/deploy-RELEASE-linters.yml | 1 + .mega-linter.yml | 1 + CHANGELOG.md | 1 + Dockerfile | 3 +- docs/standalone-linters.md | 1 + flavors/c_cpp/Dockerfile | 3 +- flavors/c_cpp/flavor.json | 1 + flavors/cupcake/Dockerfile | 3 +- flavors/cupcake/flavor.json | 1 + flavors/documentation/Dockerfile | 3 +- flavors/documentation/flavor.json | 1 + flavors/dotnet/Dockerfile | 3 +- flavors/dotnet/flavor.json | 1 + flavors/dotnetweb/Dockerfile | 3 +- flavors/dotnetweb/flavor.json | 1 + flavors/go/Dockerfile | 3 +- flavors/go/flavor.json | 1 + flavors/java/Dockerfile | 3 +- flavors/java/flavor.json | 1 + flavors/javascript/Dockerfile | 3 +- flavors/javascript/flavor.json | 1 + flavors/php/Dockerfile | 3 +- flavors/php/flavor.json | 1 + flavors/python/Dockerfile | 3 +- flavors/python/flavor.json | 1 + flavors/ruby/Dockerfile | 3 +- flavors/ruby/flavor.json | 1 + flavors/rust/Dockerfile | 3 +- flavors/rust/flavor.json | 1 + flavors/salesforce/Dockerfile | 3 +- flavors/salesforce/flavor.json | 1 + flavors/swift/Dockerfile | 3 +- flavors/swift/flavor.json | 1 + flavors/terraform/Dockerfile | 3 +- flavors/terraform/flavor.json | 1 + linters/spell_codespell/Dockerfile | 235 ++++++++++++++++++ megalinter/descriptors/all_flavors.json | 15 ++ .../megalinter-configuration.jsonschema.json | 1 + .../spell.megalinter-descriptor.yml | 49 ++++ .../linters/spell_codespell_test.py | 14 ++ 49 files changed, 502 insertions(+), 17 deletions(-) create mode 100644 .automation/test/spell_codespell/spell_bad_1.md create mode 100644 .automation/test/spell_codespell/spell_fix_1.md create mode 100644 .automation/test/spell_codespell/spell_good_1.md create mode 100644 linters/spell_codespell/Dockerfile create mode 100644 megalinter/tests/test_megalinter/linters/spell_codespell_test.py diff --git a/.automation/generated/linter-helps.json b/.automation/generated/linter-helps.json index 2673efc8de8..c9d753369e3 100644 --- a/.automation/generated/linter-helps.json +++ b/.automation/generated/linter-helps.json @@ -1520,6 +1520,126 @@ " -v, --verbose Print detailed debugging output.", " -h, --help Show help and usage information." ], + "codespell": [ + "usage: codespell [-h] [--version] [-d] [-c] [-w] [-D DICTIONARY]", + " [--builtin BUILTIN-LIST] [--ignore-regex IGNORE_REGEX]", + " [-I FILES] [-L WORDS] [--uri-ignore-words-list WORDS]", + " [-r REGEX] [--uri-regex URI_REGEX] [-s] [--count] [-S SKIP]", + " [-x FILES] [-i INTERACTIVE] [-q QUIET_LEVEL] [-e] [-f] [-H]", + " [-A LINES] [-B LINES] [-C LINES] [--stdin-single-line]", + " [--config CONFIG] [--toml TOML]", + " [files ...]", + "", + "positional arguments:", + " files files or directories to check", + "", + "options:", + " -h, --help show this help message and exit", + " --version show program's version number and exit", + " -d, --disable-colors disable colors, even when printing to terminal", + " -c, --enable-colors enable colors, even when not printing to terminal", + " -w, --write-changes write changes in place if possible", + " -D DICTIONARY, --dictionary DICTIONARY", + " comma-separated list of custom dictionary files that", + " contain spelling corrections. If this flag is not", + " specified or equals \"-\" then the default dictionary is", + " used.", + " --builtin BUILTIN-LIST", + " comma-separated list of builtin dictionaries to", + " include (when \"-D -\" or no \"-D\" is passed). Current", + " options are:", + " - 'clear' for unambiguous errors", + " - 'rare' for rare (but valid) words that are likely to", + " be errors", + " - 'informal' for making informal words more formal", + " - 'usage' for replacing phrasing with recommended", + " terms", + " - 'code' for words from code and/or mathematics that", + " are likely to be typos in other contexts (such as", + " uint)", + " - 'names' for valid proper names that might be typos", + " - 'en-GB_to_en-US' for corrections from en-GB to en-US", + " The default is 'clear,rare'.", + " --ignore-regex IGNORE_REGEX", + " regular expression that is used to find patterns to", + " ignore by treating as whitespace. When writing regular", + " expressions, consider ensuring there are boundary non-", + " word chars, e.g., \"\\bmatch\\b\". Defaults to", + " empty/disabled.", + " -I FILES, --ignore-words FILES", + " comma-separated list of files that contain words to be", + " ignored by codespell. Files must contain 1 word per", + " line. Words are case sensitive based on how they are", + " written in the dictionary file.", + " -L WORDS, --ignore-words-list WORDS", + " comma-separated list of words to be ignored by", + " codespell. Words are case sensitive based on how they", + " are written in the dictionary file.", + " --uri-ignore-words-list WORDS", + " comma-separated list of words to be ignored by", + " codespell in URIs and emails only. Words are case", + " sensitive based on how they are written in the", + " dictionary file. If set to \"*\", all misspelling in", + " URIs and emails will be ignored.", + " -r REGEX, --regex REGEX", + " regular expression that is used to find words. By", + " default any alphanumeric character, the underscore,", + " the hyphen, and the apostrophe are used to build", + " words. This option cannot be specified together with", + " --write-changes.", + " --uri-regex URI_REGEX", + " regular expression that is used to find URIs and", + " emails. A default expression is provided.", + " -s, --summary print summary of fixes", + " --count print the number of errors as the last line of stderr", + " -S SKIP, --skip SKIP comma-separated list of files to skip. It accepts", + " globs as well. E.g.: if you want codespell to skip", + " .eps and .txt files, you'd give \"*.eps,*.txt\" to this", + " option.", + " -x FILES, --exclude-file FILES", + " ignore whole lines that match those in the comma-", + " separated list of files EXCLUDE. The lines in these", + " files should match the to-be-excluded lines exactly", + " -i INTERACTIVE, --interactive INTERACTIVE", + " set interactive mode when writing changes:", + " - 0: no interactivity.", + " - 1: ask for confirmation.", + " - 2: ask user to choose one fix when more than one is", + " available.", + " - 3: both 1 and 2", + " -q QUIET_LEVEL, --quiet-level QUIET_LEVEL", + " bitmask that allows suppressing messages:", + " - 0: print all messages.", + " - 1: disable warnings about wrong encoding.", + " - 2: disable warnings about binary files.", + " - 4: omit warnings about automatic fixes that were", + " disabled in the dictionary.", + " - 8: don't print anything for non-automatic fixes.", + " - 16: don't print the list of fixed files.", + " - 32: don't print configuration files.", + " As usual with bitmasks, these levels can be combined;", + " e.g. use 3 for levels 1+2, 7 for 1+2+4, 23 for", + " 1+2+4+16, etc. The default mask is 34.", + " -e, --hard-encoding-detection", + " use chardet to detect the encoding of each file. This", + " can slow down codespell, but is more reliable in", + " detecting encodings other than utf-8, iso8859-1, and", + " ascii.", + " -f, --check-filenames", + " check file names as well", + " -H, --check-hidden check hidden files and directories (those starting", + " with \".\") as well.", + " -A LINES, --after-context LINES", + " print LINES of trailing context", + " -B LINES, --before-context LINES", + " print LINES of leading context", + " -C LINES, --context LINES", + " print LINES of surrounding context", + " --stdin-single-line output just a single line for each misspelling in", + " stdin mode", + " --config CONFIG path to config file.", + " --toml TOML path to a pyproject.toml file." + ], "coffeelint": [ "Usage: coffeelint [options] source [...]", "", diff --git a/.automation/generated/linter-links-previews.json b/.automation/generated/linter-links-previews.json index b31a0b9906b..84eec1b02ab 100644 --- a/.automation/generated/linter-links-previews.json +++ b/.automation/generated/linter-links-previews.json @@ -84,6 +84,11 @@ "image": "https://opengraph.githubassets.com/bf0d187aea6f03a804178458080b2be18a5fd1bf8d8cc353ff3150743aae9805/greglook/cljstyle", "title": "GitHub - greglook/cljstyle: A tool for formatting Clojure code" }, + "codespell": { + "description": "codespell checks code and documentation for common misspellings.", + "image": null, + "title": "codespell-project/codespell: check code for common misspellings" + }, "coffeelint": { "description": "\n CoffeeLint is a style checker that helps keep\n CoffeeScript\n code clean and consistent. CoffeeScript does a great job at\n insulating programmers from many of\n JavaScript's bad parts, but it won't help enforce a consistent style\n across a code base. CoffeeLint can help with that.\n ", "image": null, @@ -624,4 +629,4 @@ "image": "https://avatars3.githubusercontent.com/u/5244945?s=400&v=4", "title": "adrienverge/yamllint" } -} \ No newline at end of file +} diff --git a/.automation/generated/linter-versions.json b/.automation/generated/linter-versions.json index dbf1afd288e..11530e37dc4 100644 --- a/.automation/generated/linter-versions.json +++ b/.automation/generated/linter-versions.json @@ -15,6 +15,7 @@ "clippy": "0.1.82", "clj-kondo": "2024.09.27", "cljstyle": "0.15.0", + "codespell": "2.3.0", "coffeelint": "5.2.11", "cpplint": "2.0.0", "csharpier": "0.29.2", diff --git a/.automation/test/spell_codespell/spell_bad_1.md b/.automation/test/spell_codespell/spell_bad_1.md new file mode 100644 index 00000000000..0f406f799da --- /dev/null +++ b/.automation/test/spell_codespell/spell_bad_1.md @@ -0,0 +1,2 @@ +abandonded Dockefile +abberivated acadamy diff --git a/.automation/test/spell_codespell/spell_fix_1.md b/.automation/test/spell_codespell/spell_fix_1.md new file mode 100644 index 00000000000..0f406f799da --- /dev/null +++ b/.automation/test/spell_codespell/spell_fix_1.md @@ -0,0 +1,2 @@ +abandonded Dockefile +abberivated acadamy diff --git a/.automation/test/spell_codespell/spell_good_1.md b/.automation/test/spell_codespell/spell_good_1.md new file mode 100644 index 00000000000..ebdbe35ec6c --- /dev/null +++ b/.automation/test/spell_codespell/spell_good_1.md @@ -0,0 +1,2 @@ +abandoned Dockerfile +abbreviated academy diff --git a/.cspell.json b/.cspell.json index d5227b2f8c9..5ab7b79dc65 100644 --- a/.cspell.json +++ b/.cspell.json @@ -70,6 +70,8 @@ "citeyear", "ckKXNNNXkc", "cloneable-readable", + "codespell", + "codespellrc", "crcr", "cyclonedx", "dKNNXXO", diff --git a/.github/workflows/deploy-BETA-linters.yml b/.github/workflows/deploy-BETA-linters.yml index e21f95da7b1..898b2fde863 100644 --- a/.github/workflows/deploy-BETA-linters.yml +++ b/.github/workflows/deploy-BETA-linters.yml @@ -159,6 +159,7 @@ jobs: "spell_proselint", "spell_vale", "spell_lychee", + "spell_codespell", "sql_sqlfluff", "sql_tsqllint", "swift_swiftlint", diff --git a/.github/workflows/deploy-DEV-linters.yml b/.github/workflows/deploy-DEV-linters.yml index e36d3241f49..d09cba5accd 100644 --- a/.github/workflows/deploy-DEV-linters.yml +++ b/.github/workflows/deploy-DEV-linters.yml @@ -139,6 +139,7 @@ jobs: "spell_proselint", "spell_vale", "spell_lychee", + "spell_codespell", "sql_sqlfluff", "sql_tsqllint", "swift_swiftlint", diff --git a/.github/workflows/deploy-RELEASE-linters.yml b/.github/workflows/deploy-RELEASE-linters.yml index fa7bfd6cb10..0f45164c046 100644 --- a/.github/workflows/deploy-RELEASE-linters.yml +++ b/.github/workflows/deploy-RELEASE-linters.yml @@ -153,6 +153,7 @@ jobs: "spell_proselint", "spell_vale", "spell_lychee", + "spell_codespell", "sql_sqlfluff", "sql_tsqllint", "swift_swiftlint", diff --git a/.mega-linter.yml b/.mega-linter.yml index 018d5d646a6..031da5f10f9 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -27,6 +27,7 @@ DISABLE_ERRORS_LINTERS: - REPOSITORY_GRYPE - REPOSITORY_SEMGREP - REPOSITORY_TRUFFLEHOG + - SPELL_CODESPELL - SPELL_LYCHEE PRINT_ALL_FILES: false FILTER_REGEX_EXCLUDE: '(\.automation/test|\.automation/generated|\.venv|\.github/workflows|docs/javascripts|docs/overrides|docs/json-schemas|flavors|clj-kondo|TEMPLATES)' diff --git a/CHANGELOG.md b/CHANGELOG.md index 614afe339c5..8eb9694fa5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Core - New linters + - Add [codespell](https://github.com/codespell-project/codespell) - Media - [10 MegaLinter Tips and Tricks Unlock its Full Potential](https://flexion.us/blog/megalinter-tips-and-tricks/) by [Wes Dean](https://github.com/wesley-dean) diff --git a/Dockerfile b/Dockerfile index 0924a113732..79e1741d6e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -254,11 +254,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/docs/standalone-linters.md b/docs/standalone-linters.md index 557c50439d6..520b0dbc0d9 100644 --- a/docs/standalone-linters.md +++ b/docs/standalone-linters.md @@ -109,6 +109,7 @@ | SPELL_PROSELINT | oxsecurity/megalinter-only-spell_proselint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-spell_proselint/beta) | | SPELL_VALE | oxsecurity/megalinter-only-spell_vale:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-spell_vale/beta) | | SPELL_LYCHEE | oxsecurity/megalinter-only-spell_lychee:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-spell_lychee/beta) | +| SPELL_CODESPELL | oxsecurity/megalinter-only-spell_codespell:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-spell_codespell/beta) | | SQL_SQLFLUFF | oxsecurity/megalinter-only-sql_sqlfluff:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-sql_sqlfluff/beta) | | SQL_TSQLLINT | oxsecurity/megalinter-only-sql_tsqllint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-sql_tsqllint/beta) | | SWIFT_SWIFTLINT | oxsecurity/megalinter-only-swift_swiftlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-swift_swiftlint/beta) | diff --git a/flavors/c_cpp/Dockerfile b/flavors/c_cpp/Dockerfile index 6d4d55dc335..19a452cfbe8 100644 --- a/flavors/c_cpp/Dockerfile +++ b/flavors/c_cpp/Dockerfile @@ -160,11 +160,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/c_cpp/flavor.json b/flavors/c_cpp/flavor.json index ea6071cb911..11340f461ae 100644 --- a/flavors/c_cpp/flavor.json +++ b/flavors/c_cpp/flavor.json @@ -53,6 +53,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index 6544499ca2a..20c03bfbd2a 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -207,11 +207,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/rstcheck" && cd "/venvs/rstcheck" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstcheck[toml,sphinx] && deactivate && cd ./../.. \ && mkdir -p "/venvs/rstfmt" && cd "/venvs/rstfmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstfmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/cupcake/flavor.json b/flavors/cupcake/flavor.json index af7070c8d7e..56419261303 100644 --- a/flavors/cupcake/flavor.json +++ b/flavors/cupcake/flavor.json @@ -79,6 +79,7 @@ "SPELL_CSPELL", "SPELL_PROSELINT", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SWIFT_SWIFTLINT", "TERRAFORM_TFLINT", diff --git a/flavors/documentation/Dockerfile b/flavors/documentation/Dockerfile index fd6e64dca80..9b423fe4eb6 100644 --- a/flavors/documentation/Dockerfile +++ b/flavors/documentation/Dockerfile @@ -158,11 +158,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/documentation/flavor.json b/flavors/documentation/flavor.json index 78c9f232d8c..53693773737 100644 --- a/flavors/documentation/flavor.json +++ b/flavors/documentation/flavor.json @@ -48,6 +48,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index ed18e693bbf..b198f34d690 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -169,11 +169,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/dotnet/flavor.json b/flavors/dotnet/flavor.json index 1da378c4d7a..f884c936c02 100644 --- a/flavors/dotnet/flavor.json +++ b/flavors/dotnet/flavor.json @@ -63,6 +63,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SQL_TSQLLINT", "TEKTON_TEKTON_LINT", diff --git a/flavors/dotnetweb/Dockerfile b/flavors/dotnetweb/Dockerfile index b2d9fec5178..56dde0e5e00 100644 --- a/flavors/dotnetweb/Dockerfile +++ b/flavors/dotnetweb/Dockerfile @@ -169,11 +169,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/dotnetweb/flavor.json b/flavors/dotnetweb/flavor.json index 52145fbef57..32f60311a2d 100644 --- a/flavors/dotnetweb/flavor.json +++ b/flavors/dotnetweb/flavor.json @@ -69,6 +69,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SQL_TSQLLINT", "TEKTON_TEKTON_LINT", diff --git a/flavors/go/Dockerfile b/flavors/go/Dockerfile index b800268ba2d..3835d7dbda9 100644 --- a/flavors/go/Dockerfile +++ b/flavors/go/Dockerfile @@ -166,11 +166,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/go/flavor.json b/flavors/go/flavor.json index a21b72f8ecd..2bae2aa1899 100644 --- a/flavors/go/flavor.json +++ b/flavors/go/flavor.json @@ -51,6 +51,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/java/Dockerfile b/flavors/java/Dockerfile index cd40b653bef..202f92a1712 100644 --- a/flavors/java/Dockerfile +++ b/flavors/java/Dockerfile @@ -161,11 +161,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/java/flavor.json b/flavors/java/flavor.json index 679125c6af0..d05494c5a41 100644 --- a/flavors/java/flavor.json +++ b/flavors/java/flavor.json @@ -53,6 +53,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/javascript/Dockerfile b/flavors/javascript/Dockerfile index 13209b7364e..6201f926b1a 100644 --- a/flavors/javascript/Dockerfile +++ b/flavors/javascript/Dockerfile @@ -158,11 +158,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/javascript/flavor.json b/flavors/javascript/flavor.json index e2d9f0bb840..1c7c24027ca 100644 --- a/flavors/javascript/flavor.json +++ b/flavors/javascript/flavor.json @@ -55,6 +55,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "TSX_ESLINT", diff --git a/flavors/php/Dockerfile b/flavors/php/Dockerfile index 6c5b81094c6..8c4503484c6 100644 --- a/flavors/php/Dockerfile +++ b/flavors/php/Dockerfile @@ -172,11 +172,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/php/flavor.json b/flavors/php/flavor.json index e7681c74970..c0157265bd3 100644 --- a/flavors/php/flavor.json +++ b/flavors/php/flavor.json @@ -54,6 +54,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/python/Dockerfile b/flavors/python/Dockerfile index 63233e1699e..b77fbc2f3cb 100644 --- a/flavors/python/Dockerfile +++ b/flavors/python/Dockerfile @@ -170,11 +170,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/python/flavor.json b/flavors/python/flavor.json index 88071537b7e..02ff0ef0bf1 100644 --- a/flavors/python/flavor.json +++ b/flavors/python/flavor.json @@ -61,6 +61,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/ruby/Dockerfile b/flavors/ruby/Dockerfile index 9e7ebe53660..f953363bc46 100644 --- a/flavors/ruby/Dockerfile +++ b/flavors/ruby/Dockerfile @@ -162,11 +162,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/ruby/flavor.json b/flavors/ruby/flavor.json index 14346fda162..5011c540b5f 100644 --- a/flavors/ruby/flavor.json +++ b/flavors/ruby/flavor.json @@ -49,6 +49,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/rust/Dockerfile b/flavors/rust/Dockerfile index 0bb6fc24c6b..9b18f7798d4 100644 --- a/flavors/rust/Dockerfile +++ b/flavors/rust/Dockerfile @@ -158,11 +158,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/rust/flavor.json b/flavors/rust/flavor.json index b5fea47da48..984670625cf 100644 --- a/flavors/rust/flavor.json +++ b/flavors/rust/flavor.json @@ -49,6 +49,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/salesforce/Dockerfile b/flavors/salesforce/Dockerfile index 11471dfcf7c..3f04a641242 100644 --- a/flavors/salesforce/Dockerfile +++ b/flavors/salesforce/Dockerfile @@ -168,11 +168,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/salesforce/flavor.json b/flavors/salesforce/flavor.json index 9d46e295990..fb61c9a8d43 100644 --- a/flavors/salesforce/flavor.json +++ b/flavors/salesforce/flavor.json @@ -54,6 +54,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", diff --git a/flavors/swift/Dockerfile b/flavors/swift/Dockerfile index 70443b999ed..93f68138fef 100644 --- a/flavors/swift/Dockerfile +++ b/flavors/swift/Dockerfile @@ -160,11 +160,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/swift/flavor.json b/flavors/swift/flavor.json index ce3e6befa93..018f5ef56d0 100644 --- a/flavors/swift/flavor.json +++ b/flavors/swift/flavor.json @@ -48,6 +48,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SWIFT_SWIFTLINT", "TEKTON_TEKTON_LINT", diff --git a/flavors/terraform/Dockerfile b/flavors/terraform/Dockerfile index a5ffa7718dd..9240e69072f 100644 --- a/flavors/terraform/Dockerfile +++ b/flavors/terraform/Dockerfile @@ -172,11 +172,12 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache -ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin +ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/codespell/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END ############################ diff --git a/flavors/terraform/flavor.json b/flavors/terraform/flavor.json index f1df11ed2fc..43fdc41092e 100644 --- a/flavors/terraform/flavor.json +++ b/flavors/terraform/flavor.json @@ -49,6 +49,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "TERRAFORM_TFLINT", diff --git a/linters/spell_codespell/Dockerfile b/linters/spell_codespell/Dockerfile new file mode 100644 index 00000000000..3232db76cc9 --- /dev/null +++ b/linters/spell_codespell/Dockerfile @@ -0,0 +1,235 @@ +# syntax=docker/dockerfile:1 +########################################### +########################################### +## Dockerfile to run MegaLinter ## +########################################### +########################################### + +# @not-generated + +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# +#ARGTOP__START + +#ARGTOP__END + +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# +#FROM__START + +#FROM__END + +################## +# Build wheel for megalinter python package +################## +FROM ghcr.io/astral-sh/uv:0.5.1 AS uv +FROM python:3.12.7-alpine3.20 AS build-ml-core +WORKDIR / +COPY pyproject.toml . +COPY --from=uv /uv /bin/uv +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --system -r pyproject.toml +COPY . . +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --system . + +################## +# Get base image # +################## +FROM python:3.12.7-alpine3.20 + +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# +#ARG__START + +#ARG__END + +#################### +# Run APK installs # +#################### + +WORKDIR / + +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# +#APK__START +RUN apk add --no-cache \ + bash \ + ca-certificates \ + curl \ + gcc \ + git \ + git-lfs \ + libffi-dev \ + make \ + musl-dev \ + openssh \ + && git config --global core.autocrlf true +#APK__END + +# PATH for golang & python +ENV GOROOT=/usr/lib/go \ + GOPATH=/go + # PYTHONPYCACHEPREFIX="$HOME/.cache/cpython/" NV: not working for all packages :/ +# hadolint ignore=DL3044 +ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin +RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ + # Ignore npm package issues + yarn config set ignore-engines true || true + +############################## +# Installs rust dependencies # +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# + +#CARGO__START + +#CARGO__END + +################################ +# Installs python dependencies # +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# + +#PIPVENV__START +RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ + && mkdir -p "/venvs/codespell" && cd "/venvs/codespell" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir codespell && deactivate && cd ./../.. \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && rm -rf /root/.cache +ENV PATH="${PATH}":/venvs/codespell/bin +#PIPVENV__END + +############################ +# Install NPM dependencies # +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# + +ENV NODE_OPTIONS="--max-old-space-size=8192" \ + NODE_ENV=production +#NPM__START + +#NPM__END + +# Add node packages to path # +ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ + NODE_PATH="/node-deps/node_modules" + +############################## +# Installs ruby dependencies # +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# + +#GEM__START + +#GEM__END + +############################## +# COPY instructions # +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# + +#COPY__START + +#COPY__END + +############################################################################################# +## @generated by .automation/build.py using descriptor files, please do not update manually ## +############################################################################################# +#OTHER__START + +#OTHER__END + +################################ +# Installs python dependencies # +################################ +COPY --from=build-ml-core pyproject.toml README.md ./ +COPY --from=build-ml-core megalinter /megalinter/ +RUN --mount=type=cache,target=/root/.cache/uv,from=build-ml-core \ + --mount=from=uv,source=/uv,target=/bin/uv \ + uv pip install --system -e . + +####################################### +# Copy scripts and rules to container # +####################################### +COPY megalinter/descriptors /megalinter-descriptors +COPY TEMPLATES /action/lib/.automation + +# Copy server scripts +COPY server /server + +########################### +# Get the build arguments # +########################### +ARG BUILD_DATE +ARG BUILD_REVISION +ARG BUILD_VERSION + +################################################# +# Set ENV values used for debugging the version # +################################################# +ENV BUILD_DATE=$BUILD_DATE \ + BUILD_REVISION=$BUILD_REVISION \ + BUILD_VERSION=$BUILD_VERSION + +#FLAVOR__START +ENV MEGALINTER_FLAVOR=none +#FLAVOR__END + +######################################### +# Label the instance and set maintainer # +######################################### +LABEL com.github.actions.name="MegaLinter" \ + com.github.actions.description="The ultimate linters aggregator to make sure your projects are clean" \ + com.github.actions.icon="code" \ + com.github.actions.color="red" \ + maintainer="Nicolas Vuillamy " \ + org.opencontainers.image.created=$BUILD_DATE \ + org.opencontainers.image.revision=$BUILD_REVISION \ + org.opencontainers.image.version=$BUILD_VERSION \ + org.opencontainers.image.authors="Nicolas Vuillamy " \ + org.opencontainers.image.url="https://megalinter.io" \ + org.opencontainers.image.source="https://github.com/oxsecurity/megalinter" \ + org.opencontainers.image.documentation="https://megalinter.io" \ + org.opencontainers.image.vendor="Nicolas Vuillamy" \ + org.opencontainers.image.description="Lint your code base with GitHub Actions" + +#EXTRA_DOCKERFILE_LINES__START +ENV ENABLE_LINTERS=SPELL_CODESPELL \ + FLAVOR_SUGGESTIONS=false \ + SINGLE_LINTER=SPELL_CODESPELL \ + PRINT_ALPACA=false \ + LOG_FILE=none \ + SARIF_REPORTER=true \ + TEXT_REPORTER=false \ + UPDATED_SOURCES_REPORTER=false \ + GITHUB_STATUS_REPORTER=false \ + GITHUB_COMMENT_REPORTER=false \ + EMAIL_REPORTER=false \ + API_REPORTER=false \ + FILEIO_REPORTER=false \ + CONFIG_REPORTER=false \ + SARIF_TO_HUMAN=false +RUN mkdir /root/docker_ssh && mkdir /usr/bin/megalinter-sh +EXPOSE 22 +COPY entrypoint.sh /entrypoint.sh +COPY sh /usr/bin/megalinter-sh +COPY sh/megalinter_exec /usr/bin/megalinter_exec +COPY sh/motd /etc/motd +RUN find /usr/bin/megalinter-sh/ -type f -iname "*.sh" -exec chmod +x {} \; && \ + chmod +x entrypoint.sh && \ + chmod +x /usr/bin/megalinter_exec && \ + echo "alias megalinter='python -m megalinter.run'" >> ~/.bashrc && source ~/.bashrc && \ + echo "alias megalinter_exec='/usr/bin/megalinter_exec'" >> ~/.bashrc && source ~/.bashrc +RUN export STANDALONE_LINTER_VERSION="$(python -m megalinter.run --input /tmp --linterversion)" && \ + echo $STANDALONE_LINTER_VERSION +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] +#EXTRA_DOCKERFILE_LINES__END diff --git a/megalinter/descriptors/all_flavors.json b/megalinter/descriptors/all_flavors.json index 1062a9a0e49..94b241beadb 100644 --- a/megalinter/descriptors/all_flavors.json +++ b/megalinter/descriptors/all_flavors.json @@ -54,6 +54,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -172,6 +173,7 @@ "SPELL_CSPELL", "SPELL_PROSELINT", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SWIFT_SWIFTLINT", "TERRAFORM_TFLINT", @@ -238,6 +240,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -311,6 +314,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SQL_TSQLLINT", "TEKTON_TEKTON_LINT", @@ -392,6 +396,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SQL_TSQLLINT", "TEKTON_TEKTON_LINT", @@ -488,6 +493,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -551,6 +557,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -616,6 +623,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "TSX_ESLINT", @@ -684,6 +692,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -755,6 +764,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -814,6 +824,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -873,6 +884,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -937,6 +949,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "XML_XMLLINT", @@ -1025,6 +1038,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "SWIFT_SWIFTLINT", "TEKTON_TEKTON_LINT", @@ -1085,6 +1099,7 @@ "SPELL_PROSELINT", "SPELL_VALE", "SPELL_LYCHEE", + "SPELL_CODESPELL", "SQL_SQLFLUFF", "TEKTON_TEKTON_LINT", "TERRAFORM_TFLINT", diff --git a/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json b/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json index 21e8da3f09f..f1d640eeafb 100644 --- a/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json +++ b/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json @@ -243,6 +243,7 @@ "SCALA_SCALAFIX", "SNAKEMAKE_LINT", "SNAKEMAKE_SNAKEFMT", + "SPELL_CODESPELL", "SPELL_CSPELL", "SPELL_LYCHEE", "SPELL_MISSPELL", diff --git a/megalinter/descriptors/spell.megalinter-descriptor.yml b/megalinter/descriptors/spell.megalinter-descriptor.yml index 3d999c349c6..cbd88c8ef03 100644 --- a/megalinter/descriptors/spell.megalinter-descriptor.yml +++ b/megalinter/descriptors/spell.megalinter-descriptor.yml @@ -211,3 +211,52 @@ linters: dockerfile: - FROM lycheeverse/lychee:latest-alpine AS lychee - COPY --link --from=lychee /usr/local/bin/lychee /usr/bin/ + + # codespell + - linter_name: codespell + name: SPELL_CODESPELL + linter_text: | + Fix common misspellings in source code and other text files. + + A file **.codespellrc** can be created at the root of the repository to configure codespell. + + See the [codespell documentation](https://github.com/codespell-project/codespell) for details. + test_folder: spell_codespell + can_output_sarif: false + descriptor_flavors: + - all_flavors + - cupcake + - documentation + linter_url: https://github.com/codespell-project/codespell + linter_repo: https://github.com/codespell-project/codespell + linter_rules_configuration_url: https://github.com/codespell-project/codespell?tab=readme-ov-file#using-a-config-file + linter_rules_inline_disable_url: https://github.com/codespell-project/codespell?tab=readme-ov-file#inline-ignore + linter_speed: 3 + file_extensions: + - .md + - .mdx + - .markdown + - .html + - .htm + - .rst + - .txt + - .json + - .jsonc + - .json5 + - .yaml + - .yml + config_file_name: .codespellrc + cli_config_arg_name: --config + cli_help_arg_name: --help + cli_lint_ignore_arg_name: --skip + cli_lint_fix_arg_name: --write-changes + cli_version_arg_name: --version + cli_lint_mode: list_of_files + cli_lint_errors_count: total_lines + examples: + - codespell + - codespell ./my_file ./my_directory + - codespell --config codespell.ini --check-filenames test.txt + install: + pip: + - codespell diff --git a/megalinter/tests/test_megalinter/linters/spell_codespell_test.py b/megalinter/tests/test_megalinter/linters/spell_codespell_test.py new file mode 100644 index 00000000000..70b4ce779b4 --- /dev/null +++ b/megalinter/tests/test_megalinter/linters/spell_codespell_test.py @@ -0,0 +1,14 @@ +# !/usr/bin/env python3 +""" +Unit tests for SPELL linter codespell +This class has been automatically @generated by .automation/build.py, please don't update it manually +""" + +from unittest import TestCase + +from megalinter.tests.test_megalinter.LinterTestRoot import LinterTestRoot + + +class spell_codespell_test(TestCase, LinterTestRoot): + descriptor_id = "SPELL" + linter_name = "codespell"