-
Notifications
You must be signed in to change notification settings - Fork 234
1.x: Fix wiring of WhitespaceInsideBrace and WhitespaceAroundPipe that got broken in #1024 #1142
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
Changes from all commits
aeff3f0
74320f7
6cc518c
ef44579
7d630c7
202b991
75c5b5d
a78d5df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,58 +249,62 @@ public Hashtable GetPSSASettingsHashtable( | |
|
||
private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces) | ||
{ | ||
var ruleConfigurations = new Hashtable { | ||
{"PSPlaceOpenBrace", new Hashtable { | ||
{"Enable", true}, | ||
{"OnSameLine", OpenBraceOnSameLine}, | ||
{"NewLineAfter", NewLineAfterOpenBrace}, | ||
{"IgnoreOneLineBlock", IgnoreOneLineBlock} | ||
var ruleConfigurations = new Hashtable | ||
{ | ||
{ "PSPlaceOpenBrace", new Hashtable { | ||
{ "Enable", true }, | ||
{ "OnSameLine", OpenBraceOnSameLine }, | ||
{ "NewLineAfter", NewLineAfterOpenBrace }, | ||
{ "IgnoreOneLineBlock", IgnoreOneLineBlock } | ||
}}, | ||
{"PSPlaceCloseBrace", new Hashtable { | ||
{"Enable", true}, | ||
{"NewLineAfter", NewLineAfterCloseBrace}, | ||
{"IgnoreOneLineBlock", IgnoreOneLineBlock} | ||
{ "PSPlaceCloseBrace", new Hashtable { | ||
{ "Enable", true }, | ||
{ "NewLineAfter", NewLineAfterCloseBrace }, | ||
{ "IgnoreOneLineBlock", IgnoreOneLineBlock } | ||
}}, | ||
{"PSUseConsistentIndentation", new Hashtable { | ||
{"Enable", true}, | ||
{"IndentationSize", tabSize}, | ||
{"PipelineIndentation", PipelineIndentationStyle }, | ||
{"Kind", insertSpaces ? "space" : "tab"} | ||
{ "PSUseConsistentIndentation", new Hashtable { | ||
{ "Enable", true }, | ||
{ "IndentationSize", tabSize }, | ||
{ "PipelineIndentation", PipelineIndentationStyle }, | ||
{ "Kind", insertSpaces ? "space" : "tab" } | ||
}}, | ||
{"PSUseConsistentWhitespace", new Hashtable { | ||
{"Enable", true}, | ||
{"CheckOpenBrace", WhitespaceBeforeOpenBrace}, | ||
{"CheckOpenParen", WhitespaceBeforeOpenParen}, | ||
{"CheckOperator", WhitespaceAroundOperator}, | ||
{"CheckSeparator", WhitespaceAfterSeparator} | ||
{ "PSUseConsistentWhitespace", new Hashtable { | ||
{ "Enable", true }, | ||
{ "CheckOpenBrace", WhitespaceBeforeOpenBrace }, | ||
{ "CheckOpenParen", WhitespaceBeforeOpenParen }, | ||
{ "CheckOperator", WhitespaceAroundOperator }, | ||
{ "CheckSeparator", WhitespaceAfterSeparator }, | ||
{ "CheckInnerBrace", WhitespaceInsideBrace }, | ||
{ "CheckPipe", WhitespaceAroundPipe }, | ||
}}, | ||
{"PSAlignAssignmentStatement", new Hashtable { | ||
{"Enable", true}, | ||
{"CheckHashtable", AlignPropertyValuePairs} | ||
{ "PSAlignAssignmentStatement", new Hashtable { | ||
{ "Enable", true }, | ||
{ "CheckHashtable", AlignPropertyValuePairs } | ||
}}, | ||
{"PSUseCorrectCasing", new Hashtable { | ||
{"Enable", UseCorrectCasing} | ||
{ "PSUseCorrectCasing", new Hashtable { | ||
{ "Enable", UseCorrectCasing } | ||
}}, | ||
}; | ||
|
||
if (AutoCorrectAliases) | ||
{ | ||
// Empty hashtable required to activate the rule, | ||
// since PSAvoidUsingCmdletAliases inherits from IScriptRule and not ConfigurableRule | ||
ruleConfigurations.Add("PSAvoidUsingCmdletAliases", new Hashtable()); | ||
} | ||
|
||
return new Hashtable | ||
return new Hashtable() | ||
{ | ||
{"IncludeRules", new string[] { | ||
"PSPlaceCloseBrace", | ||
"PSPlaceOpenBrace", | ||
"PSUseConsistentWhitespace", | ||
"PSUseConsistentIndentation", | ||
"PSAlignAssignmentStatement", | ||
"PSAvoidUsingCmdletAliases", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entry (the removed |
||
{ "IncludeRules", new string[] { | ||
"PSPlaceCloseBrace", | ||
"PSPlaceOpenBrace", | ||
"PSUseConsistentWhitespace", | ||
"PSUseConsistentIndentation", | ||
"PSAlignAssignmentStatement", | ||
}}, | ||
{ | ||
"Rules", ruleConfigurations | ||
}, | ||
} | ||
}; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line and the line above is the essential fix