feature request for formatting rule to have an empty line after brace
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
}
)
}
}
}
}
...
The formatting functionality is actually provided by a different repo - https://github.com/PowerShell/PSScriptAnalyzer. You should post this suggestion there. BTW your proposed behavior is not quite right. Shouldn't it be:
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
}
)
}
}
}
}
This could be an option on the PSCloseBrace rule/setting but I cannot imagine it being on by default or one of the 3 code style schemes. Would it still be valuable to you then?