Skip to content

Commit 1da7cf5

Browse files
Merge pull request #37 from Chris-Wolfgang/copilot/add-securitycodescan-analyzer
Complete static analysis setup: Add TextReader/TextWriter bans, CA1849 enforcement
2 parents ee4292d + e397f1b commit 1da7cf5

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ dotnet_diagnostic.CA1001.severity = warning
5656
dotnet_diagnostic.CA1010.severity = warning
5757
dotnet_diagnostic.CA1016.severity = warning
5858
dotnet_diagnostic.CA1063.severity = warning
59+
dotnet_diagnostic.CA1849.severity = warning # Call async methods when in async method
5960

6061
# AsyncFixer Rules (all 5 rules explicitly configured)
6162
dotnet_diagnostic.AsyncFixer01.severity = error # Unnecessary async/await

BannedSymbols.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ M:System.IO.FileStream.Write(System.Byte[],System.Int32,System.Int32); Use 'Writ
5353
M:System.IO.Stream.CopyTo(System.IO.Stream); Use 'CopyToAsync()' instead
5454
M:System.IO.Stream.CopyTo(System.IO.Stream,System.Int32); Use 'CopyToAsync()' instead
5555
M:System.IO.Stream.Flush(); Use 'FlushAsync()' instead
56-
# StreamReader
57-
M:System.IO.StreamReader.ReadToEnd(); Use 'ReadToEndAsync()' instead
58-
M:System.IO.StreamReader.ReadLine(); Use 'ReadLineAsync()' instead
59-
M:System.IO.StreamReader.Read(); Use 'ReadAsync()' instead
60-
M:System.IO.StreamReader.Read(System.Char[],System.Int32,System.Int32); Use 'ReadAsync()' instead
61-
M:System.IO.StreamReader.ReadBlock(System.Char[],System.Int32,System.Int32); Use 'ReadBlockAsync()' instead
62-
# StreamWriter
63-
M:System.IO.StreamWriter.Write(System.String); Use 'WriteAsync()' instead
64-
M:System.IO.StreamWriter.Write(System.Char); Use 'WriteAsync()' instead
65-
M:System.IO.StreamWriter.Write(System.Char[]); Use 'WriteAsync()' instead
66-
M:System.IO.StreamWriter.Write(System.Char[],System.Int32,System.Int32); Use 'WriteAsync()' instead
67-
M:System.IO.StreamWriter.WriteLine(); Use 'WriteLineAsync()' instead
68-
M:System.IO.StreamWriter.WriteLine(System.String); Use 'WriteLineAsync()' instead
69-
M:System.IO.StreamWriter.Flush(); Use 'FlushAsync()' instead
56+
# TextReader
57+
M:System.IO.TextReader.ReadToEnd(); Use 'ReadToEndAsync()' instead
58+
M:System.IO.TextReader.ReadLine(); Use 'ReadLineAsync()' instead
59+
M:System.IO.TextReader.Read(); Use 'ReadAsync()' instead
60+
M:System.IO.TextReader.Read(System.Char[],System.Int32,System.Int32); Use 'ReadAsync()' instead
61+
M:System.IO.TextReader.ReadBlock(System.Char[],System.Int32,System.Int32); Use 'ReadBlockAsync()' instead
62+
# TextWriter
63+
M:System.IO.TextWriter.Write(System.String); Use 'WriteAsync()' instead
64+
M:System.IO.TextWriter.Write(System.Char); Use 'WriteAsync()' instead
65+
M:System.IO.TextWriter.Write(System.Char[]); Use 'WriteAsync()' instead
66+
M:System.IO.TextWriter.Write(System.Char[],System.Int32,System.Int32); Use 'WriteAsync()' instead
67+
M:System.IO.TextWriter.WriteLine(); Use 'WriteLineAsync()' instead
68+
M:System.IO.TextWriter.WriteLine(System.String); Use 'WriteLineAsync()' instead
69+
M:System.IO.TextWriter.Flush(); Use 'FlushAsync()' instead
7070
# Obsolete Network APIs - Use HttpClient
7171
T:System.Net.WebClient; Obsolete - use HttpClient instead
7272
T:System.Net.WebRequest; Obsolete - use HttpClient instead

0 commit comments

Comments
 (0)