vhdl-style-guide icon indicating copy to clipboard operation
vhdl-style-guide copied to clipboard

sequential_004 should allow alignment configuration

Open staerz opened this issue 3 years ago • 6 comments

Is your feature request related to a problem? Please describe. This rule checks the alignment of multiline sequential statements but doesn't allow any configuration.

Other rules like concurrent_009 do allow such a configuration (what is the exact difference between sequential_004 and concurrent_009?).

Similar to #499.

Describe the solution you'd like I'd like to be able to configure the alignment to follow a default 2-spaces indentation.

Describe alternatives you've considered Not caring.

Related documentation typo

The rule concurrent-006 links to the "Configuring Keyword Alignment Rules". The link is not the direct link (it seems - or is it intended to link to the configuration overview page?). The page's URL is https://vhdl-style-guide.readthedocs.io/en/latest/configuring_conditional_expressions.html. Note that the filename differs from its title. This might be sth. to be made consistent.

staerz avatar Dec 16 '21 15:12 staerz

Would having the same configuration options as concurrent_009 be sufficient?

jeremiah-c-leary avatar Jan 01 '22 22:01 jeremiah-c-leary

Hi @jeremiah-c-leary,

I would say that this would make sense.

Again, as mentioned in the issue description, I'm actually not super sure to understand the difference between sequential_004 and concurrent_009. Is it that a simple signal assignment statement would classify as sequential_004 and as soon as I add a when condition, it turns into concurrent_009? Or does the first require to be within a process statement?

The key of my question is if they couldn't be the same rule.

Please note that I also updated the issue description: While checking I found a minor bug in the documentation.

staerz avatar Jan 03 '22 15:01 staerz

Hey @staerz,

Again, as mentioned in the issue description, I'm actually not super sure to understand the difference between sequential_004 and concurrent_009. Is it that a simple signal assignment statement would classify as sequential_004 and as soon as I add a when condition, it turns into concurrent_009? Or does the first require to be within a process statement?

After researching a little, it looks like my multiline rules are a bit a of a mess.

image

Where:

  • multiline_alignment_between_tokens = base rule which multiple rules can extend
  • unique = implementation is only in that rule
  • alignment = rule performs alignment
  • structure = rule modifies the format of the code

I might be able to merge the options wrap_at_when, align_when_keywords and align_else_keywords into the multiline_alignment_between_tokens base rule. Then I could continue to extend the base rule to cover additional LRM Entities.

I need to ponder this for a bit.

--Jeremy

jeremiah-c-leary avatar Feb 13 '22 14:02 jeremiah-c-leary

Yes, I would agree to unification here: All these are structural language elements where the same rules can apply (and should).

If you can hence manage to define a base rule and derive just the particular rules basically by the LRM keyword kicking in to catch up that base rule, that would be most consistent.

staerz avatar Feb 14 '22 15:02 staerz

Hey @staerz ,

Since the updates for this issue are the same for variable_assignments, I was going to do updates for this issue on issue #549.

We can close this issue when we close the other issue.

--Jeremy

jeremiah-c-leary avatar Oct 08 '22 19:10 jeremiah-c-leary

Yes, that sounds very fair to me and also funnels the discussion to one issue only.

staerz avatar Oct 11 '22 12:10 staerz