Skip to content
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

Add UseConsistentCasing #1704

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions Engine/Generic/DiagnosticRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public string ScriptPath
}

/// <summary>
/// Returns the rule id for this record
/// Returns the rule suppression id for this record
/// </summary>
public string RuleSuppressionID
{
Expand All @@ -88,7 +88,7 @@ public string RuleSuppressionID
/// </summary>
public IEnumerable<CorrectionExtent> SuggestedCorrections
{
get { return suggestedCorrections; }
get { return suggestedCorrections; }
set { suggestedCorrections = value; }
}

Expand All @@ -100,14 +100,15 @@ public IEnumerable<CorrectionExtent> SuggestedCorrections
public DiagnosticRecord()
{
}

/// <summary>
/// DiagnosticRecord: The constructor for DiagnosticRecord class that takes in suggestedCorrection
/// </summary>
/// <param name="message">A string about why this diagnostic was created</param>
/// <param name="extent">The place in the script this diagnostic refers to</param>
/// <param name="ruleName">The name of the rule that created this diagnostic</param>
/// <param name="severity">The severity of this diagnostic</param>
/// <param name="ruleId">The rule suppression ID of this diagnostic</param>
/// <param name="scriptPath">The full path of the script file being analyzed</param>
/// <param name="suggestedCorrections">The correction suggested by the rule to replace the extent text</param>
public DiagnosticRecord(
Expand Down
68 changes: 37 additions & 31 deletions Rules/Strings.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -1096,14 +1096,23 @@
<value>Use exact casing of cmdlet/function/parameter name.</value>
</data>
<data name="UseCorrectCasingDescription" xml:space="preserve">
<value>For better readability and consistency, use the exact casing of the cmdlet/function/parameter.</value>
<value>For better readability and consistency, use consistent casing.</value>
</data>
<data name="UseCorrectCasingError" xml:space="preserve">
<value>Function/Cmdlet '{0}' does not match its exact casing '{1}'.</value>
</data>
<data name="UseCorrectCasingName" xml:space="preserve">
<value>UseCorrectCasing</value>
</data>
<data name="UseCorrectCasingKeywordError" xml:space="preserve">
<value>Keyword '{0}' does not match the expected case '{1}'.</value>
</data>
<data name="UseCorrectCasingOperatorError" xml:space="preserve">
<value>Operator '{0}' does not match the expected case '{1}'.</value>
</data>
<data name="UseCorrectCasingParameterError" xml:space="preserve">
<value>Parameter '{0}' of function/cmdlet '{1}' does not match its exact casing '{2}'.</value>
</data>
<data name="UseProcessBlockForPipelineCommandCommonName" xml:space="preserve">
<value>Use process block for command that accepts input from pipeline.</value>
</data>
Expand Down Expand Up @@ -1188,9 +1197,6 @@
<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>
<data name="AvoidExclaimOperatorName" xml:space="preserve">
<value>AvoidExclaimOperator</value>
</data>
Expand Down
Loading