Closed tossegus closed 2 weeks ago
Evening @tossegus ,
I would agree there is no rule to enforce the behavior you are looking for. The rule instantiation_005
is close, but it will always want to put port map
on it's own line. I am guessing you would want port map
to be moved to it's own line if it was on the same line as the instance declaration?
Violation
U_FIFO : FIFO port map (
U_FIFO : FIFO
generic map (
)
port map (
Fix
U_FIFO : FIFO
port map (
U_FIFO : FIFO
generic map (
) port map (
If so I could add to configuration options with the following defaults:
rules:
instantiation_005:
after__instantiation: "new line"
after_generic_map: "new line"
This would match the current behavior. Then for your formatting the configuration would be:
rules:
instantiation_005:
after_instantiation: "new line"
after_generic_map: "no new line"
Would that update give you the desired formatting?
--Jeremy
Evening @tossegus ,
I would agree there is no rule to enforce the behavior you are looking for. The rule
instantiation_005
is close, but it will always want to putport map
on it's own line. I am guessing you would wantport map
to be moved to it's own line if it was on the same line as the instance declaration?Violation
U_FIFO : FIFO port map ( U_FIFO : FIFO generic map ( ) port map (
Fix
U_FIFO : FIFO port map ( U_FIFO : FIFO generic map ( ) port map (
If so I could add to configuration options with the following defaults:
rules: instantiation_005: after__instantiation: "new line" after_generic_map: "new line"
This would match the current behavior. Then for your formatting the configuration would be:
rules: instantiation_005: after_instantiation: "new line" after_generic_map: "no new line"
Would that update give you the desired formatting?
--Jeremy
Hi!
Yes, that would give me the wanted formatting. 🙂
/ Tossegus
Morning @tossegus ,
I pushed an update for this to the issue-1176
branch. There are two new configuration options that will allow you to add or remove carriage returns depending on what comes before the port map aspect. When you get a chance, could you check it out on your end and let me know if it works for you?
Thanks,
--Jeremy
Good morning!
It looks like it works on my side! 🙂
/ tossegus
Awesome,
I will get this merged to master.
--Jeremy
Hi!
I tried looking for rules regarding the end of the
generic map
in combination with the start of theport map
, but couldn't find any rule that matches what I was looking for (see below).Violation:
Fix:
Describe alternatives you've considered Locally in my project I added a number of consecutive greps to find these violations (which works well), but having the rule directly in VSG would be very much preferred 😄