1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

cpplintをお試し利用する

Posted at

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

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?