aliceo2group / o2codechecker Goto Github PK
View Code? Open in Web Editor NEWAliceO2 Custom Static Analysis Tools
AliceO2 Custom Static Analysis Tools
When constructing a transformed compilations database, we need to make sure to eliminate duplicate entries.
I can't see custom rules aliceO2-member-name
in the compiled product.
# ./tool/O2codecheck -checks="-*,al*" --list-checks
Enabled checks:
altera-id-dependent-backward-branch
altera-kernel-name-restriction
altera-single-work-item-barrier
altera-struct-pack-align
altera-unroll-loops
export LLVM_HOME=/path/to/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04
export CMAKE_HOME=/path/to/cmake-3.28.0-rc3
export GCC_HOME=/path/to/gcc-9.1.0/
export CC=$GCC_HOME/bin/gcc
export CXX=$GCC_HOME/bin/g++
export LD_LIBRARY_PATH=$LLVM_HOME/lib:$GCC_HOME/lib64:$LD_LIBRARY_PATH
export PATH=$GCC_HOME/bin:$CMAKE_HOME/bin/:$PATH
mkdir build
cd build/
cmake -DLLVM_DIR=$LLVM_HOME/lib/cmake/llvm -DClang_DIR=$LLVM_HOME/lib/cmake/clang/ ../
make -j8
cd build
./tool/O2codecheck -checks="-*,al*" --list-checks
I tried running run_O2CodeChecker.py with the -fix option on the ReadoutCard library (master branch).
This resulted in anonymous namespaces being broken by having their opening bracket removed.
For example, code like:
namespace {
// some stuff in here
}
is turned into:
namespace
// some stuff in here
}
The command I used was
run_O2CodeChecker.py -clang-tidy-binary `which O2codecheck` -checks=-*,modernize-*,-modernize-use-default,-modernize-pass-by-value,-modernize-use-auto,-modernize-use-bool-literals,-modernize-use-using,-modernize-loop-convert,-modernize-use-bool-literals,-modernize-make-unique,aliceO2-member-name,alice* -fix
Getting too many reports from headers outside of O2. The header filter does not seem to work as wanted. The proposition is to code a function isFileNameMatching(regex)
... and exit checks early if not.
Hi,
Just trying to get my feet wet with the o2codechecker ...
At first I'd like to use it on a single file/class where I've put on purpose a member name starting with "f' instead of "m", and I find the output of the tool quite verbose. Is there a way to tame the verbosity and get the output more "to the point" ? Or is it that the command I'm using is not correct ?
Thanks,
[o2codechecker/latest-release] ~/alice/o2-dev/alo/mapping/impl2 %> run_O2CodeChecker.py -clang-tidy-binary $(which O2codecheck) -p $HOME/alice/sw/BUILD/alo-latest-clion/alo "-checks=-*,alice*" segmentationImpl2.*
['/Users/laurent/alice/sw/osx_x86-64/o2codechecker/master-2/bin/O2codecheck', '-list-checks']
Enabled checks:
aliceO2-SizeOf
aliceO2-member-name
aliceO2-namespace-naming
/Users/laurent/alice/sw/osx_x86-64/o2codechecker/master-2/bin/O2codecheck -header-filter=^/Users/laurent/alice/sw/BUILD/alo-latest-clion/alo/.* -checks=-*,alice* -p=/Users/laurent/alice/sw/BUILD/alo-latest-clion/alo /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx
/Users/laurent/alice/sw/osx_x86-64/o2codechecker/master-2/bin/O2codecheck -header-filter=^/Users/laurent/alice/sw/BUILD/alo-latest-clion/alo/.* -checks=-*,alice* -p=/Users/laurent/alice/sw/BUILD/alo-latest-clion/alo /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx
229 warnings and 1 error generated.
Error while processing /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx.
229 warnings and 1 error generated.
Error while processing /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx.
458 warnings and 2 errors generated.
Error while processing /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx.
/Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.h:84:9: error: field declaration 'fWrong' does not match naming rule [aliceO2-member-name]
int fWrong;
^
mWrong
/Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.h:84:9: error: field declaration 'fWrong' does not match naming rule [aliceO2-member-name]
int fWrong;
^
mWrong
Suppressed 458 warnings (458 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
458 warnings and 2 errors generated.
Error while processing /Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.cxx.
/Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.h:84:9: error: field declaration 'fWrong' does not match naming rule [aliceO2-member-name]
int fWrong;
^
mWrong
/Users/laurent/alice/o2-dev/alo/mapping/impl2/segmentationImpl2.h:84:9: error: field declaration 'fWrong' does not match naming rule [aliceO2-member-name]
int fWrong;
^
mWrong
Suppressed 458 warnings (458 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.