Skip to content

Commit f0893b5

Browse files
author
Alain Herve
committed
Create PSScriptAnalyzerSettings.psd1
Added [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer/) Its used in many opensource PowerShell Projects Its really, really handy, I use it when: - Fixing inconsistent indentations - Spotting unused parameter - Removing invalid characters etc ...
1 parent d500065 commit f0893b5

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

PSScriptAnalyzerSettings.psd1

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@{
2+
3+
IncludeDefaultRules = $true
4+
5+
ExcludeRules = @(
6+
'PSAvoidUsingWriteHost',
7+
'PSReviewUnusedParameter',
8+
'PSUseSingularNouns'
9+
)
10+
11+
Rules = @{
12+
PSPlaceOpenBrace = @{
13+
Enable = $true
14+
OnSameLine = $true
15+
NewLineAfter = $true
16+
IgnoreOneLineBlock = $true
17+
}
18+
19+
PSPlaceCloseBrace = @{
20+
Enable = $true
21+
NewLineAfter = $false
22+
IgnoreOneLineBlock = $true
23+
NoEmptyLineBefore = $true
24+
}
25+
26+
PSUseConsistentIndentation = @{
27+
Enable = $true
28+
Kind = 'space'
29+
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
30+
IndentationSize = 4
31+
}
32+
33+
PSUseConsistentWhitespace = @{
34+
Enable = $true
35+
CheckInnerBrace = $true
36+
CheckOpenBrace = $true
37+
CheckOpenParen = $true
38+
CheckOperator = $false
39+
CheckPipe = $true
40+
CheckPipeForRedundantWhitespace = $false
41+
CheckSeparator = $true
42+
CheckParameter = $false
43+
IgnoreAssignmentOperatorInsideHashTable = $true
44+
}
45+
46+
PSAlignAssignmentStatement = @{
47+
Enable = $true
48+
CheckHashtable = $true
49+
}
50+
51+
PSUseCorrectCasing = @{
52+
Enable = $true
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)