Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuzzbawls committed Sep 1, 2024
1 parent 826ec2e commit 3c0d5a4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ jobs:
git checkout -qf $GITHUB_SHA
# Build or rebuild the cppcheck cache.
test/lint/extended-lint-all.sh --setup
test/lint/cppcheck/lint-all.sh --setup
- name: Lint
run: |
# Run the remainder of lint tests in `test/lint/`.
test/lint/extended-lint-all.sh
test/lint/cppcheck/lint-all.sh
# CMake build jobs to ensure building with CMake remains viable.
# Currently this only supports native linux and macOS.
Expand Down
30 changes: 30 additions & 0 deletions test/lint/cppcheck/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
This folder contains lint scripts intended for use with the cppcheck CLI program.

Lint script naming convention should be in the form of `lint-<cppcheckrule>.sh`

lint-noexplicitconstructor.sh
======

Checks for 1-argument (non-converting) class/struct constructors that are not
marked as `explicit`. Allowing implicit conversion can lead to difficult to
track down bugs and unintended behavior.

run-cppcheck.sh
======

This script is responsible for building/rebuilding the cppcheck cache that
all other lint scripts use. cppcheck is run in "project" mode, which creates
a build cache to speed up subsequent runs. The result is output to a named
`cppcheck.txt` file, used by other lint scripts.

lint-all.sh
======

This is the base script used to initialize or run any lint script contained
in this directory. It can take an optional argument of `--setup` to
build/rebuild a cppcheck cache then exit, or be run with no arguments
(provided a cppcache exists) to then run any lint script in this directory.

Standard usage is to first run `./test/lint/cppcheck/lint-all.sh --setup` to
create or rebuild the cppcheck cache, then run `./test/llint/cppcheck/lint-all.sh`
with no arguments to perform any actual lint tests.
2 changes: 1 addition & 1 deletion test/lint/extended-lint-all.sh → test/lint/cppcheck/lint-all.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ $# != 0 ]]; then
fi
fi

for f in "${SCRIPTDIR}"/extended-lint-*.sh; do
for f in "${SCRIPTDIR}"/lint-*.sh; do
if [ "$(basename "$f")" != "$LINTALL" ]; then
if ! "$f"; then
echo "^---- failure generated from $f"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 3c0d5a4

Please sign in to comment.