diff --git a/.github/workflows/spelling_action.yml b/.github/workflows/spelling_action.yml index c05b622b..8d66b175 100644 --- a/.github/workflows/spelling_action.yml +++ b/.github/workflows/spelling_action.yml @@ -22,7 +22,7 @@ jobs: task_name: Markdown output_file: spellcheck-output.txt - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: '!cancelled()' name: Archive spellcheck output with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a290e1..eef9e273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log for spellcheck-github-actions +## 0.36.0, 2024-02-06, feature release, update not required + +- With version 2.10 of **PySpelling** the action now supports the configuration of running jobs in parallel, see the [documentation for PySpelling](https://facelessuser.github.io/pyspelling/configuration/) + +- Docker image updated to Python 3.12.1 slim via PR [#177](https://github.com/rojopolis/spellcheck-github-actions/pull/191) from Dependabot. [Release notes for Python 3.12.1](https://docs.python.org/release/3.12.1/whatsnew/changelog.html) + ## 0.35.0, 2023-11-16, maintenance release, update not required - Docker image updated to Python 3.12.0 slim via PR [#177](https://github.com/rojopolis/spellcheck-github-actions/pull/177) from Snyk. [Release notes for Python 3.12.0](https://docs.python.org/release/3.12.0/whatsnew/changelog.html) diff --git a/Dockerfile b/Dockerfile index db409470..02d8d42d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # REF: https://hub.docker.com/_/python -FROM python:3.12.0-slim-bullseye +FROM python:3.12.1-slim-bullseye LABEL "com.github.actions.name"="Spellcheck Action" LABEL "com.github.actions.description"="Check spelling of files in repository" diff --git a/README.md b/README.md index 8d701a0f..585d7147 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ - + # spellcheck-github-actions + ![Markdownlint Action][GHAMKDBADGE] ![Spellcheck Action][GHASPLLBADGE] @@ -9,6 +10,50 @@ A GitHub Action that spell checks Python, Markdown, and Text files. This action uses [PySpelling][pyspelling] to check spelling in source files in the designated repository. +## Table of Contents + +- [Features](#features) +- [Configuration](#configuration) + - [Using a Canonical Version](#using-a-canonical-version) +- [Specifying Sources Files To Check](#specifying-sources-files-to-check) + - [Examples](#examples) + - [No spaces, quotes not required](#no-spaces-quotes-not-required) + - [No spaces, quotes not required, double quotes used for complete parameter](#no-spaces-quotes-not-required-double-quotes-used-for-complete-parameter) + - [No spaces, quotes not required, double quotes used for single parameters](#no-spaces-quotes-not-required-double-quotes-used-for-single-parameters) + - [Spaces, quotes required, single quotes used](#spaces-quotes-required-single-quotes-used) + - [Spaces, quotes required, double quotes used](#spaces-quotes-required-double-quotes-used) + - [Spaces, quotes required, intermixed quotes, will not work](#spaces-quotes-required-intermixed-quotes-will-not-work) +- [Specify a Specific Task To Run](#specify-a-specific-task-to-run) +- [Specify a PySpelling Output Artifact](#specify-a-pyspelling-output-artifact) + - [Extra Configuration](#extra-configuration) + - [Extra Configuration for PySpelling](#extra-configuration-for-pyspelling) + - [Extra Configuration for Markdown](#extra-configuration-for-markdown) +- [Spellcheck Configuration File](#spellcheck-configuration-file) + - [Predefined Name](#predefined-name) +- [Specifying Language](#specifying-language) +- [Checking For Bad Spelling](#checking-for-bad-spelling) +- [Language Support](#language-support) +- [Tips](#tips) +- [How to declutter your root directory from Spellcheck configuration files](#how-to-declutter-your-root-directory-from-spellcheck-configuration-files) +- [Specify Code Not To Have Spelling Checked](#specify-code-not-to-have-spelling-checked) + - [Getting Your Action Updated Automatically](#getting-your-action-updated-automatically) + - [Slimming Your Wordlist By Ignoring Case](#slimming-your-wordlist-by-ignoring-case) +- [Diagnostics](#diagnostics) + - [Diagnostic text: `!!!Spelling check failed!!!`](#diagnostic-text-spelling-check-failed) + - [Diagnostic text: `RuntimeError: None of the source targets from the configuration match any files:`](#diagnostic-text-runtimeerror-none-of-the-source-targets-from-the-configuration-match-any-files) + - [Diagnostic text: `FileNotFoundError: [Errno 2] No such file or directory: '.wordlist.txt'`](#diagnostic-text-filenotfounderror-errno-2-no-such-file-or-directory-wordlisttxt) + - [Diagnostic text: `ValueError: Unable to find or load pyspelling configuration from`](#diagnostic-text-valueerror-unable-to-find-or-load-pyspelling-configuration-from) + - [Diagnostic text: `ERROR: *.md -- 'NoneType' object has no attribute 'end'`](#diagnostic-text-error-md----nonetype-object-has-no-attribute-end) + - [Diagnostic text: `ValueError: Pipline step in unexpected format:`](#diagnostic-text-valueerror-pipline-step-in-unexpected-format) + - [Diagnostic text: `re.error: global flags not at the start of the expression at position 1`](#diagnostic-text-reerror-global-flags-not-at-the-start-of-the-expression-at-position-1) +- [DockerHub](#dockerhub) + - [A note on DockerHub](#a-note-on-dockerhub) +- [Development](#development) +- [Resources and References](#resources-and-references) +- [Author](#author) +- [Acknowledgements](#acknowledgements) +- [Copyright and License](#copyright-and-license) + ## Features - Customizable configuration and spell checking using [PySpelling][pyspelling] @@ -58,7 +103,7 @@ jobs: steps: # The checkout step - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck ``` @@ -68,7 +113,7 @@ For example, it could be named `.github/workflows/spelling_action.yml` for easy ### Using a Canonical Version -In the above example, the configuration is pointing to the exact version of `0.35.0`, this repository also offers the canonical version `v0`, so there is less hassle keeping the action up to date. +In the above example, the configuration is pointing to the exact version of `0.36.0`, this repository also offers the canonical version `v0`, so there is less hassle keeping the action up to date. ```yaml name: Spellcheck Action @@ -156,7 +201,7 @@ jobs: steps: # The checkout step - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck with: source_files: README.md CHANGELOG.md notes/Notes.md @@ -184,7 +229,7 @@ jobs: steps: # The checkout step - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck with: source_files: README.md CHANGELOG.md notes/Notes.md @@ -271,7 +316,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck with: config_path: config/.spellcheck.yml # put path to configuration file here @@ -350,6 +395,40 @@ matrix: Change the configuration to suit your repository and needs, please see the `examples/` directory for more example configurations. +## Specifying Number of Jobs for Parallel Processing + +This action supports parallel processing of the configured tasks, this is done using the `jobs` parameter. Introduced in version 4.10 of **PySpelling**. + +The default value is `1`, which means that the action will run in a single job. + +```yaml +jobs: 4 +``` + +Full example: + +```yaml +jobs: 4 +matrix: +- name: Markdown + aspell: + lang: en + dictionary: + wordlists: + - .wordlist.txt + encoding: utf-8 + pipeline: + - pyspelling.filters.markdown: + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre + sources: + - '**/*.md' + default_encoding: utf-8 +``` + ## Specifying Language This action currently only support `aspell`, please see the section on Language Support below. @@ -437,7 +516,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck with: config_path: .github/spellcheck.yml # <--- put path to configuration file here @@ -652,7 +731,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: rojopolis/spellcheck-github-actions@0.35.0 + - uses: rojopolis/spellcheck-github-actions@0.36.0 name: Spellcheck ``` @@ -727,6 +806,16 @@ ValueError: Pipline step in unexpected format: {'pyspelling.filters.html': None, Example lifted from issue [#60](https://github.com/rojopolis/spellcheck-github-actions/issues/60) +### Diagnostic text: `re.error: global flags not at the start of the expression at position 1` + +This error is emitted from [PySpelling][pyspelling] and indicate an issue with interpreting the configuration file. + +From version [0.29.0](https://github.com/rojopolis/spellcheck-github-actions/releases/tag/0.29.0) the action is using Python 3.11 and since [Python 3.11](https://docs.python.org/3/whatsnew/3.11.html#porting-to-python-3-11) the regular expression engine `(?i)` can now only be used at the start of regular expression not elsewhere. + +If you specify `delimiters` in the configuration file and use the `(?i)` flag, you will get this error, if used in the deprecated manner. + +Thanks to @lasic for reporting and resolving the issue [#189](https://github.com/rojopolis/spellcheck-github-actions/issues/189). + ## DockerHub This action is based on a Docker image available on DockerHub. @@ -795,6 +884,7 @@ Here follows a list of contributors in alphabetical order: - Isaac Muse, @facelessuser - Jonas Brømsø, @jonasbn - José Eduardo Montenegro Cavalcanti de Oliveira, @edumco +- @Lasica - Matt Calvert, @miff2000 - Matthew Macdonald-Wallace, @proffalken - Michael Flaxman, @mflaxman diff --git a/action.yml b/action.yml index 5fd8b44f..540777dd 100644 --- a/action.yml +++ b/action.yml @@ -23,4 +23,4 @@ branding: icon: type runs: using: docker - image: 'docker://jonasbn/github-action-spellcheck:0.35.0' + image: 'docker://jonasbn/github-action-spellcheck:0.36.0' diff --git a/requirements.txt b/requirements.txt index e62d866b..c1af7247 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ html5lib==1.1 lxml==4.9.3 Markdown==3.4.4 pymdown-extensions==10.4 -pyspelling==2.9 +pyspelling==2.10 PyYAML==6.0.1 six==1.16.0 soupsieve==2.5 diff --git a/wordlist.txt b/wordlist.txt index a2f7844b..b3910941 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -13,6 +13,7 @@ GHSL GitHub InlineHilite José +Lasica Lhomme Macdonald MagicLink @@ -66,6 +67,7 @@ gmail html https jonasbn +lasic linters lxml mflaxman