-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forcing single space when disabling alignment rules #1186
Comments
Evening @maltaisn , There is typically a rule for whitespace that corresponds to an alignment rule. To enforce a single space before the colon, change the "rule": {
"port_020": {
"number_of_spaces" : 1
}
} Regards, --Jeremy |
I didn't know about this rule. However I haven't found equivalent rules for those I have disabled:
|
Evening @maltaisn , Whitespace rules are assigned to the lowest production in the LRM as possible. In most of the cases you listed, the alignment rule is at a "higher" production than the whitespace rule. This section of the documentation covers the thoughts behind this method. For example: architecture_029The rules for whitespace before the identifiers are in rules declarative_part_400The rules for whitespace before default assignment tokens are in rules entity_018There is rule instantiation_010There are no rules to handle the whitespace before the assignment in port maps or generic maps. process_400There is a rule component_017The assumption was port clauses would be formatted the same regardless of where they are located. I will have to think about a way forward on this. I will add rules to cover whitespace before assignments in port maps and generic maps. If you could configure the other rules I have identified and let me know how they work out for you or if I am missing anything. --Jeremy |
Afternoon @maltaisn , I have added more whitespace rules: = architecture_029 = declarative_part_400 = entity_018 = instantiation_010 = process_400 = component_017 Could check out the rules I have implemented on the Thanks, --Jeremy |
Alignment can be interesting to have for entity declarations, signals, etc., but I prefer to leave it aside for a few things, like component declarations, assignments, etc., to improve version control diffs. As such, I disabled a few alignment rules.
However, while formatting a whole repository, I found many cases where an attempt an alignment was made in the past, but not kept up-to-date with new changes. I would like to normalize these cases by removing extra spaces and leaving only one, but it seems there's no option to do it.
For example:
Would become:
I'm not sure what would be the best way to describe this in the configuration since there are many different cases for alignment. In a way, this means devolving alignment rules to whitespace rules with a number of spaces setting.
The text was updated successfully, but these errors were encountered: