clerk/internal/linter/rules.go (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com linter: add different rules related to tags..., 2 months ago
olexsmir@gmail.com linter: add different rules related to tags..., 2 months ago
| 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 | &InvalidInclude{}, |
| 18 | &EmptyPostings{}, |
| 19 | &OmittedPrecision{}, |
| 20 | &MissingCommodity{}, |
| 21 | &MissingStatus{}, |
| 22 | &MissingPayee{}, |
| 23 | &AccountDepthLimit{MaxDepth: 4}, |
| 24 | &MultipleOmittedAmounts{}, |
| 25 | &OrderDate{}, |
| 26 | &DuplicatedAccount{}, |
| 27 | &DuplicatedCommodity{}, |
| 28 | &DuplicatedTransaction{}, |
| 29 | &DuplicatedTag{}, |
| 30 | &UndeclaredCommodity{}, |
| 31 | &UndeclaredAccount{}, |
| 32 | &UnbalancedTransaction{}, |
| 33 | &UndeclaredTag{}, |
| 34 | &InvalidDateTag{}, |
| 35 | &InvalidTypeTag{}, |
| 36 | &UnusedAccount{}, |
| 37 | &UnusedTag{}, |
| 38 | } |