sorted
is the linter for keeping everything sorted.
At the moment it only checks for a few things, with plans for checking everything that could be checked for any sort of ordering.
It can be generalized into 2 main categories for now, that are
-
Blocks
const ( B = iota // B, A are not sorted alphabetically A )
-
Multiple inline identifiers
const c, b, a = 0, 0, 0 // single line idents are not sorted alphabetically
- Options for turning stuff on/off
-
const
,var
- Alphabetical sorting
-
struct
- Alphabetical sorting
-
switch
(maybe?) -
imports
(pretty much what gci does with some more) -
func
- Alphabetical sorting
- Public/Private sorting
- Generics