Skip to content

Expose new rule PSAvoidUsingDoubleQuotesForConstantString added in PSSA 1.19.1 #1333

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

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"PSScriptAnalyzer":{
"MinimumVersion":"1.19.0",
"MinimumVersion":"1.19.1",
"MaximumVersion":"1.99"
},
"Plaster":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public CodeFormattingSettings(CodeFormattingSettings codeFormattingSettings)

public bool AddWhitespaceAroundPipe { get; set; }
public bool AutoCorrectAliases { get; set; }
public bool UseConstantStrings { get; set; }
public CodeFormattingPreset Preset { get; set; }
public bool OpenBraceOnSameLine { get; set; }
public bool NewLineAfterOpenBrace { get; set; }
Expand Down Expand Up @@ -315,6 +316,9 @@ private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces)
{ "PSUseCorrectCasing", new Hashtable {
{ "Enable", UseCorrectCasing }
}},
{ "PSAvoidUsingDoubleQuotesForConstantString", new Hashtable {
{ "Enable", UseConstantStrings }
}},
};

if (AutoCorrectAliases)
Expand All @@ -331,7 +335,8 @@ private Hashtable GetCustomPSSASettingsHashtable(int tabSize, bool insertSpaces)
"PSPlaceOpenBrace",
"PSUseConsistentWhitespace",
"PSUseConsistentIndentation",
"PSAlignAssignmentStatement"
"PSAlignAssignmentStatement",
"PSAvoidUsingDoubleQuotesForConstantString",
}},
{
"Rules", ruleConfigurations
Expand Down