question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add code formatting option for lining up assignment operators in DSC configurations

See original GitHub issue

When a user writes a DSC configuration, they might line up their assignment statements like this:

configuration MyConfiguration {
    xDscWebService PSDSCPullServer {
        Ensure                = “Present”
        EndpointName          = “PSDSCPullServer”
        Port                  = 8080
        PhysicalPath          = “$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer”
        CertificateThumbPrint = “AllowUnencryptedTraffic”
    }
}

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

1reaction
daviwilcommented, Apr 11, 2017

@dotps1 we’ll definitely have an option to turn it off!

0reactions
daviwilcommented, May 11, 2017

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Desired State Configuration for Azure overview - Microsoft Learn
Learn how to use the Microsoft Azure extension handler for PowerShell Desired State Configuration (DSC). The article includes prerequisites, ...
Read more >
Code Layout and Formatting - PowerShell Practice and Style
Rules about indentation, line length, and capitalization are about consistency across code bases. Long practice has shown that it's easier to read and ......
Read more >
PC1616/PC1832/PC1864 v4.6 NA - DSC
If the Command Output Code Required option is enabled, enter a valid user ... The keypad displays the information using a binary format,...
Read more >
PowerShell DSC - how to pass configuration parameters to ...
SetScript = Format-DscScriptBlock -Node $Node -ScriptBlock ... because the -f operator requires the braces to contain an integer. Your code ...
Read more >
Aligning code in columns with ReSharper and Rider
We can configure these options in ReSharper's settings under Code Editing | C# | Formatting Style | Tabs, Indents, Alignment, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found