fix:check:tags: add date and date2 to the implicitly-declared special tags
And add tests/comments.
This commit is contained in:
parent
a964fd25c0
commit
baca5f8b54
@ -198,22 +198,23 @@ journalCheckTags j = do
|
|||||||
])
|
])
|
||||||
|
|
||||||
-- | Tag names which have special significance to hledger.
|
-- | Tag names which have special significance to hledger.
|
||||||
|
-- Keep synced with check-tags.test and hledger manual > Special tags.
|
||||||
builtinTags = [
|
builtinTags = [
|
||||||
"type" -- declares an account's type
|
"date" -- overrides a posting's date
|
||||||
,"t" -- declares the (user defined, single letter) type of a 15m unit of time parsed from timedot format
|
,"date2" -- overrides a posting's secondary date
|
||||||
-- generated by close
|
,"type" -- declares an account's type
|
||||||
,"balances" -- balance assertions transaction
|
,"t" -- appears on postings generated by timedot letters
|
||||||
,"retain" -- retain earnings transaction
|
,"assert" -- appears on txns generated by close --assert
|
||||||
,"start" -- opening balances, closing balances or balance assignment transaction
|
,"retain" -- appears on txns generated by close --retain
|
||||||
-- optionally generated on periodic transactions and auto postings
|
,"start" -- appears on txns generated by close --migrate/--close/--open/--assign
|
||||||
,"generated-transaction"
|
,"generated-transaction" -- with --verbose-tags, appears on generated periodic txns
|
||||||
,"generated-posting"
|
,"generated-posting" -- with --verbose-tags, appears on generated auto postings
|
||||||
,"modified"
|
,"modified" -- with --verbose-tags, appears on txns which have had auto postings added
|
||||||
-- used internally, not shown (but queryable)
|
-- hidden tags used internally (and also queryable):
|
||||||
,"_generated-transaction"
|
,"_generated-transaction" -- always exists on generated periodic txns
|
||||||
,"_generated-posting"
|
,"_generated-posting" -- always exists on generated auto postings
|
||||||
,"_modified"
|
,"_modified" -- always exists on txns which have had auto postings added
|
||||||
,"_conversion-matched"
|
,"_conversion-matched" -- exists on postings which have been matched with a nearby @/@@ cost notation
|
||||||
]
|
]
|
||||||
|
|
||||||
-- | In each tranaction, check that any conversion postings occur in adjacent pairs.
|
-- | In each tranaction, check that any conversion postings occur in adjacent pairs.
|
||||||
|
|||||||
@ -39,3 +39,42 @@ $ hledger -f - check tags
|
|||||||
$ hledger -f - check tags
|
$ hledger -f - check tags
|
||||||
>2 /tag "ptag" has not been declared/
|
>2 /tag "ptag" has not been declared/
|
||||||
>=1
|
>=1
|
||||||
|
|
||||||
|
# ** 6. Built-in special tags are implicitly declared and won't make check tags fail.
|
||||||
|
# Keep synced with JournalChecks.builtinTags.
|
||||||
|
<
|
||||||
|
2024-01-01
|
||||||
|
; date:
|
||||||
|
; date2:
|
||||||
|
; type:
|
||||||
|
; t:
|
||||||
|
; assert:
|
||||||
|
; retain:
|
||||||
|
; start:
|
||||||
|
; generated-transaction:
|
||||||
|
; generated-posting:
|
||||||
|
; modified:
|
||||||
|
; _generated-transaction:
|
||||||
|
; _generated-posting:
|
||||||
|
; _modified:
|
||||||
|
; _conversion-matched:
|
||||||
|
$ hledger -f - check tags
|
||||||
|
|
||||||
|
# ** 7. Declaring the built-in special tags is harmless.
|
||||||
|
# Keep synced with JournalChecks.builtinTags.
|
||||||
|
<
|
||||||
|
tag date ; overrides a posting's date
|
||||||
|
tag date2 ; overrides a posting's secondary date
|
||||||
|
tag type ; declares an account's type
|
||||||
|
tag t ; generated by letters in timedot data (with the letter as tag value)
|
||||||
|
tag assert ; appears on txns generated by close --assert
|
||||||
|
tag retain ; appears on txns generated by close --retain
|
||||||
|
tag start ; appears on txns generated by close --migrate/--close/--open/--assign
|
||||||
|
tag generated-transaction ; with --verbose-tags, appears on generated periodic txns
|
||||||
|
tag generated-posting ; with --verbose-tags, appears on generated auto postings
|
||||||
|
tag modified ; with --verbose-tags, appears on txns which have had auto postings added
|
||||||
|
tag _generated-transaction ; always exists on generated periodic txns
|
||||||
|
tag _generated-posting ; always exists on generated auto postings
|
||||||
|
tag _modified ; always exists on txns which have had auto postings added
|
||||||
|
tag _conversion-matched ; exists on postings which have been matched with a nearby @/@@ cost notation
|
||||||
|
$ hledger -f - check tags
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user