If there's no error from cpplint, it shouldn't print anything to the console
I am testing out CMAKE_CXX_CPPLINT
, and I think one improvement can be done is if there's no error from cpplint, the compilation output should be silent. Please see below minimal example.
main.cpp
// Copyright Jason 2019
int main() {
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.11)
project(sample)
add_executable(${PROJECT_NAME} main.cpp)
after mkdir build && cd build
, run cmake "-DCMAKE_CXX_CPPLINT=/usr/local/cpplint" ..
, and then make -j
, the output is
Scanning dependencies of target sample
[ 50%] Building CXX object CMakeFiles/sample.dir/main.cpp.o
Warning: cpplint diagnostics:
Done processing /home/ubuntu/test/main.cpp
[100%] Linking CXX executable sample
[100%] Built target sample
as you can see no error occurred yet cpplint still prints out something. When I did the same thing with CMAKE_CXX_CLANG_TIDY
it didn't print anything as long as the code passes the test. Can we make it the same way for CMAKE_CXX_CPPLINT
? So it becomes like
Scanning dependencies of target sample
[ 50%] Building CXX object CMakeFiles/sample.dir/main.cpp.o
[100%] Linking CXX executable sample
[100%] Built target sample