Skip to content

Commit

Permalink
Modify S3457: Fix link format (#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-marichal authored Sep 13, 2024
1 parent f72b745 commit 529854b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions rules/S3457/csharp/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
== Why is this an issue?

A [composite format string](https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting) is a string that contains placeholders, represented by indices inside curly braces "{0}", "{1}", etc. These placeholders are replaced by values when the string is printed or logged.
A https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting[composite format string] is a string that contains placeholders, represented by indices inside curly braces "{0}", "{1}", etc. These placeholders are replaced by values when the string is printed or logged.

Because composite format strings are interpreted at runtime, rather than validated by the compiler, they can contain errors that lead to unexpected behaviors or runtime errors.

This rule validates the correspondence between arguments and composite formats when calling the
following methods:

* https://learn.microsoft.com/en-us/dotnet/api/system.string.format?view=net-7.0[`String.Format`]
* https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.appendformat?view=net-7.0[`StringBuilder.AppendFormat`]
* https://learn.microsoft.com/en-us/dotnet/api/system.console.write?view=net-7.0[`Console.Write`]
* https://learn.microsoft.com/en-us/dotnet/api/system.console.writeline?view=net-7.0[`Console.WriteLine`]
* https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.write?view=net-7.0[`TextWriter.Write`]
* https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.writeline?view=net-7.0[`TextWriter.WriteLine`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.writeline?view=net-7.0[`Debug.WriteLine(String, Object[])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror?view=net-7.0[`Trace.TraceError(String, Object[])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation?view=net-7.0[`Trace.TraceInformation(String, Object[])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning?view=net-7.0[`Trace.TraceWarning(String, Object[])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource.traceinformation?view=net-7.0[`TraceSource.TraceInformation(String, Object[])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.string.format[`String.Format`]
* https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.appendformat[`StringBuilder.AppendFormat`]
* https://learn.microsoft.com/en-us/dotnet/api/system.console.write[`Console.Write`]
* https://learn.microsoft.com/en-us/dotnet/api/system.console.writeline[`Console.WriteLine`]
* https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.write[`TextWriter.Write`]
* https://learn.microsoft.com/en-us/dotnet/api/system.io.textwriter.writeline[`TextWriter.WriteLine`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.writeline[`Debug.WriteLine(String, Object[\])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror[`Trace.TraceError(String, Object[\])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceinformation[`Trace.TraceInformation(String, Object[\])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning[`Trace.TraceWarning(String, Object[\])`]
* https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource.traceinformation[`TraceSource.TraceInformation(String, Object[\])`]
=== Exceptions

Expand Down

0 comments on commit 529854b

Please sign in to comment.