package linter import "olexsmir.xyz/clerk/journal/ast" // EmptyPostings flags transactions that have no postings. type EmptyPostings struct{} func (EmptyPostings) ID() RuleID { return "empty-postings" } func (EmptyPostings) Severity() Severity { return SeverityError } func (e *EmptyPostings) CheckEntry(entry ast.Entry) []Find { txn, ok := entry.(*ast.Transaction) if !ok { return nil } if len(txn.Postings) == 0 { return []Find{{ Code: e.ID(), Severity: e.Severity(), Message: "transaction has no postings", Span: txn.Span, }} } return nil }