-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stricter compliance with C++ best-practices, enforced by stricter rul…
…eset with clang-tidy (safer code). Removed C-style character arrays, now use std::array<char, size>. Added [[nodiscard]] on Trace getters and other functions so that the compiler generates warnings if the output is not used. Helper structs for low-level functions that have similar parameters (prevent mixing up parameters -> prevent bugs). Use of std::move for io_error instead of const reference.
- Loading branch information
Showing
12 changed files
with
332 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
|
||
# Any compressed files | ||
*.tar.gz | ||
*.tgz | ||
|
||
# Static analysis stuff | ||
.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/dash | ||
base=$(pwd) | ||
# Cleanup | ||
if [ -e "$base/build/debug/gcc" ]; then | ||
rm -rf "$base/build/debug/gcc" | ||
fi | ||
# Prepare to build | ||
cmake --preset gcc-debug | ||
# Prepare coverity scan | ||
cd ./build/debug/gcc || exit | ||
# Make sure it only captures the sac_format.hpp/.cpp pair for the library | ||
cov-configure --config cov-conf/cov.xml --compiler g++ --comptype g++ \ | ||
--template --xml-option=skip_file:".*/_deps/.*" \ | ||
--xml-option=skip_file:".*/utests.cpp" \ | ||
--xml-option=skip_file:".*/benchmark.cpp" \ | ||
--xml-option=skip_file:".*/list_sac.cpp" | ||
# Capture the ninja build | ||
cov-build --config cov-conf/cov.xml --dir cov-int ninja | ||
# Package for submission | ||
tar czf sac-format.tgz cov-int | ||
# Move to base dir | ||
mv ./sac-format.tgz "$base/sac-format.tgz" | ||
# Return home | ||
cd "$base" || exit |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
* Inbox | ||
** [2023-11-21 Tue 12:16] | ||
Running clang-tidy locally prior to GitHub | ||
~clang-tidy --checks="bugprone-a*,bugprone-b*,bugprone-c*,bugprone-d*,bugprone-em*,bugprone-ex*,bugprone-f*,bugprone-i*,bugprone-l*,bugprone-m*,bugprone-n*,bugprone-o*,bugprone-p*,bugprone-r*,bugprone-s*,bugprone-t*,bugprone-u*,bugprone-v*,performance-*,readability-a*,readability-b*,readability-c*,readability-d*,readability-e*,readability-f*,readability-i*,readability-m*,readability-n*,readability-o*,readability-q*,readability-r*,readability-si*,readability-st*,readability-u*,portability-*,clang-analyzer-*,cppcoreguidelines-avoid-ca*,cpp-coreguidelines-avoid-co*,cpp-coreguidelines-avoid-d*,cpp-coreguidelines-avoid-g*,cpp-coreguidelines-avoid-n*,cpp-coreguidelines-avoid-r*,cpp-coreguidelines-i*,cpp-coreguidelines-m*,cpp-coreguidelines-n*,cpp-coreguidelines-o*,cpp-coreguidelines-pr*,cpp-coreguidelines-pro-bounds-p*,cpp-coreguidelines-pro-t*,cpp-coreguidelines-r*,cpp-coreguidelines-s*,cpp-coreguidelines-v*" --extra-arg="-std=c++20" -p ./compile_commands.json src/sac_format.cpp~ | ||
** [2023-11-21 Tue 10:16] | ||
Prior to =git add -A= be sure to run =clang-format= on all *.cpp and *.hpp files! | ||
|
||
~clang-format -style=file -i src/sac_format.cpp~ | ||
|
||
** Alternative check | ||
|
||
*NOTE* excluding: modernize-use-trailing-return-type because trailing return | ||
types are silly. Just use type function() {}, instead of auto function -> type | ||
{}. | ||
|
||
~clang-tidy --checks="bugprone-*,performance-*,readability-*,portability-*,clang-analyzer-*,cpp-coreguidelines-*,modernize-a*,modernize-c*,modernize-d*,modernize-l*,modernize-m*,modernize-p*,modernize-r*,modernize-s*,modernize-t*,modernize-un*,modernize-use-a*,modernize-use-b*,modernize-use-c*,modernize-use-d*,modernize-use-e*,modernize-use-n*,modernize-use-o*,modernize-use-s*,modernize-use-tran*,modernize-use-u*" --extra-arg="-std=c++20" -p ./compile_commands.json src/sac_format.cpp~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.