Skip to content

Commit

Permalink
Update message and resources
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-kolbay-sonarsource committed Jul 5, 2023
1 parent cbfac05 commit de9c48d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
24 changes: 12 additions & 12 deletions rules/S6580/description-dotnet.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ If not provided, the method will use the machine's `CultureInfo`; if the given s

This rule raises an issue for the following date and time string representation parsing methods:

* `DateTime.Parse`
* `DateTimeOffset.Parse`
* `DateOnly.Parse`
* `TimeOnly.Parse`
* `DateTime.TryParse`
* `DateTimeOffset.TryParse`
* `DateOnly.TryParse`
* `TimeOnly.TryParse`
* `DateTime.TryParseExact`
* `DateTimeOffset.TryParseExact`
* `DateOnly.TryParseExact`
* `TimeOnly.TryParseExact`
* `Parse`
* `ParseExact`
* `TryParse`
* `TryParseExact`
Of the following classes:

* `System.DateOnly`
* `System.DateTime`
* `System.DateTimeOffset`
* `System.TimeOnly`
* `System.TimeSpan`
2 changes: 1 addition & 1 deletion rules/S6580/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "When parsing \"DateTime\" strings, always use overloads with an \"IFormatProvider\" parameter",
"title": "Use a format provider when parsing date and time",
"type": "CODE_SMELL",
"status": "ready",
"remediation": {
Expand Down
15 changes: 6 additions & 9 deletions rules/S6580/resources-dotnet.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
=== Documentation

* https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parse[DateTime.Parse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetime.parseexact[DateTime.ParseExact method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparse[DateTime.TryParse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryparseexact[DateTime.TryParseExact method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.parse[DateTimeOffset.Parse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tryparse[DateTimeOffset.TryParse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tryparseexact[DateTimeOffset.TryParseExact method]
* https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.parse[DateOnly.Parse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.tryparse[DateOnly.TryParse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.tryparseexact[DateOnly.TryParseExact method]
* https://learn.microsoft.com/en-us/dotnet/api/system.timeonly.parse[TimeOnly.Parse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.timeonly.tryparse[TimeOnly.TryParse method]
* https://learn.microsoft.com/en-us/dotnet/api/system.timeonly.tryparseexact[TimeOnly.TryParseExact method]
* https://learn.microsoft.com/en-us/dotnet/api/system.dateonly[DateOnly type]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetime[DateTime type]
* https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset[DateTimeOffset type]
* https://learn.microsoft.com/en-us/dotnet/api/system.timeonly[TimeOnly type]
* https://learn.microsoft.com/en-us/dotnet/api/system.timespan[TimeSpan type]
* https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo[Culture Info class documentation]
* https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings[Standard date and time format strings]

0 comments on commit de9c48d

Please sign in to comment.