Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule S6585: Don't hardcode the format provider when turning dates and times to string #7079

Closed
2 tasks
mary-georgiou-sonarsource opened this issue Apr 14, 2023 · 0 comments · Fixed by #7483
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Milestone

Comments

@mary-georgiou-sonarsource
Copy link
Contributor

mary-georgiou-sonarsource commented Apr 14, 2023

Implement new rule S6585: Don't hardcode the format provider when turning dates and times to string.

This rule should raise when ToString is called on a DateTime, DateTimeOffset, DateOnly or TimeOnly object, and the format is not of type IFormatProvider.

  • Implement Rule S6585 for C#
  • Implement Rule S6585 for VB.NET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Projects
None yet
4 participants