Skip to content

Make messages of UseCorrectCasing more detailed #1843

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 1 commit into from
Sep 22, 2022
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
83 changes: 46 additions & 37 deletions Rules/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Rules/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@
<value>For better readability and consistency, use the exact casing of the cmdlet/function/parameter.</value>
</data>
<data name="UseCorrectCasingError" xml:space="preserve">
<value>Cmdlet/Function/Parameter does not match its exact casing '{0}'.</value>
<value>Function/Cmdlet '{0}' does not match its exact casing '{1}'.</value>
</data>
<data name="UseCorrectCasingName" xml:space="preserve">
<value>UseCorrectCasing</value>
Expand Down Expand Up @@ -1188,4 +1188,7 @@
<data name="AvoidUsingBrokenHashAlgorithmsName" xml:space="preserve">
<value>AvoidUsingBrokenHashAlgorithms</value>
</data>
<data name="UseCorrectCasingParameterError" xml:space="preserve">
<value>Parameter '{0}' of function/cmdlet '{1}' does not match its exact casing '{2}'.</value>
</data>
</root>
4 changes: 2 additions & 2 deletions Rules/UseCorrectCasing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file
if (!commandName.Equals(correctlyCasedCommandName, StringComparison.Ordinal))
{
yield return new DiagnosticRecord(
string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingError, commandName, shortName),
string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingError, commandName, correctlyCasedCommandName),
GetCommandExtent(commandAst),
GetName(),
DiagnosticSeverity.Warning,
Expand Down Expand Up @@ -91,7 +91,7 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file
if (!parameterName.Equals(correctlyCasedParameterName, StringComparison.Ordinal))
{
yield return new DiagnosticRecord(
string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingError, commandName, parameterName),
string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingParameterError, parameterName, commandName, correctlyCasedParameterName),
GetCommandExtent(commandAst),
GetName(),
DiagnosticSeverity.Warning,
Expand Down