Merge branch 'master' into demo-pr
Testing / Run tests (git+https://github.com/codespell-project/codespell.git, false) (push) Successful in 8s
Testing / Run tests (codespell, false) (push) Successful in 1s
Testing / Test run action (push) Successful in 9s
Testing / Diagnose bats (codespell) (push) Skipped
Testing / Diagnose bats (git+https://github.com/codespell-project/codespell.git) (push) Skipped
Testing / Check for spelling errors (push) Successful in 10s

This commit is contained in:
Peter Newman
2024-12-09 15:05:05 +00:00
committed by GitHub
13 changed files with 145 additions and 34 deletions
+10
View File
@@ -0,0 +1,10 @@
# See: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#about-the-dependabotyml-file
version: 2
updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
name: Publish master image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Build
run: |
GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z])
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
name: Publish stable image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Build
run: |
GITHUB_REPOSITORY_LC=$(echo "${GITHUB_REPOSITORY}" | tr [A-Z] [a-z])
+29 -11
View File
@@ -19,13 +19,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install codespell via pip using ${{ matrix.codespell_pip_version }}
run: pip3 --quiet --quiet install ${{ matrix.codespell_pip_version }}
run: pip install ${{ matrix.codespell_pip_version }}
- name: Check codespell
run: codespell --version
- name: Install Bats
run: |
@@ -43,7 +48,7 @@ jobs:
name: Test run action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ./
with:
path: test/testdata
@@ -53,26 +58,39 @@ jobs:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ./
with:
check_filenames: true
check_hidden: true
# When using this Action in other repos, the --skip option below can be removed
skip: ./.git,./codespell-problem-matcher/test,./test
skip: ./.git,./codespell-problem-matcher/test,./test,./README.md,./.github/workflows/testing.yml,./.pre-commit-config.yaml
# Check our README (and this workflow) ignoring the two intentional typos
- uses: ./
with:
check_filenames: true
check_hidden: true
path: ./README.md,./.github/workflows/testing.yml
ignore_words_list: abandonned,ackward
diagnose_bats:
name: Diagnose bats
needs: test
if: always() && needs.test.result == 'failure'
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
codespell_pip_version: ['codespell']
include:
- codespell_pip_version: 'git+https://github.com/codespell-project/codespell.git'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
- run: pip3 --quiet --quiet install git+https://github.com/codespell-project/codespell.git
uses: actions/setup-python@v5
- run: pip3 --quiet --quiet install ${{ matrix.codespell_pip_version }}
- run: |
# Skip the bats diagnostics
exit 0
# Simulate the Dockerfile COPY command
[ -d "${RUNNER_TEMP}/code/" ] || sudo mkdir -p ${RUNNER_TEMP}/code/
[ -f "${RUNNER_TEMP}/code/codespell-matcher.json" ] || sudo cp codespell-problem-matcher/codespell-matcher.json ${RUNNER_TEMP}/code/
+8
View File
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: [--ignore-words-list, "abandonned,ackward,bu"]
additional_dependencies:
- tomli
+66 -14
View File
@@ -5,8 +5,8 @@ Any warnings or errors will be annotated in the Pull Request.
## Usage
```
uses: codespell-project/actions-codespell@master
```yml
uses: codespell-project/actions-codespell@v2
```
### Parameter: check_filenames
@@ -15,8 +15,8 @@ If set, check file names for speling mistakes as well.
This parameter is optional; by default `codespell` will only check the file contents.
```
uses: codespell-project/actions-codespell@master
```yml
uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
```
@@ -27,8 +27,8 @@ If set, check hidden files (those starting with ".") for spelling mistakes as we
This parameter is optional; by default `codespell` will not check hidden files.
```
uses: codespell-project/actions-codespell@master
```yml
uses: codespell-project/actions-codespell@v2
with:
check_hidden: true
```
@@ -39,8 +39,8 @@ 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
```yml
uses: codespell-project/actions-codespell@v2
with:
exclude_file: src/foo
```
@@ -51,12 +51,64 @@ 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
```yml
uses: codespell-project/actions-codespell@v2
with:
skip: foo,bar
```
### 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.
```yml
uses: codespell-project/actions-codespell@v2
with:
builtin: clear,rare
```
### 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.
```yml
uses: codespell-project/actions-codespell@v2
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.
```yml
uses: codespell-project/actions-codespell@v2
with:
ignore_words_list: abandonned,ackward
```
### Parameter: uri_ignore_words_list
Comma-separated list of words which will 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.
This parameter is optional; by default `codespell` will check all URIs and emails for typos.
```yml
uses: codespell-project/actions-codespell@v2
with:
uri_ignore_words_list: abandonned
```
### Parameter: path
Indicates the path to run `codespell` in.
@@ -64,8 +116,8 @@ This can be useful if your project has code you don't want to spell check for so
This parameter is optional; by default `codespell` will run on your whole repository.
```
uses: codespell-project/actions-codespell@master
```yml
uses: codespell-project/actions-codespell@v2
with:
path: src
```
@@ -78,8 +130,8 @@ All errors and warnings are annotated in Pull Requests, but it will act like eve
This parameter is optional; setting this to any value will enable it.
```
uses: codespell-project/actions-codespell@master
```yml
uses: codespell-project/actions-codespell@v2
with:
only_warn: 1
```
+6 -2
View File
@@ -23,11 +23,15 @@ inputs:
required: false
default: ''
ignore_words_file:
description: 'File with a list of words to be ignored'
description: 'File with a list of words to be ignored. Words are case sensitive based on how they are written in the dictionary file'
required: false
default: ''
ignore_words_list:
description: 'Comma-separated list of words to be ignored'
description: 'Comma-separated list of words to be ignored. Words are case sensitive based on how they are written in the dictionary file'
required: false
default: ''
uri_ignore_words_list:
description: 'comma separated list of words to be ignored in URIs and emails only'
required: false
default: ''
path:
+3 -1
View File
@@ -25,7 +25,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version:3.x
- run: pip install git+https://github.com/codespell-project/codespell.git
- uses: ./
- name: Check codespell
+1 -1
View File
@@ -2,7 +2,7 @@ name: 'codespell problem matcher'
author: 'Peter Newman'
description: 'Shows codespell errors as annotation (with file and code line) in GitHub Actions'
runs:
using: 'node12'
using: 'node20'
main: 'index.js'
branding:
icon: 'search'
+4
View File
@@ -40,6 +40,10 @@ echo "Ignore words list '${INPUT_IGNORE_WORDS_LIST}'"
if [ "x${INPUT_IGNORE_WORDS_LIST}" != "x" ]; then
command_args="${command_args} --ignore-words-list ${INPUT_IGNORE_WORDS_LIST}"
fi
echo "Ignore URI words list '${INPUT_URI_IGNORE_WORDS_LIST}'"
if [ "x${INPUT_URI_IGNORE_WORDS_LIST}" != "x" ]; then
command_args="${command_args} --uri-ignore-words-list ${INPUT_URI_IGNORE_WORDS_LIST}"
fi
echo "Resulting CLI options ${command_args}"
exec 5>&1
res=`{ { codespell --count ${command_args} ${INPUT_PATH}; echo $? 1>&4; } 1>&5; } 4>&1`
+1 -1
View File
@@ -1 +1 @@
codespell>=2.0.0
codespell[toml]>=2.2.4
+14 -2
View File
@@ -7,12 +7,13 @@
# This currently breaks the tests, so only enabling when troubleshooting
#load teardown
ROOT_MISSPELLING_COUNT=5
ROOT_MISSPELLING_COUNT=6
FILENAME_MISSPELLING_COUNT=1
HIDDEN_MISSPELLING_COUNT=1
EXCLUDED_MISSPELLING_COUNT=1
BUILTIN_NAMES_MISSPELLING_COUNT=1
IGNORE_WORDS_MISSPELLING_COUNT=5
URI_IGNORE_WORDS_MISSPELLING_COUNT=1
SUBFOLDER_MISSPELLING_COUNT=1
# From all files called example.txt
EXAMPLE_MISSPELLING_COUNT=5
@@ -40,6 +41,7 @@ function setup() {
export INPUT_BUILTIN=""
export INPUT_IGNORE_WORDS_FILE=""
export INPUT_IGNORE_WORDS_LIST=""
export INPUT_URI_IGNORE_WORDS_LIST=""
export INPUT_PATH="./test/testdata"
export INPUT_ONLY_WARN=""
}
@@ -103,7 +105,7 @@ function setup() {
}
@test "Check the skip option" {
errorCount=$((ROOT_MISSPELLING_COUNT + SUBFOLDER_MISSPELLING_COUNT - EXAMPLE_MISSPELLING_COUNT))
errorCount=$((ROOT_MISSPELLING_COUNT + SUBFOLDER_MISSPELLING_COUNT - EXAMPLE_MISSPELLING_COUNT - URI_IGNORE_WORDS_MISSPELLING_COUNT))
# codespell's exit status is 0, or 65 if there are errors found
if [ $errorCount -eq 0 ]; then expectedExitStatus=0; else expectedExitStatus=65; fi
INPUT_SKIP="example.txt"
@@ -142,6 +144,16 @@ function setup() {
[ "${lines[-4 - $errorCount]}" == "$errorCount" ]
}
@test "Use a URI ignore words list" {
errorCount=$((ROOT_MISSPELLING_COUNT + SUBFOLDER_MISSPELLING_COUNT - URI_IGNORE_WORDS_MISSPELLING_COUNT))
# codespell's exit status is 0, or 65 if there are errors found
if [ $errorCount -eq 0 ]; then expectedExitStatus=0; else expectedExitStatus=65; fi
INPUT_URI_IGNORE_WORDS_LIST="bu"
run "./entrypoint.sh"
[ $status -eq $expectedExitStatus ]
[ "${lines[-4 - $errorCount]}" == "$errorCount" ]
}
@test "Custom path" {
errorCount=$((SUBFOLDER_MISSPELLING_COUNT))
# codespell's exit status is 0, or 65 if there are errors found
+1
View File
@@ -2,3 +2,4 @@
Abandonned
ABANDONNED
AbAnDoNnEd
https://www.bu.edu