diffkemp
diffkemp copied to clipboard
Cpp code style checking - update `clang-format` config
When using tools/check-clang-format.sh -d in nix develop .#diffkemp-llvm18 shell, the linter reports incorrectly formatted C++ files, these are not reported when using LLVM v17 or lower. This is probably caused by changes in clang-format in v18. We should probably create/update the linter configuration so it behaves the same on all versions. Btw. the reason why this is not reported by CI is that we forgot to update the LLVM version (respectively the nix development shell 'version') on which the code style checking is run in #397.
The reported incorrect formatting.
Checking the format of file diffkemp/simpll/ResultsCache.h
38c38,39
< ResultsCache(std::string cacheDirectory) : cacheDirectory(cacheDirectory){};
---
> ResultsCache(std::string cacheDirectory)
> : cacheDirectory(cacheDirectory) {};
Checking the format of file diffkemp/simpll/ValuePatternComparator.h
42c42
< ParentPattern(ParentPattern){};
---
> ParentPattern(ParentPattern) {};
Checking the format of file diffkemp/simpll/library/SysctlTable.h
43c43
< : Mod(Mod), CtlTable(CtlTable){};
---
> : Mod(Mod), CtlTable(CtlTable) {};
Checking the format of file diffkemp/simpll/Result.h
103c103
< NonFunctionDifference(DiffKind Kind) : Kind(Kind){};
---
> NonFunctionDifference(DiffKind Kind) : Kind(Kind) {};
131c131
< : NonFunctionDifference(SynDiff), syntaxKind(Kind::UNKNOWN){};
---
> : NonFunctionDifference(SynDiff), syntaxKind(Kind::UNKNOWN) {};
Checking the format of file diffkemp/simpll/Logger.h
234c234
< Logger(){};
---
> Logger() {};
Checking the format of file diffkemp/simpll/InstPatternComparator.h
52c52
< ParentPattern(ParentPattern){};
---
> ParentPattern(ParentPattern) {};
Checking the format of file diffkemp/simpll/CustomPatternSet.cpp
145,146c145,146
< LOG("Failed to open difference "
< << "pattern configuration " << ConfigPath << ".\n");
---
> LOG("Failed to open difference " << "pattern configuration "
> << ConfigPath << ".\n");
156,157c156,157
< LOG("Failed to parse difference "
< << "pattern configuration " << ConfigPath << ".\n");
---
> LOG("Failed to parse difference " << "pattern configuration "
> << ConfigPath << ".\n");
259,260c259,260
< LOG("The number of input arguments does not "
< << "match in pattern " << Pat.Name << ".\n");
---
> LOG("The number of input arguments does not " << "match in pattern "
> << Pat.Name << ".\n");
271,272c271,272
< LOG("The number of output instructions does "
< << "not match in pattern " << Pat.Name << ".\n");
---
> LOG("The number of output instructions does " << "not match in pattern "
> << Pat.Name << ".\n");