|
-
September 11th, 2014, 10:58 AM
#1
Code Style Checking Tool
Hi,
Are there any good free or commercial software that can check the C++ code style and find any codelines that violate a given code style specification? For example, whether the codeline is indented proplery, whether the variable is using Hungarian naming notation?
Thanks
-
September 12th, 2014, 01:40 AM
#2
Re: Code Style Checking Tool
Why don't you ask google about this?
PS. After decades of programming I never was in a situation when paranoid requirements to code style were in effect.
Best regards,
Igor
-
September 12th, 2014, 03:11 AM
#3
Re: Code Style Checking Tool
 Originally Posted by Igor Vartanov
PS. After decades of programming I never was in a situation when paranoid requirements to code style were in effect.
Me neither!
Victor Nijegorodov
-
September 12th, 2014, 06:45 AM
#4
Re: Code Style Checking Tool
there are "lint" type checkers which do static code analysis
like http://cppcheck.sourceforge.net/
they also have "style" checks, but that's not really about indents, type annotation, and/or expected casing. it's more to do about code design issues that will probably lead you to actual errors, but that aren't necessarily wrong per se.
if you are concerned about the actual aesthetics of the code, then there are to my knowledge no checkers, but there are code (re)stylers which will take a source and format it according to desire.
I'm not sure if any of them actually do hungarion annotation changes however.
have a look on google for "code beautifier"
-
September 12th, 2014, 12:13 PM
#5
Re: Code Style Checking Tool
-
September 12th, 2014, 01:38 PM
#6
Re: Code Style Checking Tool
 Originally Posted by AlanCCC
Hi,
Are there any good free or commercial software that can check the C++ code style and find any codelines that violate a given code style specification? For example, whether the codeline is indented proplery, whether the variable is using Hungarian naming notation?
Thanks
Why do you need to check coding style to this detail? IME development teams have a coding style to which they should adhere (eg where to put {}, use of capitals, underscore etc in names etc etc) and any flagrant breaches are picked up as part of code review and then discussed with the individual concerned. Why do you want a tool to check coding style? How detailed is your style guidance? To get tabs, spaces, braces etc all looking the same just use a code styler that will format the code according to the rules given to it.
Are you concerned about how the program 'looks' (ie style) or whether good practice c++ code has been used (ie code standard). I could write some ugly awful c++ code but make it look 'nice' that would probably pass a style test but should be rejected by any competent c++ reviewer.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
September 12th, 2014, 03:24 PM
#7
Re: Code Style Checking Tool
 Originally Posted by AlanCCC
Are there any good free or commercial software that can check the C++ code style and find any codelines that violate a given code style specification?
I think it's quite a lot to this,
http://www.tiobe.com/index.php/conte...Standards.html
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|