Skip to content

Commit 167f206

Browse files
add python script to run codespell scan
Signed-off-by: Katarzyna Luszczewska <katarzyna.luszczewska@intel.com>
1 parent aef7ae7 commit 167f206

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

.github/scripts/run-codespell.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Copyright (C) 2024 Intel Corporation
3+
4+
Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
5+
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
"""
7+
8+
import subprocess # nosec B404
9+
import sys
10+
11+
12+
def codespell_scan():
13+
try:
14+
codespell_result = subprocess.run( # nosec
15+
[
16+
"codespell",
17+
"-H",
18+
"--quiet-level=3",
19+
"--skip=./.git,./.venv,./.github/workflows/.spellcheck-conf.toml,./.github/scripts/run-codespell.py",
20+
],
21+
text=True,
22+
)
23+
if codespell_result.returncode != 0:
24+
print(codespell_result)
25+
sys.exit(1)
26+
else:
27+
print("No spelling errors found")
28+
except subprocess.CalledProcessError as ex:
29+
print(ex)
30+
sys.exit(1)
31+
32+
33+
codespell_scan()

.github/workflows/reusable_checks.yml

Lines changed: 4 additions & 1 deletion
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,6 +57,9 @@ jobs:
5757
with:
5858
config: ./.github/workflows/.spellcheck-conf.toml
5959

60+
- name: Run codespell
61+
run: python3 ./.github/scripts/run-codespell.py
62+
6063
# Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv
6164
- name: Run Bandit
6265
run: python3 -m bandit -r . -x '/_deps/,/.venv/'

.github/workflows/reusable_valgrind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Run tests with valgrind intstrumentation tools: memcheck, drd, helgrind
1+
# Run tests with valgrind instrumentation tools: memcheck, drd, helgrind
22
name: Valgrind
33

44
on: workflow_call

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
8-
identity and expression, level of experience, education, socio-economic status,
8+
identity and expression, level of experience, education, socioeconomic status,
99
nationality, personal appearance, race, caste, color, religion, or sexual
1010
identity and orientation.
1111

0 commit comments

Comments
 (0)