all repos

clerk @ 50bbb41

missing tooling for ledger/hledger

clerk/internal/linter/rules.go (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
linter: add missing transaction status, 1 month ago
1
package linter
2
3
import "olexsmir.xyz/clerk/journal/ast"
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
	Description() string
12
}
13
14
// EntryChecker implements pre entry linting during.
15
type EntryChecker interface {
16
	CheckEntry(entry ast.Entry) []Find
17
	Rule
18
}
19
20
// JournalChecker implements whole journal linting.
21
type JournalChecker interface {
22
	CheckJournal(journal *ast.Journal) []Find
23
	Rule
24
}
25
26
// Rules is list of all available rules.
27
var Rules = []Rule{
28
	&ParseError{},
29
	&EmptyPostings{},
30
	&OmittedPrecision{},
31
	&MissingCommodity{},
32
	&MissingStatus{},
33
}