Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use CPPLint in Eclipse CDT

📅 2015-Jan-08 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Errors found by CPPLint in Eclipse CDT
Errors found by CPPLint in Eclipse CDT

CPPLint is a tool created by Google that can be used to check a C++ source or header file. It is a single file Python script. It would be nice to apply CPPLint on a C++ file in Eclipse CDT whenever it is saved. This is possible by using the CPPStyle plugin for Eclipse. It runs cpplint.py on a saved C++ file and displays the reported errors conveniently in a Problems view, as shown in screenshot above.

$ sudo curl -L "http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py" -o /usr/bin/cpplint.py
$ sudo chmod a+x /usr/bin/cpplint.py

Tried with: CPPStyle 1.0.0 and Eclipse Luna 4.4.1