Tools for enforcing coding standard



  • I'm looking for a tool to enforce coding standard. Preferably a open source tool, which can be used on Windows. Maybe even integration with Visual studio, but an external tool will also be just fine.

    Does Qt have some kind of system for this?

    Anyone has any ideas on this?



  • I'm not sure what you mean by enforce, I'm not an expert of this kind of thing, but I use Uncrustify which is a Qt add in, which is a very configurable source code beautifier. It doesn't enforce, you need to choose to run it, but is extremely configurable.

    You have to download the executable and ensure the configuration for the add in points to the configuration file.

    It works with C, C++, C# and a few other languages.

    It is cross platform, the web site suggests it is tested on XP, and I use it on Linux and I think I have also used it on W7. I don't know if it can be used in VS though.



  • Thanks for the reply mikeosoft.

    Well, enforcing might be a bit strict, but I want to analyze the code to see if it matches our coding standard.

    I will take a look a Uncrustify.



  • Uncrustify seems to me more like a tool to make the code look neat, setting indentation, brancing etc.

    I would like to go a little bit further, checking for naming conventions, naming of Classes, member function and variables etc. Is there a way to do this with Uncrustify?



  • I don't think you will be able to get it with uncrustify.
    You may try to use "Clang Tools":http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html#using-clang-tools


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.