Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c7f2dfa
add clang-tidy check
electronsandstuff Jan 5, 2026
add99d4
use default cmake for clang-tidy
electronsandstuff Jan 5, 2026
9d2e791
dealing with false positive clang-tidy
electronsandstuff Jan 5, 2026
0735967
setting up script for valgrind testing
electronsandstuff Jan 5, 2026
dc2e590
make clang-tidy optional
electronsandstuff Jan 5, 2026
aad4f57
add debug flags
electronsandstuff Jan 6, 2026
23574ea
starting on clang-tidy issues
electronsandstuff Jan 6, 2026
393b03f
resolve clang-tidy warnings
electronsandstuff Jan 6, 2026
02197e5
more clang-tidy cleanup
electronsandstuff Jan 6, 2026
d0febbf
more cleaning up control flow
electronsandstuff Jan 6, 2026
f6dfc66
more cleanup
electronsandstuff Jan 6, 2026
99d5ae0
more cleanup of `pmd_get_iterations`
electronsandstuff Jan 6, 2026
19d37cd
move caching/file parsing to separate spots
electronsandstuff Jan 6, 2026
a9900d4
cleaning up `pmd_open_iteration`
electronsandstuff Jan 6, 2026
93e807b
resolving memory leaks
electronsandstuff Jan 6, 2026
b607fa7
more valgrind
electronsandstuff Jan 6, 2026
5bee525
fixing memory leaks
electronsandstuff Jan 6, 2026
c1af73b
typo
electronsandstuff Jan 6, 2026
ee51e84
fix directory detection issue
electronsandstuff Jan 6, 2026
3b37350
move deletion code to new function
electronsandstuff Jan 6, 2026
70914c4
cleaning up
electronsandstuff Jan 6, 2026
548cf3c
correctly delete full path to iteration file
electronsandstuff Jan 6, 2026
6efe4e7
continuing to resolve memory leaks
electronsandstuff Jan 6, 2026
7d2514a
resolve memory leaks
electronsandstuff Jan 6, 2026
dfe1411
surpress error messages
electronsandstuff Jan 6, 2026
720c1b9
surpress error messages
electronsandstuff Jan 6, 2026
12edd28
add test for windows path separator in iterationFormat
electronsandstuff Jan 6, 2026
b580e75
normalize path before placing into file
electronsandstuff Jan 6, 2026
212cc10
clean up log statements
electronsandstuff Jan 6, 2026
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
119 changes: 119 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-macro-parentheses,
-bugprone-multi-level-implicit-pointer-conversion,
cert-*,
-cert-err34-c,
-cert-dcl50-cpp,
google-*,
-google-readability-braces-around-statements,
-google-readability-todo,
-google-readability-casting,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-misc-use-anonymous-namespace,
-misc-no-recursion,
-misc-definitions-in-headers,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-equal-delete,
-modernize-use-nodiscard,
-modernize-use-nullptr,
-modernize-use-override,
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-enum-size,
portability-*,
readability-*,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
-readability-uppercase-literal-suffix

# Treat important categories as errors (customize as needed)
WarningsAsErrors: >
bugprone-*,
cert-*,
misc-*,
performance-*

# Only apply checks to YOUR project headers (not third-party)
HeaderFilterRegex: 'parcel.h'

# Don't apply automatic formatting fixes
FormatStyle: none

# Configuration for specific checks
CheckOptions:
# Naming conventions
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroCase
value: UPPER_CASE
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberIgnoredRegexp
value: '^_.*'

# Function length limits
- key: readability-function-size.LineThreshold
value: '500'
- key: readability-function-size.StatementThreshold
value: '300'

# Performance tuning
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'false'
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: 'true'
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ''

# Enhanced const correctness for better optimization
- key: misc-const-correctness.AnalyzeValues
value: 'true'
- key: misc-const-correctness.AnalyzeReferences
value: 'true'
- key: misc-const-correctness.WarnPointersAsValues
value: 'false'
- key: misc-const-correctness.TransformValues
value: 'true'
- key: misc-const-correctness.TransformReferences
value: 'true'

# Bounds checking for array operations
- key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
value: ''
- key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
value: 'llvm'

# Modernize settings
- key: modernize-use-default-member-init.UseAssignment
value: 'true'

# Misc settings
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
value: 'true'
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,30 @@ add_library(unity STATIC
)
target_include_directories(unity PUBLIC Unity-2.6.1)
target_compile_definitions(unity PUBLIC UNITY_INCLUDE_DOUBLE)
# Disable clang-tidy for third-party code
set_target_properties(unity PROPERTIES CXX_CLANG_TIDY "")
set_target_properties(unity PROPERTIES C_CLANG_TIDY "")

# Setup clang-tidy (must be before add_subdirectory)
option(CLANG_TIDY "Run clang-tidy everytime the program is built" Off)
if(CLANG_TIDY)
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
if(CLANG_TIDY_EXE)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}")
else()
message(WARNING "clang-tidy not found")
endif()
endif()

option(DEBUG "Enable debug flags" Off)
if(DEBUG)
add_compile_options(-g)
endif()

# Enable testing
enable_testing()

# Add tests subdirectory
add_subdirectory(tests)

3 changes: 3 additions & 0 deletions leak-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# valgrind --leak-check=full --show-leak-kinds=all ./build/tests/test_read
valgrind --leak-check=full --show-leak-kinds=all ./build/tests/test_write
# valgrind --leak-check=full --show-leak-kinds=all ./build/tests/test_read_write
Loading
Loading