PowerShell / PowerShell/PSScriptAnalyzer
feature request for formatting rule to have an empty line after brace
Open
Nobody has claimed this yet.
Area - Formatter
Issue - Enhancement
Up-for-Grabs
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Summary of the new feature
This is a proposal to add additional formatting rule to have an empty line after brace to keep code more readable with OTBS scheme. It's a separate rule comparing to inserting a new line.
Current behaviour:
...
foreach ($account in $Permissions.Keys) {
foreach ($permission in $Permissions[$account].Keys) {
foreach ($folder in $Permissions[$account][$permission]) {
cNtfsPermissionEntry $folder {
Ensure = 'Present'
Path = $folder
Principal = $account
AccessControlInformation = @(
cNtfsAccessControlInformation {
FileSystemRights = $permission
}
)
}
}
}
}
...
Proposed behaviour:
...
foreach ($account in $Permissions.Keys) {
foreach ($permission in $Permissions[$account].Keys) {
foreach ($folder in $Permissions[$account][$permission]) {
cNtfsPermissionEntry $folder {
Ensure = 'Present'
Path = $folder
Principal = $account
AccessControlInformation = @(
cNtfsAccessControlInformation {
FileSystemRights = $permission
}
)
}
}
}
}
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the formatting rules and brace-handling logic in PSScriptAnalyzer, then review existing tests for formatting behavior. Done means a separate rule produces the proposed blank lines after braces and tests cover the shown nested PowerShell example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100