clerk/internal/linter/rules.go (view raw)
| 1 | package linter |
| 2 | |
| 3 | import "olexsmir.xyz/clerk/internal/analyzer" |
| 4 | |
| 5 | type RuleID string |
| 6 | |
| 7 | // Rule is the best interface that every rule must implement. |
| 8 | type Rule interface { |
| 9 | ID() RuleID |
| 10 | Severity() Severity |
| 11 | CheckJournal(an *analyzer.Analysis) []Find |
| 12 | } |
| 13 | |
| 14 | // Rules is list of all available rules. |
| 15 | var Rules = []Rule{ |
| 16 | &ParseError{}, |
| 17 | &EmptyPostings{}, |
| 18 | &OmittedPrecision{}, |
| 19 | &MissingCommodity{}, |
| 20 | &MissingStatus{}, |
| 21 | &MissingPayee{}, |
| 22 | &AccountDepthLimit{MaxDepth: 4}, |
| 23 | &MultipleOmittedAmounts{}, |
| 24 | &OrderDate{}, |
| 25 | &DuplicatedAccount{}, |
| 26 | &DuplicatedCommodity{}, |
| 27 | &UndeclaredCommodity{}, |
| 28 | &UndeclaredAccount{}, |
| 29 | &UnbalancedTransaction{}, |
| 30 | // &UnusedAccount{}, |
| 31 | } |