[c++] A free tool to check C/C++ source code against a set of coding standards?

It looks quite easy to find such a tool for Java (Checkstyle, JCSC), but I can't seem to find one for C/C++. I am not looking for a lint-like static code analyzer, I only would like to check against coding standards like variable naming, capitalization, spacing, identation, bracket placement, and so on.

This question is related to c++ c coding-style

The answer is


Check universalindentgui on sourceforge.net.

it has many style checkers for C and you can customise the checkers.


Check out Abraxas Code Check http://www.abxsoft.com/codchk_user.html


Check Metrix++ http://metrixplusplus.sourceforge.net/. It may require some extensions which are specific for your needs.


Check out Abraxas Code Check http://www.abxsoft.com/codchk_user.html


Check universalindentgui on sourceforge.net.

it has many style checkers for C and you can customise the checkers.


There is cppcheck which is supported also by Hudson via the plugin of the same name.


I'm sure this could help to some degree cxx checker. Also this tool seems to be pretty good KWStyle It's from Kitware, the guys who develop Cmake.


Not exactly what you ask for, but I've found it easier to just all agree on a coding standard astyle can generate and then automate the process.


Check Metrix++ http://metrixplusplus.sourceforge.net/. It may require some extensions which are specific for your needs.


Check universalindentgui on sourceforge.net.

it has many style checkers for C and you can customise the checkers.


There's a list. There is also a putative C++ frontend on splint.



Not exactly what you ask for, but I've found it easier to just all agree on a coding standard astyle can generate and then automate the process.


I'm currently working on a project with another project to write just such a tool. I looked at other static code analysis tools and decided that I could do better.

Unfortunately, the project is not yet ready to be used without fairly intimate knowledge of the code (read: it's buggy as all hell). However, we're moving fairly quickly, and hope to have a beta release within the next 8 weeks.

The project is open source - you can visit the project page, and if you want to get involved, we'd love some more external input.

I won't bore you with the details - you can visit the project page for that, but I will say one thing: Most static code analysis tools are aimed at checking your code for mistakes, and not very concerned with checking for coding guidelines. We have taken a more flexible approach that allows us to write plugiins to check for both "house rules" as well as possible bugs.

If you want any more information, please don't hesitate to contact me.

Cheers,


There's a list. There is also a putative C++ frontend on splint.


I have used a tool in my work its LDRA tool suite

It is used for testing the c/c++ code but it also can check against coding standards such as MISRA etc.


I'm sure this could help to some degree cxx checker. Also this tool seems to be pretty good KWStyle It's from Kitware, the guys who develop Cmake.


I'm currently working on a project with another project to write just such a tool. I looked at other static code analysis tools and decided that I could do better.

Unfortunately, the project is not yet ready to be used without fairly intimate knowledge of the code (read: it's buggy as all hell). However, we're moving fairly quickly, and hope to have a beta release within the next 8 weeks.

The project is open source - you can visit the project page, and if you want to get involved, we'd love some more external input.

I won't bore you with the details - you can visit the project page for that, but I will say one thing: Most static code analysis tools are aimed at checking your code for mistakes, and not very concerned with checking for coding guidelines. We have taken a more flexible approach that allows us to write plugiins to check for both "house rules" as well as possible bugs.

If you want any more information, please don't hesitate to contact me.

Cheers,


There is cppcheck which is supported also by Hudson via the plugin of the same name.


I have used a tool in my work its LDRA tool suite

It is used for testing the c/c++ code but it also can check against coding standards such as MISRA etc.


Try nsiqcppstyle. It's a Python based coding style checker for C/C++. It's easy to extend to add your own rules.


There's a list. There is also a putative C++ frontend on splint.


Try nsiqcppstyle. It's a Python based coding style checker for C/C++. It's easy to extend to add your own rules.


Check universalindentgui on sourceforge.net.

it has many style checkers for C and you can customise the checkers.


I have used a tool in my work its LDRA tool suite

It is used for testing the c/c++ code but it also can check against coding standards such as MISRA etc.


Not exactly what you ask for, but I've found it easier to just all agree on a coding standard astyle can generate and then automate the process.



I have used a tool in my work its LDRA tool suite

It is used for testing the c/c++ code but it also can check against coding standards such as MISRA etc.


There's a list. There is also a putative C++ frontend on splint.


Examples related to c++

Method Call Chaining; returning a pointer vs a reference? How can I tell if an algorithm is efficient? Difference between opening a file in binary vs text How can compare-and-swap be used for a wait-free mutual exclusion for any shared data structure? Install Qt on Ubuntu #include errors detected in vscode Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error How to fix the error "Windows SDK version 8.1" was not found? Visual Studio 2017 errors on standard headers How do I check if a Key is pressed on C++

Examples related to c

conflicting types for 'outchar' Can't compile C program on a Mac after upgrade to Mojave Program to find largest and second largest number in array Prime numbers between 1 to 100 in C Programming Language In c, in bool, true == 1 and false == 0? How I can print to stderr in C? Visual Studio Code includePath "error: assignment to expression with array type error" when I assign a struct field (C) Compiling an application for use in highly radioactive environments How can you print multiple variables inside a string using printf?

Examples related to coding-style

Method Call Chaining; returning a pointer vs a reference? 80-characters / right margin line in Sublime Text 3 Cannot find reference 'xxx' in __init__.py - Python / Pycharm How to stick <footer> element at the bottom of the page (HTML5 and CSS3)? Simple way to create matrix of random numbers Is calling destructor manually always a sign of bad design? Count all values in a matrix greater than a value Iterate through a C++ Vector using a 'for' loop Which comment style should I use in batch files? Dictionaries and default values