-
Notifications
You must be signed in to change notification settings - Fork 511
Add code formatting option for lining up assignment operators in DSC configurations #672
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
Comments
Folks also tend to do this with hashtables (especially when constructing one to splat into another command). |
I think this rule would be a great addition to our existing set of rules. But do we want to limit ourselves just to Configurations or Hashtables? Should it be general enough that whenever there are consecutive assignment statements, it should take effect? Or maybe we can provide options wherein the user can select if they want to line up only property value pairs or consecutive assignment statements. |
I would prefer options, as I do not line the equal signs up, and would prefer not to be forced to. |
@kapilmb let's go with just configurations and hashtables for now and then expand to others if we get feedback on that |
@dotps1 we'll definitely have an option to turn it off! |
This rule is not very version control friendly. If I remove CertificateThumbPrint from the above example then all the other lines in the resource move back and look like the have been edited if I do a compare. If i also had actually edited another line - like changing the port it would not be clear. There are ignore whitespace settings that I use for the compare, the they are not the default behaviour. |
That's a fair point, though I don't see any way around this other than just turning off the rule if it's problematic for you. Can you think of a better option? |
When a user writes a DSC configuration, they might line up their assignment statements like this:
We should do this formatting for them so that when they add new properties they can reformat the configuration and have all the properties be lined up at the equal signs again.
/cc @jpsnover @smurawski
The text was updated successfully, but these errors were encountered: