Skip to content

Commit f191445

Browse files
committed
modify script
1 parent 7c4d1ae commit f191445

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/scripts/codespell.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#!/bin/bash
22

3-
echo "Run codespell..."
4-
codespell --quiet-level=2 --skip "*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp" -i 0 -L "ASSER,Tne,ba,BA" || true
3+
OUTPUT=$1
4+
5+
set -e
6+
# codespell --quiet-level=2 --skip "*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp" -i 0 -L "ASSER,Tne,ba,BA"
7+
8+
SCAN_RESULT=$(codespell --quiet-level=2 --skip "*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp" -i 0 -L "ASSER,Tne,ba,BA")
9+
echo -e "${SCAN_RESULT}"
10+
echo -e "${SCAN_RESULT}" > ${OUTPUT}
11+
cat ${OUTPUT}
12+
13+
if [[ ! -z ${SCAN_RESULT} ]]; then
14+
exit 1
15+
fi

.github/workflows/reusable_checks.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
python3 -m venv .venv
3030
. .venv/bin/activate
3131
echo "$PATH" >> $GITHUB_PATH
32-
python3 -m pip install bandit
32+
python3 -m pip install bandit codespell
3333
3434
- name: Configure CMake
3535
run: >
@@ -57,10 +57,9 @@ jobs:
5757
with:
5858
config: ./.github/workflows/.spellcheck-conf.toml
5959

60-
- name: Install and run codespell
60+
- name: Run codespell
6161
run: |
62-
pip install codespell
63-
codespell --quiet-level=2 --skip "*.h,*.cmake,*.c,*.hpp,*.cpp,*.sh,*.py,test/supp/*.supp" -i 0 -L "ASSER,Tne,ba,BA"
62+
bash .github/scripts/codespell.sh codespell.log
6463
6564
# Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv
6665
- name: Run Bandit

0 commit comments

Comments
 (0)