1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00
Commit Graph

3 Commits

Author SHA1 Message Date
ccoVeille
50dddb405b feature: detect time/date out of bounds in time-date rule (#1370)
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-05-27 03:25:01 -07:00
ccoVeille
b1c9032746 feature: Add nil timezone handling detection to time-date rule (#1377) 2025-05-26 14:32:55 +02:00
ccoVeille
3cac850cb6 feature: add rule time-date to check for time.Date usage (#1327)
This commit introduces a new rule to check for the usage of time.Date

The rule is added to report the usage of time.Date with non-decimal literals

Here the leading zeros that seems OK, forces the value to be octal literals.
time.Date(2023, 01, 02, 03, 04, 05, 06, time.UTC)

gofumpt formats the code like this when it encounters leading zeroes.
time.Date(2023, 0o1, 0o2, 0o3, 0o4, 0o5, 0o6, time.UTC)

The rule reports anything that is not a decimal literal.
2025-05-22 21:44:04 +02:00