Configuring Multiline Indent Rules¶
There are rules which will check indent of multiline expressions and conditions.
There are several options to these rules:
Method | Type | Default | Description |
---|---|---|---|
align_left | string | “yes” | “yes” = New lines will be aligned left. “no” = Align to right of assignment operator. |
align_paren | string | “no” | “yes” = Use open parenthesis for alignment. “no” = Do not use open parenthesis for alignment. |
This is an example of how to configure the option.
rule :
constant_012:
align_left : "no"
align_paren : "yes"
Note
All examples below are using the rule constant_012.
Example: align_left “yes”, align_paren “no”¶
The following code would fail with this option:
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
The following code would pass with this option:
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
Example: align_left “no”, align_paren “no”¶
The following code would fail with this option:
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
The following code would pass with this option:
constant c_const : t_type :=
(
(
a => 0,
b => 1
),
(
c => 0,
d => 1
)
);
Example: align_left “yes”, align_paren “yes”¶
The following code would fail with this option:
constant c_const : t_type := (
1 => func1(
G_GENERIC1, G_GENERIC2)
);
The following code would pass with this option:
constant c_const : t_type := (
1 => func1(
G_GENERIC1, G_GENERIC2)
);