Commit Graph

12608 Commits

Author SHA1 Message Date
Jonathan Dowland
1424a1f2f1 ;cln:import: update some Haddock strings to reflect #2158
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-01 17:58:28 +00:00
Simon Michael
7e28e38bbc ;doc:balance: cleanups 2024-02-29 23:13:23 -10:00
Simon Michael
d8f86a9b7d ;doc:balance: updates, cleanups 2024-02-29 22:56:23 -10:00
Simon Michael
67f027de33 ;doc:journal:transaction balancing, commodity directive: simplify 2024-02-29 19:23:31 -10:00
Simon Michael
babaf70932 ;doc:journal:transaction balancing, commodity directive: highlight #2135 2024-02-29 19:09:39 -10:00
Simon Michael
3e93b69c25 ;doc:balance: consolidated --related/-r doc 2024-02-29 18:14:52 -10:00
Simon Michael
39a0a4d08a ;doc:journal:valuation: cleanups 2024-02-29 18:00:10 -10:00
Simon Michael
24571f99e0 ;doc:journal: drop redundant/wrong Querying with cost or value section 2024-02-29 17:48:22 -10:00
Simon Michael
1a7523d16e ;doc:journal: move complex discussion of other lot notations later 2024-02-29 17:09:09 -10:00
Simon Michael
158e0850fd ;doc:journal:directives: fix formatting 2024-02-29 16:56:22 -10:00
Simon Michael
b39948a3dd ;doc:journal: move complex discussion of commodity styles later 2024-02-29 16:53:20 -10:00
Simon Michael
256294101d ;doc:journal:Digit group marks: simplify, don't encourage mad unicode spaces 2024-02-29 16:35:45 -10:00
Simon Michael
ed3dc344fc ;doc:journal: split Decimal marks, Digit group marks 2024-02-29 16:31:26 -10:00
Simon Michael
81f9b51967 ;doc:journal: edits 2024-02-29 16:16:23 -10:00
Simon Michael
d0c0a3f72c ;doc:journal:transaction balancing: edits 2024-02-29 16:12:32 -10:00
Simon Michael
8225b3dcef ;doc:journal:commodity directive: clarify & fix scope of effects (#2135) 2024-02-29 16:06:46 -10:00
Simon Michael
90c824adaa ;doc:journal:transactions: typo 2024-02-29 15:34:48 -10:00
Simon Michael
86ba7cc3a3 ;doc:journal:amounts/commodities/numbers: cleanup 2024-02-29 15:31:44 -10:00
Simon Michael
62151d679e ;doc:journal: move intro before cheatsheet 2024-02-29 15:05:41 -10:00
Simon Michael
2ccbb16f07 ;doc:journal:transactions: explain transaction balancing (#2135) 2024-02-29 14:52:52 -10:00
Simon Michael
a6db6762ac ;doc:journal:transactions: edits; mention debits and credits and sign 2024-02-29 14:52:19 -10:00
Simon Michael
1ee0e80719 imp:errors:unbalanced transaction: show more precise amounts (#2135)
Like we used to in 1.30, but better (show all available decimal digits,
unless they're infinite in which case show 8, show trailing zeros,
show commodity symbol with zero).
2024-02-29 12:34:17 -10:00
Simon Michael
3ec432bd53 dev: rename/improve amountSetFullPrecisionUpTo, add mixedAmountSetFullPrecisionUpTo 2024-02-29 12:31:07 -10:00
Jonathan Dowland
71684f5611 ref:import: simplify renderTemplate and friends
renderTemplate and its ancillary functions did not need the
HledgerFieldName argument, so remove it.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:42 +00:00
Jonathan Dowland
b7027c8bbb feat:import: resolve matchgroup references in ConditionalBlock scope (#2158)
Adjust getEffectiveAssignment to compute an intermediary form of the
active assignments (with an additional Either wrapper to distinguish
top-level and conditional assignments) and move the remaining work to
its only caller, hledgerField.

Rework hledgerFieldValue. Instead of calling hledgerField, call
getEffectiveAssignment and--in the conditional block case--construct
a CsvRules scoped just to the active ConditionalBlock before calling
renderTemplate.

Adjust regexMatchValue to use rconditionalblocks to access conditional
blocks from the CsvRules, rather than rblocksassigning, since we haven't
narrowed the scope of that field.

The result is match group references are only expanded for match groups
that occur within the in-scope ConditionalBlock. Fixes: #2158.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:40 +00:00
Jonathan Dowland
ac7f726282 ;ref:import: consistently use hledgerField
hledgerField is an alias to the function getEffectiveAssignment: both
names are used in various parts of RulesReader.

Treat hledgerField as the canonical name, and getEffectiveAssignment
as an implementation detail of hledgerField.

Replace all uses of getEffectiveAssignment with hledgerField (except the
one in hledgerField.)

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:39 +00:00
Jonathan Dowland
8b14022d97 ;test:import: update matchgroup functest for #2158
Also re-format the comments. Some of the comments within the conditional
blocks were actually being parsed as case-insensitive regexes to match
against each record. Luckily this didn't impact the results.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:38 +00:00
Jonathan Dowland
8f514ac16d ;test:import: test case for match groups (#2158)
Add a test which captures the issue of overlapping scope described
in GitHub issue #2158.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:36 +00:00
Jonathan Dowland
7e06e0caeb ;dev:ghc-tags: ignore hledger/test/addons
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:35 +00:00
Jonathan Dowland
bd5652c1c2 ;cln:import: remove superfluous comment lines
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:32 +00:00
Simon Michael
ce0990d1e2 ;cabal: update cabal files 2024-02-29 01:08:37 -10:00
Simon Michael
d755699c9b imp:stats: also show RTS memory usage stats 2024-02-29 01:07:04 -10:00
Simon Michael
8f1ae401f4 dev: fix some partial head/tails, silence ghc 9.8's new warnings
Note the headErr/tailErr calls will print stack traces if they fail
(small ones: five lines, one of which is the useful location info),
which may or may not be best UX.
2024-02-28 15:58:21 -10:00
Simon Michael
697e5a5671 ;cabal: update cabal files 2024-02-28 15:34:11 -10:00
Simon Michael
3798a3baef pkg: require safe >=0.3.20, for ghc 9.8 head/tail helpers 2024-02-28 14:39:53 -10:00
Simon Michael
4cec8aa0d7 pkg:stack:9.8: make default 2024-02-28 13:35:15 -10:00
Simon Michael
bf40a1ae25 pkg:stack:9.6: make non-default 2024-02-28 13:34:32 -10:00
Simon Michael
cf192de502 pkg:stack:9.8: updates 2024-02-28 13:34:07 -10:00
Simon Michael
41e14634ff pkg:stack:9.6: updates 2024-02-28 13:34:07 -10:00
Simon Michael
56d5a84cfe pkg:stack:9.4: updates 2024-02-28 13:25:42 -10:00
Simon Michael
9bc3a092ee pkg:stack:9.2: updates 2024-02-28 13:25:42 -10:00
Simon Michael
e182dc3a46 pkg:stack:9.0: updates (untested) 2024-02-28 13:25:42 -10:00
Simon Michael
9dbb0f6f2a pkg:stack:8.10: updates (untested) 2024-02-28 13:25:42 -10:00
Simon Michael
fac3ee89af feat:allow other kinds of unicode space as digit group separators
Based on feedback in chat, I added support for several more kinds of
Unicode space character for separating digit groups, both when reading
and when displaying numbers. These are the spaces currently supported,
which are just my best guess at the ones that might show up in CSV files
now and then:

space,
no-break space,
en space,
em space,
punctuation space,
thin space,
narrow no-break space,
medium mathematical space
2024-02-28 09:12:17 -10:00
Simon Michael
eb0f736899 dev: update failing test 2024-02-28 09:11:49 -10:00
Simon Michael
f1de5737d7 ;doc:REGRESSIONS: better bounty requests link 2024-02-26 15:05:50 -10:00
Simon Michael
9827860f17 ;dev:pkg:stack: bump nightly 2024-02-26 14:52:00 -10:00
Simon Michael
6f7b8f8b55 ;doc:queries:combining multiple queries: edits 2024-02-26 11:05:05 -10:00
Simon Michael
2cfd051989 ;doc:csv:balance field: fix old "Tips" link 2024-02-26 11:04:32 -10:00
Simon Michael
37881b76fc ;doc:csv: drop outdated note about auto-creation of rules files 2024-02-26 10:25:50 -10:00