all repos

clerk @ e0319e501d48d625d4f01e3cf44dfeca2c0a76c7

missing tooling for ledger/hledger
1 files changed, 3 insertions(+), 3 deletions(-)
linter: orderdate: build finding message without sprint
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-09-26 18:20:01 +0300
Authored at: 2026-09-26 17:36:58 +0300
Change ID: oqllyryrtrozswzxrqmmrqsuokttloyz
Parent: 78d7e88
M internal/linter/rule_orderdate.go
···
        1
        1
         package linter

      
        2
        2
         

      
        3
        3
         import (

      
        4
        
        -	"fmt"

      
        5
        
        -

      
        6
        4
         	"olexsmir.xyz/clerk/internal/analyzer"

      
        7
        5
         	"olexsmir.xyz/clerk/journal/ast"

      
        8
        6
         )

      ···
        16
        14
         func (o *OrderDate) CheckJournal(an *analyzer.Analysis) []Find {

      
        17
        15
         	var finds []Find

      
        18
        16
         	var anchor *ast.Date

      
        
        17
        +	var anchorStr string

      
        19
        18
         	for _, pf := range an.Files {

      
        20
        19
         		for _, entry := range pf.Ast.Entries {

      
        21
        20
         			txn, ok := entry.(*ast.Transaction)

      ···
        25
        24
         			if anchor != nil && txn.Date.Compare(*anchor) < 0 {

      
        26
        25
         				finds = append(finds, Find{

      
        27
        26
         					Code:    o.ID(),

      
        28
        
        -					Message: fmt.Sprintf("transaction is out of chronological order (date %s before %s)", txn.Date, *anchor),

      
        
        27
        +					Message: "transaction is out of chronological order (date " + txn.Date.String() + " before " + anchorStr + ")",

      
        29
        28
         					Span:    txn.Date.Span,

      
        30
        29
         				})

      
        31
        30
         				continue

      
        32
        31
         			}

      
        33
        32
         			anchor = &txn.Date

      
        
        33
        +			anchorStr = anchor.String()

      
        34
        34
         		}

      
        35
        35
         	}

      
        36
        36
         	return finds