Configuring Comment Indenting

The desired indenting of comments can vary depending on where the comment occurs.

There are currently two options for configuring indents.

Option

Values

Default

Description

align_with_end_of_declarative_part

<boolean>

False

  • True = Sets indent to current indent level.

  • False = Sets indent to next indent level.

align_with_end_of_statement_part

<boolean>

False

  • True = Sets indent to current indent level.

  • False = Sets indent to next indent level.

This is an example of how to configure these options.

indent:
  options:
    comment:
      align_with_end_of_declarative_part: False
      align_with_end_of_statement_part: False

The following code snippet is used for all examples.

architecture rtl of fifo is

  signal a : std_logic;
      -- end of signal declarations

begin

  o_output <= a;
      -- end of output assignments

end architecture rtl;

Example: align_with_end_of_declarative_part set to True

The align_with_end_of_declarative_part option controls the indent of comments at the end of a declarative part. Setting this option to True will set the indent of the comment to the previous indent level.

architecture rtl of fifo is

  signal a : std_logic;
  -- end of signal declarations

begin

  o_output <= a;
      -- end of output assignments

end architecture rtl;

Example: align_with_end_of_declarative_part set to False

The align_with_end_of_declarative_part option controls the indent of comments at the end of a declarative part. Setting this option to False will set the indent of the comment to the next indent level.

architecture rtl of fifo is

  signal a : std_logic;
-- end of signal declarations

begin

  o_output <= a;
      -- end of output assignments

end architecture rtl;

Example: align_with_end_of_statement_part set to True

The align_with_end_of_statement_part option controls the indent of comments at the end of a statement part. Setting this option to True will set the indent of the comment to the previous indent level.

architecture rtl of fifo is

  signal a : std_logic;
      -- end of signal declarations

begin

  o_output <= a;
  -- end of output assignments

end architecture rtl;

Example: align_with_end_of_statement_part set to False

The align_with_end_of_statement_part option controls the indent of comments at the end of a statement part. Setting this option to False will set the indent of the comment to the next indent level.

architecture rtl of fifo is

  signal a : std_logic;
      -- end of signal declarations

begin

  o_output <= a;
-- end of output assignments

end architecture rtl;

Rules Enforcing Comment Indenting