C++Test Rule for indentation

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in C/C++test
Checking indentation level for public/protected/private & switch c
Hi all,

Does anybody have a C++Test rule to check the indentation level of public/protected/private keywords and switch cases?

Our coding standard requires these to be in the following form:

CODE
class MyClass
{
public:
   int foo(int x);
protected:
private:
   int bar;
}

Switch cases:

CODEswitch (bar)
{
case 1:
   foo(1);
   break;
case 2:
   foo(3);
   break;
default:
   foo(5);
   break;
}

Thanks in advance.

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hello aarslan,


    Please view our Formatting rules we do have quite a few that could help:

    For switches please view
    FORMAT-37
    FORMAT-27
    FORMAT-36

    and we also have
    FORMAT-38

    Thank you,
    Techie2
  • LegacyForumLegacyForum Posts: 1,669 ✭✭

    Hello aarslan,


    Please view our Formatting rules we do have quite a few that could help:

    For switches please view
    FORMAT-37
    FORMAT-27
    FORMAT-36

    and we also have
    FORMAT-38

    Thank you,
    Techie2

    Hi techie2,

    I have updated them to check many of our indentation related coding standard items, however it is really not trivial to change them to fit my requirements.
Sign In or Register to comment.