Skip to content

Commit 88bb108

Browse files
Merge pull request #994 from luszczewskakasia1/codespell
Codespell
2 parents 68065ac + f70c7ca commit 88bb108

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

.github/scripts/run-codespell.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 logging
10+
import sys
11+
12+
logging.basicConfig(
13+
level=logging.INFO, format="[%(levelname)s]: [%(asctime)s] %(message)s"
14+
)
15+
16+
17+
def codespell_scan():
18+
try:
19+
codespell_result = subprocess.run( # nosec
20+
[
21+
"codespell",
22+
"-H",
23+
"--quiet-level=3",
24+
"--skip=./.git,./.venv,./.github/workflows/.spellcheck-conf.toml",
25+
],
26+
text=True,
27+
stdout=subprocess.PIPE,
28+
)
29+
if codespell_result.returncode != 0:
30+
for line in codespell_result.stdout.splitlines():
31+
logging.error(line.strip())
32+
sys.exit(1)
33+
else:
34+
logging.info("No spelling errors found")
35+
except subprocess.CalledProcessError as ex:
36+
logging.error(ex)
37+
sys.exit(1)
38+
39+
40+
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)