cpplint

How to use cpplint code style checking with CMake?

为君一笑 提交于 2021-02-18 19:19:48
问题 The only online resources I have found are the CMake documentation on CMAKE_<LANG>_CPPLINT (link here) and this example (link here), but I cannot figure out how to actually use it inside a CMakeLists.txt file. I tried the example provided, but I can't make it work. FYI, I installed cpplint as explained here. As of now, I can run the cpplint python script inside CMakeLists.txt using this CMake command: execute_process(COMMAND cpplint path/To/File/To/Analyse.cpp) However, I am pretty sure that

How to use cpplint code style checking with CMake?

橙三吉。 提交于 2021-02-18 19:18:13
问题 The only online resources I have found are the CMake documentation on CMAKE_<LANG>_CPPLINT (link here) and this example (link here), but I cannot figure out how to actually use it inside a CMakeLists.txt file. I tried the example provided, but I can't make it work. FYI, I installed cpplint as explained here. As of now, I can run the cpplint python script inside CMakeLists.txt using this CMake command: execute_process(COMMAND cpplint path/To/File/To/Analyse.cpp) However, I am pretty sure that

CPP lint: Can you enforce use of this for class variables?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 20:16:51
问题 Is there a lint script that will enforce use of this for class variables? Ex - class A { int var1; void func() { return var1; } } should be - class A { int var1; void func() { return this->var1; } } 来源: https://stackoverflow.com/questions/48186162/cpp-lint-can-you-enforce-use-of-this-for-class-variables

Google's style guide about input/output parameters as pointers

╄→尐↘猪︶ㄣ 提交于 2019-12-22 03:51:16
问题 The Google C++ Style Guide draws a clear distinction (strictly followed by cpplint.py) between input parameters(→ const ref, value) and input-output or output parameters (→ non const pointers) : Parameters to C/C++ functions are either input to the function, output from the function, or both. Input parameters are usually values or const references, while output and input/output parameters will be non-const pointers. And further : In fact it is a very strong convention in Google code that