cpplintについて
C/C++コードに対して、Google C++コーディングスタイルに準じたチェックを行うツールのようです。
https://github.com/cpplint/cpplint
Cpplint is a command-line tool to check C/C++ files for style issues following Google's C++ style guide.
install
$ pip3 install cpplint
チェック
hello.c
# include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
Copyrightがない
と指摘されました。
$ cpplint hello.c
hello.c:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]
Done processing hello.c
Total errors found: 1
再チェック
// Copyright 2021 seigot. All rights reserved.
# include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
無事に指摘がなくなりました。
$ cpplint hello.c
Done processing hello.c
参考
https://github.com/cpplint/cpplint
https://pypi.org/project/cpplint
http://www.itsenka.com/contents/development/c/helloworld.html