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

6 Commits

Author SHA1 Message Date
Oleksandr Redko
5dc6ed197b refactor: enable few linters in golangci-lint config (#1580) 2025-11-15 10:50:52 -08:00
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
Oleksandr Redko
f4976873e7 docs: improve comments for functions; enable godot (#1382) 2025-05-27 07:44:24 +02:00
ccoVeille
b1c9032746 feature: Add nil timezone handling detection to time-date rule (#1377) 2025-05-26 14:32:55 +02:00
chavacava
92f28cb5e1 refactor: moves code related to AST from rule.utils into astutils package (#1380)
Modifications summary:

* Moves AST-related functions from rule/utils.go to astutils/ast_utils.go (+ modifies function calls)
* Renames some of these AST-related functions
* Avoids instantiating a printer config at each call to astutils.GoFmt
* Uses astutils.IsIdent and astutils.IsPkgDotName when possible
2025-05-26 13:18:38 +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