ifindent

ifindent: IF statement with inconsistent indenting

This page is only a quick overview of this rule, for more details see "ifindent-details".

Rule "ifindent" will by default not run, because it is not listed in file prolint/rules/rules.d.
Instead, the rules ifindent1 and
ifindent2 are listed by default, these two rules include the entire source of "ifindent".

If you plan to use both "ifindent1" and "ifindent2", you may consider to use "ifindent" instead because it will perform better.


In that case, follow these steps:

  1. copy prolint/rules/ifindent1.p to prolint/custom/rules/ifindent1.p
  2. remove all of the contents from prolint/custom/rules/ifindent1.p but be sure to keep the parameters: include

    {prolint/core/ruleparams.i}

  3. create a file prolint/custom/rules/rules.d similar to prolint/rules/rules.d and make sure it contains a reference to "infindent1".

    You now have a stub override for ifindent1.p.

  4. Repeat steps 1-3 for ifindent2.p
  5. copy prolint/rules/ifindent1.p to prolint/custom/rules/ifindent.p
  6. include {prolint/rules/ifindent.p} in prolint/custom/rules/ifindent.p, remove all other lines.
  7. add "ifindent" to file prolint/custom/rules/rules.d

How to suppress warnings:



You can put the directive {&_proparse_ prolint-nowarn(ifindent)} directly before
the IF statement. See also: suppress warnings.

implementation:
This rule is implemented in Turbolint.