Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public CodeFormattingSettings(CodeFormattingSettings codeFormattingSettings)
public bool IgnoreOneLineBlock { get; set; }
public bool AlignPropertyValuePairs { get; set; }
public bool UseCorrectCasing { get; set; }
public bool RemoveTrailingWhitespace { get; set; }

/// <summary>
/// Get the settings hashtable that will be consumed by PSScriptAnalyzer.
Expand Down Expand Up @@ -328,6 +329,13 @@ private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces)
ruleConfigurations.Add("PSAvoidUsingCmdletAliases", new Hashtable());
}

if (RemoveTrailingWhitespace)
{
// Empty hashtable required to activate the rule,
// since PSAvoidTrailingWhitespace inherits from IScriptRule and not ConfigurableRule
ruleConfigurations.Add("PSAvoidTrailingWhitespace", new Hashtable());
}

return new Hashtable()
{
{ "IncludeRules", new string[] {
Expand Down