Skip to content

Extend rule concurrent_009 for manually broken lines #1456

@benthie

Description

@benthie

Is your feature request related to a problem? Please describe.

When it comes to long lines, I sometimes want to break long concurrent assignments like this:

architecture a of b is

begin
  
  -- Breaking the long assignment like this ensures the length limit of 120 
  -- characters is met.
  my_very_long_concurrent_011_signal <=
      my_very_long_concurrent_003_signal(my_long_port_name_vector'length -1 downto 0) when select_value = '0' else
      my_very_long_concurrent_003_signal(3 downto 0);

end architecture a;

For this to work concurrent_011, which enforces no new line after assignment operator, must be disabled.

However, concurrent_009 either has to be disabled as well, or align_left has to be set to yes. The problem is, that I would like to have the rule enabled and align_left set to no, so that the following format is nicely enforced:

architecture a of b is

begin

  my_concurrent_009_signal <= '0' when select_value = "1001" and foo = '0' else
                              '1';

end architecture a;

Which ultimately destroys the desired formatting of the first example. And the result again violates the line length limit of 120 characters.

architecture a of b is

begin

  -- Line exceeds line length limit!
  my_very_long_concurrent_011_signal <=
                                        my_very_long_concurrent_003_signal(my_long_port_name_vector'length -1 downto 0) when select_value = '0' else
                                        my_very_long_concurrent_003_signal(3 downto 0);

end architecture a;

Describe the solution you'd like

architecture a of b is

begin
  
  -- This works
  my_very_long_concurrent_011_signal <=
      my_very_long_concurrent_003_signal(my_long_port_name_vector'length -1 downto 0) when select_value = '0' else
      my_very_long_concurrent_003_signal(3 downto 0);

  -- And this also works at the same time
  my_concurrent_009_signal <= '0' when select_value = "1001" and foo = '0' else
                              '1';

end architecture a;

With an additional value for align_left, e.g. on_new_line_after_assign one could enable this behavior. In the code we can check if the assignment is on a new line and if so, enforce left alignment.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions