ifindent1

ifindent1: IF statement with indenting that could indicate a bug

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


When you run rule "infindent1", you are actually running rule "infindent" but without the informational warning messages.

Rule "ifindent1" gives this warning when it finds an IF statement with confusing indentation.

  IF ready THEN              
     ASSIGN 
        a = x
        b = y.
        c = z.                  

It looks like the second statement ( "c = z." ) will only be executed when the IF-condition is true.

the risc:

Confusing layout, the compiler may not do what the programmer intended

how to solve this:

In the given example, the statement "c = z." should have less indentation - same as the IF keyword.

How to suppress these warnings:

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

implementation:
This rule is implemented in Turbolint.