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
3 changes: 2 additions & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ dotnet_diagnostic.CA1820.severity = none
dotnet_diagnostic.CA1821.severity = warning

# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA1822.severity = warning
dotnet_code_quality.ca1822.api_surface = private

# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected override void Write(VT100Renderer renderer, ListBlock obj)
renderer.WriteLine();
}

private void RenderNumberedList(VT100Renderer renderer, ListItemBlock block, int index)
private static void RenderNumberedList(VT100Renderer renderer, ListItemBlock block, int index)
{
// For a numbered list, we need to make sure the index is incremented.
foreach (var line in block)
Expand Down
2 changes: 1 addition & 1 deletion src/TypeCatalogGen/TypeCatalogGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ namespace System.Management.Automation
{{
internal partial class PowerShellAssemblyLoadContext
{{
private Dictionary<string, string> InitializeTypeCatalog()
private static Dictionary<string, string> InitializeTypeCatalog()
{{
return new Dictionary<string, string>({0}, StringComparer.OrdinalIgnoreCase) {{";
const string SourceEnd = @"
Expand Down
2 changes: 1 addition & 1 deletion test/tools/WebListener/Controllers/LinkController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public IActionResult Error()
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}

private string GetLink(string baseUri, int maxLinks, int linkNumber, string whitespace, string type, string rel)
private static string GetLink(string baseUri, int maxLinks, int linkNumber, string whitespace, string type, string rel)
{
return string.Format(Constants.LinkUriTemplate, baseUri, maxLinks, linkNumber, type, whitespace, rel);
}
Expand Down
2 changes: 1 addition & 1 deletion test/tools/WebListener/Controllers/ResponseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public IActionResult Error()
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}

private List<T> GetSingleOrArray<T>(JToken token)
private static List<T> GetSingleOrArray<T>(JToken token)
{
if (token.HasValues)
{
Expand Down
2 changes: 1 addition & 1 deletion test/tools/WebListener/Controllers/ResumeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public IActionResult Error()
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}

private RangeItemHeaderValue GetRange(string rangeHeader)
private static RangeItemHeaderValue GetRange(string rangeHeader)
{
return RangeHeaderValue.Parse(rangeHeader).Ranges.FirstOrDefault();
}
Expand Down
4 changes: 2 additions & 2 deletions test/xUnit/csharp/test_FileSystemProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected virtual void Dispose(bool disposing)
}
}

private ExecutionContext GetExecutionContext()
private static ExecutionContext GetExecutionContext()
{
CultureInfo currentCulture = CultureInfo.CurrentCulture;
PSHost hostInterface = new DefaultHost(currentCulture, currentCulture);
Expand All @@ -63,7 +63,7 @@ private ExecutionContext GetExecutionContext()
return executionContext;
}

private ProviderInfo GetProvider()
private static ProviderInfo GetProvider()
{
ExecutionContext executionContext = GetExecutionContext();
SessionStateInternal sessionState = new SessionStateInternal(executionContext);
Expand Down
4 changes: 2 additions & 2 deletions test/xUnit/csharp/test_PSConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public void SetupConfigFile4()
CreateEmptyFile(currentUserConfigFile);
}

private void CreateEmptyFile(string fileName)
private static void CreateEmptyFile(string fileName)
{
File.Create(fileName).Dispose();
}
Expand All @@ -382,7 +382,7 @@ public void SetupConfigFile5()
CreateBrokenConfigFile(currentUserConfigFile);
}

private void CreateBrokenConfigFile(string fileName)
private static void CreateBrokenConfigFile(string fileName)
{
File.WriteAllText(fileName, "[abbra");
}
Expand Down