Commit Graph

10741 Commits

Author SHA1 Message Date
Simon Michael
cddc719bd1 tools: commitlint: allow a git "fixup! " prefix
(Allows git commit --fixup and magit c F to work)
2022-02-07 11:58:29 -10:00
Simon Michael
41d7c7f6b3 doc: lib: changelog fix 2022-02-07 11:58:29 -10:00
Simon Michael
cead9c4700 doc: releasing: tweak 2022-02-07 11:58:29 -10:00
Stephen Morgan
2f47ae05c6 fix: csv: Allow unicode in field references for csv. (#1809) 2022-02-06 14:16:17 -10:00
Simon Michael
6760379d64 doc: releasing: tweaks 2022-02-06 13:05:01 -10:00
Simon Michael
c4790d64f5 doc: releasing, changelogs updates 2022-02-06 12:04:29 -10:00
Simon Michael
71f9c7985f doc: changelog updates from release branch 2022-02-05 22:09:20 -10:00
Simon Michael
ef4da90538 ;doc: update changelogs 2022-02-05 14:57:53 -10:00
Simon Michael
443e49214d tools: shake: sync with stack.yaml 2022-02-05 07:28:59 -10:00
Simon Michael
5076389161 ;doc: account types 2022-02-03 16:38:22 -10:00
Simon Michael
987e2751d9 tools: commitlint: update doc url 2022-02-03 16:27:32 -10:00
Simon Michael
dea13e08ab ;doc: account account types tweak (#1822) 2022-02-03 16:27:19 -10:00
Simon Michael
8ef82f5cd8 ;doc: account type updates (#1822) 2022-02-03 15:41:12 -10:00
Simon Michael
4ec441925a ;doc: account type updates (#1822) 2022-02-03 15:37:23 -10:00
Stephen Morgan
31fdcdb8ef !imp: type: Change the default account inference for Cash accounts to only match
^assets?(:.+)?:(cash|bank|che(ck|que?)(ing)?|savings?|current)(:|$)

This should have no effect outside the cash report.

The rule for auto-detecting "Cash" (liquid assets) from account names
has changed in this release - see [Account types]. This is to simplify
how account types are detected and configured. If you use the cashflow
report without explicitly declaring accounts as Cash, you might notice a
change, and might need to add explicit account type: tags.
2022-02-03 15:32:00 -10:00
Stephen Morgan
2e4cfccf1b fix: types: Make sure type: query will correctly match subtypes, so
type:a will also match cash accounts, and type:e will also match
conversion accounts.
2022-02-03 15:32:00 -10:00
Stephen Morgan
73925ae965 fix: types: Ensure auto postings can match against and be matched by type: queries.
This requires checking parent accounts for any new accounts introduced by auto postings which do not exist in the original journal.

Also refactor journalFinalise to only call journalPostingsAddAccountTags once, and use fewer intermediate variables.
2022-02-03 15:32:00 -10:00
Stephen Morgan
a16c88b1b1 fix: Make sure cash and conversion account types are correctly
determined when there are no explicit declarations.
2022-02-03 15:32:00 -10:00
Stephen Morgan
36fe6bbcff fix: Allow accountNameInferType to recognise Conversion accounts. 2022-02-03 15:32:00 -10:00
Stephen Morgan
e17cd1540d fix: Correctly infer Cash accounts using accountNameInferType. 2022-02-03 15:32:00 -10:00
Simon Michael
4aa06d7920 ;doc: account types: edits 2022-02-02 17:40:47 -10:00
Simon Michael
b96b6c406e ;doc: account types: rewrite/expand 2022-02-02 17:15:39 -10:00
Simon Michael
807717805a feat: accounts: --types shows account types (#1820) 2022-02-01 18:06:19 -10:00
Simon Michael
dbbd300aa2 ;dev: accounts: test cleanup 2022-02-01 18:03:46 -10:00
Simon Michael
0f8ede3038 ;doc: document how aliases can break account types (#1820) 2022-02-01 14:47:30 -10:00
Simon Michael
cb040dbe29 imp: type: forgot the tests 2022-01-31 16:44:13 -10:00
Simon Michael
336c4a7b33 imp: cleaner error messages when parsing cli (less "user error") 2022-01-31 16:44:13 -10:00
Simon Michael
a22068a556 imp: better error messages for type:'s argument 2022-01-31 16:44:13 -10:00
Simon Michael
9c872c2d9c imp: areg: clearer, more consistent error messages 2022-01-31 16:44:13 -10:00
Simon Michael
45127dc5f5 feat: new type: query for easy matching by account type
type:TYPES, where TYPES is any of the (case insensitive) letters
ALERXCV, matches accounts by their declared or inferred type.
(See https://hledger.org/hledger.html#account-types.)
This should work with most commands, eg:

    hledger bal type:al
    hledger reg type:x

API changes:

Journal has a new jaccounttypes map.
The journalAccountType lookup function makes it easy to check an account's type.
The journalTags and journalInheritedTags functions look up an account's tags.
Functions like journalFilterPostings and journalFilterTransactions,
and new matching functions matchesAccountExtra, matchesPostingExtra
and matchesTransactionExtra, use these to allow more powerful matching
that is aware of account types and tags.
2022-01-31 16:44:13 -10:00
Simon Michael
885a4fcfec ref: journalFinalise: clarify sequence, top to bottom 2022-01-31 16:44:13 -10:00
Stephen Morgan
91441bad8f test: Make sure --today is passed to --forecast tests so they keep
working.
2022-01-31 15:12:04 -10:00
Simon Michael
248ddf9378 dev: more thorough Journal anonymisation, and a note (#1817) 2022-01-30 09:47:52 -10:00
Simon Michael
3472c3cb6d ;dev: number anon tests 2022-01-30 09:47:52 -10:00
Simon Michael
3d57fa32c2 ;doc: querying by tags, on accounts and generally (#1817) 2022-01-30 09:47:52 -10:00
Simon Michael
56be63e6f1 feat: queries can now match account tags (#1817)
Accounts, postings, and transactions can now all be filtered by the
tags in an account's declaration. In particular it's now possible to
more reliably select accounts by type, using their type: tag rather
than their name:

    account myasset       ; type:Asset
    account myliability   ; type:Liability

    $ hledger accounts tag:type=^a
    myasset

Accounts inherit tags from their parents.

API changes:
A finalised Journal has a new jdeclaredaccounttags field
for easy lookup of account tags.
Query.matchesTaggedAccount is a tag-aware version of matchesAccount.
2022-01-30 09:47:52 -10:00
Simon Michael
2f48307c63 dev: query-tag.test -> format 3 2022-01-30 09:47:52 -10:00
Simon Michael
4ed80d4069 ;doc: update journalFinalise haddock 2022-01-30 09:47:52 -10:00
Stephen Morgan
df4949ad1a imp!: journal: Remove deprecated account type code syntax from account
directives.

Previously, you declare an account type with the following format:
account assets  A
This has been deprecated since 1.13, and should now be declared with one
of:
account assets  ; type:A
account assets  ; type:asset
2022-01-28 12:38:38 -10:00
Simon Michael
929f13ec03 fix: warning (#1799) 2022-01-26 09:00:40 -10:00
Simon Michael
27b6e1d111 imp: nicer invalid balance assignment errors (tweak) 2022-01-26 08:59:19 -10:00
Stephen Morgan
bcaa6ac3c8 test: Run all tests with --fast compilation, not just functests. 2022-01-26 08:10:59 -10:00
Stephen Morgan
1d9be4c2de cln: print, close: Check the show_costs_ option instead of directly
checking the --show-costs flag.
2022-01-26 08:07:11 -10:00
Stephen Morgan
ba0eec9132 ref: Return the interval split in reportSpan, to reduce the number
of different places we call splitSpan and ease refactoring.
2022-01-26 08:05:37 -10:00
Stephen Morgan
e33de3585b ref: Clean up splitSpan, to make the logic clearer and more extensible.
Previously the helper functions splitspan and splitspan' would calculate
each span from the start point of the previous span. This meant we had
to be very careful not to lose any relevant information (e.g. what day
of the week it was) about the original start date. We now calculate each
span from the original start date, so there's no risk of losing
information. This simplifies many of the calculations.
2022-01-26 08:05:37 -10:00
Stephen Morgan
ea51a87bd0 cln: Remove under-used maybePeriod, which is only used as a stand-in for
Just . parsePeriodExpr' in tests.
2022-01-26 08:05:37 -10:00
Stephen Morgan
43b7e849c7 cln: Remove some explicit Text packing. 2022-01-26 08:05:37 -10:00
Stephen Morgan
2a51b6e9a4 fix: layout: Commodity symbols should be omitted in --layout=bare when
all amounts are zero. (#1789)
2022-01-26 07:58:14 -10:00
Stephen Morgan
55a022a941 fix: strict: Make sure forecast transactions and auto postings are
checked with --strict. (#1810)
2022-01-26 07:57:13 -10:00
Patrik Keller
2cf4c221de Manual: clarify reference from --strict to check 2022-01-26 07:45:13 -10:00