File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 test :
77 name : Run tests
88 runs-on : ubuntu-latest
9+ continue-on-error : ${{ matrix.experimental }}
910 strategy :
1011 matrix :
11- codespell_pip_version : ['codespell', 'git+https://github.com/codespell-project/codespell.git']
12+ codespell_pip_version : ['codespell']
13+ experimental : [false]
14+ include :
15+ - codespell_pip_version : ' git+https://github.com/codespell-project/codespell.git'
16+ experimental : true
1217
1318 steps :
1419 - name : Checkout
4146 with :
4247 path : test/testdata
4348 only_warn : 1
49+
50+ diagnose_bats :
51+ name : Diagnose bats
52+ runs-on : ubuntu-latest
53+ steps :
54+ - uses : actions/checkout@v1
55+ - name : Set up Python
56+ uses : actions/setup-python@v2
57+ - run : pip3 --quiet --quiet install git+https://github.com/codespell-project/codespell.git
58+ - run : |
59+ export INPUT_CHECK_FILENAMES=""
60+ export INPUT_CHECK_HIDDEN=""
61+ export INPUT_EXCLUDE_FILE=""
62+ export INPUT_PATH="./test/testdata"
63+ export INPUT_ONLY_WARN=""
64+ ./entrypoint.sh
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ inputs:
1414 description : ' FILE with lines that should not be changed'
1515 requred : false
1616 default : ' '
17+ skip :
18+ description : ' Comma-separated list of files to skip (it accepts globs as well)'
19+ requred : false
20+ default : ' '
1721 path :
1822 description : ' Path to run codespell in'
1923 requred : false
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ echo "Exclude file '${INPUT_EXCLUDE_FILE}'"
2424if [ " x${INPUT_EXCLUDE_FILE} " != " x" ]; then
2525 command_args=" ${command_args} --exclude-file ${INPUT_EXCLUDE_FILE} "
2626fi
27+ echo " Skipping '${INPUT_SKIP} '"
28+ if [ " x${INPUT_SKIP} " != " x" ]; then
29+ command_args=" ${command_args} --skip ${INPUT_SKIP} "
30+ fi
2731echo " Resulting CLI options ${command_args} "
2832exec 5>&1
2933res=` { { codespell ${command_args} ${INPUT_PATH} ; echo $? 1>&4 ; } 1>&5 ; } 4>&1 `
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ FILENAME_MISSPELLING_COUNT=1
88HIDDEN_MISSPELLING_COUNT=1
99EXCLUDED_MISSPELLING_COUNT=1
1010SUBFOLDER_MISSPELLING_COUNT=1
11+ # From all files called example.txt
12+ EXAMPLE_MISSPELLING_COUNT=5
1113
1214export RUNNER_TEMP=" /foo/runner_temp"
1315
@@ -17,6 +19,7 @@ function setup() {
1719 export INPUT_CHECK_FILENAMES=" "
1820 export INPUT_CHECK_HIDDEN=" "
1921 export INPUT_EXCLUDE_FILE=" "
22+ export INPUT_SKIP=" "
2023 export INPUT_PATH=" ./test/testdata"
2124 export INPUT_ONLY_WARN=" "
2225}
@@ -69,6 +72,13 @@ function setup() {
6972 [ $status -eq $expectedExitStatus ]
7073}
7174
75+ @test " Check the skip option" {
76+ expectedExitStatus=$(( ROOT_MISSPELLING_COUNT + HIDDEN_MISSPELLING_COUNT + SUBFOLDER_MISSPELLING_COUNT - EXAMPLE_MISSPELLING_COUNT))
77+ INPUT_SKIP=" example.txt"
78+ run " ./entrypoint.sh"
79+ [ $status -eq $expectedExitStatus ]
80+ }
81+
7282@test " Custom path" {
7383 expectedExitStatus=$(( SUBFOLDER_MISSPELLING_COUNT))
7484 INPUT_PATH=" ./test/testdata/subfolder"
You can’t perform that action at this time.
0 commit comments