Commit Graph

3646 Commits

Author SHA1 Message Date
Simon Michael
ffc3440313 ;doc: update embedded manuals 2024-12-09 17:58:30 -10:00
Simon Michael
f2cb3cd023 ;cabal: update cabal files 2024-12-09 17:58:25 -10:00
Simon Michael
20f1f51a9d ;pkg: set version to 1.41.99 2024-12-09 17:58:24 -10:00
Simon Michael
58d461d5ee ;doc: changelogs: fix heading 2024-12-09 16:03:40 -10:00
Simon Michael
77a25b6423 ;doc: merge 1.41 changelogs 2024-12-09 15:46:35 -10:00
Simon Michael
b663822b88 fix: print: ignore --depth entirely
Until now, a depth limit caused print to show only transactions referencing accounts as deep or deeper than that.
2024-12-09 15:37:30 -10:00
Simon Michael
917f03b828 ;doc: changelogs 2024-12-06 18:05:28 -10:00
Simon Michael
f648903b37 imp:print:beancount: don't add account tags to postings
When print is generating beancount output, turn off the usual
inheritance of account tags by postings; it would generate excessive
metadata in the journal. Beancount can do or not do that kind of
inheritance itself.
2024-12-06 05:55:42 -10:00
Simon Michael
ff28aa329a imp:print:beancount: convert tags to BC metadata
Transaction and posting tags (and posting tags inherited from accounts)
are now converted safely to Beancount-compatible transaction and posting
metadata lines.
2024-12-06 05:55:42 -10:00
Simon Michael
17332c75f9 imp:print:beancount: generate operating_currency directives from cost currencies 2024-12-06 05:55:42 -10:00
Simon Michael
d925c8a042 imp:print:beancount: add a second account name part if needed
Beancount requires account names to have at least two parts.
2024-12-06 05:55:42 -10:00
Simon Michael
6e3dfd6703 imp:print:beancount: remove virtual postings automatically 2024-12-06 05:55:42 -10:00
Simon Michael
1048791810 imp:csv: ignore whitespace, show error position when reading .latest files 2024-12-05 16:35:18 -10:00
Simon Michael
29349458b3 imp:csv:if: go back to accepting unknown csv field names [#2289]
It makes life easier when reusing common rules with different CSVs.
2024-12-04 17:45:28 -10:00
Simon Michael
99fc4cd61f imp:csv:if: show the problematic field name when warning 2024-12-04 16:47:01 -10:00
Simon Michael
054a204aa0 imp:csv:if: support & ! (AND NOT) 2024-12-03 17:25:43 -10:00
Simon Michael
3d55f260b3 imp:csv:if: warn on invalid csv field names; improve doc [#2289] 2024-12-03 16:07:57 -10:00
Simon Michael
05ae105b42 dev: Hledger.Utils.IO: warn 2024-12-03 16:07:54 -10:00
Simon Michael
a47dce073d dev:csv: refactor/document isBlockActive, matcherMatches 2024-12-03 13:51:32 -10:00
Simon Michael
1010e3dee6 imp:csv: improve debug=7 output from isBlockActive 2024-12-03 10:45:16 -10:00
Simon Michael
fd9c64a4ad pkg: allow megaparsec 9.7 [stackage#7585] 2024-12-03 08:46:29 -10:00
Stephen Morgan
74f0f37fb3 imp: queries: Allow regular expression depth queries
Previously depth-limiting was universal across all accounts, e.g. all
accounts are clipped to depth 2. However, sometimes you want certain
accounts clipped to a different depth than others, e.g. all expenses to
depth 3, while all assets to depth 2. This commit enables depth-limiting
to optionally include a regular expression, which limits the accounts it
applies to.

More than one depth limit can be passed, and they are applied to each
account name by the following rules:
- If one or more regular-expression depth limit applies, use the
  most specific one
- If no regular-expression depth limits apply, and a flat depth limit is
  supplied, use that
- Otherwise, do not do any depth limiting

For example, this will clip all accounts matching "assets" to depth 3,
all accounts matching "expenses" to depth 2, and all other accounts to
depth 1.
--depth assets=3 --depth expenses=2 --depth 1
2024-12-03 08:33:21 -10:00
Simon Michael
735beb96a7 imp:valuation: more compact and informative --debug=2 output [#2287]
Market prices are now shown using one line each,
the known prices are listed (forward / forward+reverse),
and the status of --infer-market-prices is shown.
2024-12-02 23:00:00 -10:00
Simon Michael
1ad9fbb4a8 imp:print: clean up special tags; show them more often with --verbose-tags
- These special hidden tags, used internally, have been renamed:
  - `_modified`           -> `_modified-transaction`
  - `_cost-matched`       -> `_cost-posting`
  - `_conversion-matched` -> `_conversion-posting`

- All special hidden tags now have a similarly-named visible tag,
  and `--verbose-tags` now shows those more often, which is useful
  when troubleshooting `--infer-equity`, `--infer-costs`,
  or the matching of redundant costs and conversion postings.

- The `generated-posting:` tag added by `--infer-equity` is now valueless.

- The `modified-transaction:` tag added by `--auto` now appears on its own line.
2024-11-16 14:40:03 -10:00
Simon Michael
9bf28b1b0e dev:posting*AsLines: fix some docs 2024-11-16 14:40:03 -10:00
Simon Michael
f57cd638da imp:print:beancount output: more robust account/commodity encoding
Unsupported chars are now hex-encoded, not just converted to dashes.
This helps keep account and commodity names unique, especially with
the equity conversion account names generated by --infer-equity when
using currency symbols.
(Those could also be converted to ISO 4217 codes, in theory, but
for now we just hex encode them, which is easier to make robust.)

Also, Beancount commodity symbols are no longer enclosed in
hledger-style double quotes.
2024-11-07 01:28:31 -10:00
Simon Michael
cbdbe0a855 dev: AmountFormat: add displayQuotes property to control enclosing quotes 2024-11-07 01:24:21 -10:00
Simon Michael
6adda683dc dev:Journal: cleanup 2024-11-02 18:29:15 -10:00
Simon Michael
326acbf93b imp: check recentassertions: try to make the error message clearer 2024-11-02 18:10:53 -10:00
Simon Michael
090f001eee imp:commodities: also list commodities mentioned in P directives [#2280] 2024-11-02 16:48:08 -10:00
Simon Michael
a58948c7a8 dev:Journal: cleanup, improve docs 2024-11-02 16:47:24 -10:00
Simon Michael
445e80fd41 dev:clarify: rename jcommodities to jdeclaredcommodities 2024-11-02 15:52:17 -10:00
Simon Michael
80fa7e2db6 dev:clarify: rename jinferredcommodities to jinferredcommoditystyles 2024-11-02 15:52:07 -10:00
Simon Michael
5e0a35b1da fix:journal:P directives: require a space after the symbol [#2280]
This prevents surprising parses, like
`P 2024-10-31 a0 1` parsed as `P 2024-10-31 a 01`.
2024-11-02 15:24:25 -10:00
Simon Michael
d6080c5ff1 imp: check commodities: also check commodities used in P directives [#2280] 2024-11-02 15:03:57 -10:00
Simon Michael
c66e901d8b dev: save the parse positions of PriceDirectives 2024-11-02 15:00:47 -10:00
Simon Michael
4d38c63ec8 dev: move/rename nullsourcepos 2024-11-02 14:59:43 -10:00
Simon Michael
5d2259d942 dev: Hledger.Utils.IO: cleanup 2024-11-02 12:59:44 -10:00
Simon Michael
1dabccfb46 dev: Hledger.Utils.IO: more cleanup 2024-11-02 12:51:53 -10:00
Simon Michael
4351304f06 dev: Hledger.Utils.IO: cleanup 2024-11-02 12:04:19 -10:00
Simon Michael
9c81bb2a06 dev: Hledger.Utils.IO colour helpers: cleanup 2024-11-02 11:54:28 -10:00
Simon Michael
75ff6c8218 ;cabal: update cabal files 2024-11-02 08:42:10 -10:00
Simon Michael
657fc1551f !fix: respect --color=yes in a few places that didn't; drop text-ansi dep
Hledger.Utils.IO's ansi style/color helpers now respect --color=yes,
so that eg `hledger --color=yes | less -R` shows bold headings as
you'd expect.

Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
2024-11-01 10:40:25 -10:00
Simon Michael
234b4879c2 imp: less pager will use HLEDGER_LESS instead, if defined
When using `less` as pager, if HLEDGER_LESS is defined, it will
provide the options (instead of LESS + hledger's extra options).
You can set your own preferred options here, or you can set it
equal to LESS to use exactly those options.

[#2272]-related
2024-11-01 08:02:03 -10:00
Simon Michael
5bab9600e4 imp: simplify pager setup: just customise LESS, not MORE
[#2272]-related
2024-11-01 08:01:44 -10:00
Simon Michael
1011029356 imp: pager set extra LESS options for a nice experience when using less
Currently this sets a rather ambitious set of options,
and overrides the existing LESS:

  --chop-long-lines
  --hilite-unread
  --ignore-case
  --mouse
  --no-init
  --QUIT-AT-EOF
  --quit-if-one-screen
  --RAW-CONTROL-CHARS
  --squeeze-blank-lines
  --use-backslash
  --use-color
2024-10-31 19:13:39 -10:00
Simon Michael
30086ae249 imp: run pager more robustly; drop pager lib [#2272]
This fixes the error displayed when quitting the pager with long output.
It also replaces the pager lib with more robust homegrown pager utilities,
which should prevent a number of failure modes.
2024-10-31 18:55:09 -10:00
Simon Michael
659e493b30 ;doc: update changelogs 2024-10-30 19:01:49 -10:00
Simon Michael
50bf401ea6 dev: split debug/ghcdebug flags, comment out the latter for now
Compilation with ghc-debug is failing, and it has not yet been used
for anything. Separate the flag and leave it in place but commented for now.
2024-10-24 10:44:28 -10:00
Henning Thielemann
1a9bfcf5be cli: Commands.Aregister: implement --invert option 2024-10-23 21:55:24 -10:00