Skip to content
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
12 changes: 12 additions & 0 deletions .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,18 @@ dotnet_diagnostic.CA1858.severity = warning
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1860
dotnet_diagnostic.CA1860.severity = warning

# CA1865: Use char overload
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1865
dotnet_diagnostic.CA1865.severity = warning

# CA1866: Use char overload
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1866
dotnet_diagnostic.CA1866.severity = warning

# CA1867: Use char overload
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1867
dotnet_diagnostic.CA1867.severity = warning

# CA1868: Unnecessary call to 'Contains' for sets
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1868
dotnet_diagnostic.CA1868.severity = warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ internal void GetCategoryMap()
foreach (ShellFolderItem category in catItems)
{
string path = category.Path;
string catNum = path.Substring(path.LastIndexOf("\\", StringComparison.OrdinalIgnoreCase) + 1);
string catNum = path.Substring(path.LastIndexOf('\\') + 1);

CategoryMap.Add(catNum, category.Name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.WSMan.Management/ConfigProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public sealed class WSManConfigProvider : NavigationCmdletProvider, ICmdletProvi
string ICmdletProviderSupportsHelp.GetHelpMaml(string helpItemName, string path)
{
// Get the leaf node from the path for which help is requested.
int ChildIndex = path.LastIndexOf("\\", StringComparison.OrdinalIgnoreCase);
int ChildIndex = path.LastIndexOf('\\');
if (ChildIndex == -1)
{
// Means we are at host level, where no new-item is supported. Return empty string.
Expand Down
2 changes: 1 addition & 1 deletion src/ResGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void Main(string[] args)
if (className.StartsWith("public.", StringComparison.InvariantCultureIgnoreCase))
{
accessModifier = "public";
className = className.Substring(className.IndexOf(".") + 1);
className = className.Substring(className.IndexOf('.') + 1);
}

string sourceCode = GetStronglyTypeCsFileForResx(resxPath, moduleName, className, accessModifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ internal string[] ArgumentList
/// <param name="argument">The value used with parameter.</param>
internal void AddToArgumentList(CommandParameterInternal parameter, string argument)
{
if (parameter.ParameterNameSpecified && parameter.ParameterText.EndsWith(":"))
if (parameter.ParameterNameSpecified && parameter.ParameterText.EndsWith(':'))
{
if (argument != parameter.ParameterText)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static List<string> ParseAndRemoveStringsParameter(List<string> argsList,

if (parameterIndex + 1 < argsList.Count)
{
while (parameterIndex + 1 < argsList.Count && !argsList[parameterIndex + 1].StartsWith("-"))
while (parameterIndex + 1 < argsList.Count && !argsList[parameterIndex + 1].StartsWith('-'))
{
// remove each filter string and stop when we get to the next argument flag
parameterValue.Add(argsList[parameterIndex + 1]);
Expand Down
Loading