Skip to content

Codespell #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/scripts/run-codespell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Copyright (C) 2024 Intel Corporation

Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""

import subprocess # nosec B404
import logging
import sys

logging.basicConfig(
level=logging.INFO, format="[%(levelname)s]: [%(asctime)s] %(message)s"
)


def codespell_scan():
try:
codespell_result = subprocess.run( # nosec
[
"codespell",
"-H",
"--quiet-level=3",
"--skip=./.git,./.venv,./.github/workflows/.spellcheck-conf.toml",
],
text=True,
stdout=subprocess.PIPE,
)
if codespell_result.returncode != 0:
for line in codespell_result.stdout.splitlines():
logging.error(line.strip())
sys.exit(1)
else:
logging.info("No spelling errors found")
except subprocess.CalledProcessError as ex:
logging.error(ex)
sys.exit(1)


codespell_scan()
5 changes: 4 additions & 1 deletion .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python3 -m venv .venv
. .venv/bin/activate
echo "$PATH" >> $GITHUB_PATH
python3 -m pip install bandit
python3 -m pip install bandit codespell
- name: Configure CMake
run: >
Expand Down Expand Up @@ -57,6 +57,9 @@ jobs:
with:
config: ./.github/workflows/.spellcheck-conf.toml

- name: Run codespell
run: python3 ./.github/scripts/run-codespell.py

# Run Bandit recursively, but omit _deps directory (with 3rd party code) and python's venv
- name: Run Bandit
run: python3 -m bandit -r . -x '/_deps/,/.venv/'
2 changes: 1 addition & 1 deletion .github/workflows/reusable_valgrind.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Run tests with valgrind intstrumentation tools: memcheck, drd, helgrind
# Run tests with valgrind instrumentation tools: memcheck, drd, helgrind
name: Valgrind

on: workflow_call
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

Expand Down
Loading