Log message:
finance/hledger: update to hledger-1.41
# 2024-12-09 1.41
Breaking changes
- Accounts named "equity:conversion", "equity:trading", or \
"equity:trade(s)",
which are detected as type `V`/`Conversion`, will now revert to type \
`E`/`Equity` instead
if any other account has been declared as type `V`/`Conversion`.
- When built with ghc 9.10.1, hledger shows two extra newlines after any error \
message.
Fixes
- A somewhat severe, though hopefully rare, valuation bug has been fixed.
In certain circumstances, values could be calculated inaccurately,
because of display-rounding occurring inappropriately during calculations. [#2254]
Specifically:
when there was no direct P price for the target commodity,
so that hledger had to convert via a chain of prices,
and if all of those price amounts had too few decimal places,
then the result could be inaccurate.
An example:
P 2000-01-01 A 10.5 B
P 2000-01-01 B 100.5 C
2000-01-01
(a) 100 A
$ hledger-1.40 print -X C
2000-01-01
(a) 105520 C ; wrong
$ hledger-1.41 print -X C
2000-01-01
(a) 105525 C ; right
- `bs`/`bse`/`cf`/`is`'s HTML output no longer includes excess heading cells,
and `bs`/`bse`'s HTML output no longer shows an inappropriate Total heading \
with `-T`.
(`balancesheet` does not support `-T`.)
(Henning Thielemann)
- Balance commands' HTML, CSV and FODS output now show tree mode properly indented
(using no-break spaces).
(Henning Thielemann)
- In the HTML output of `bs`/`bse`/`cf`/`is` reports, Net amounts in the Net row \
are now formatted like the others.
(Bas van Dijk)
- In `bs`/`bse`/`cf`/`is` HTML output, some unnecessary TH cells have been fixed.
[#2225] (Henning Thielemann)
- The `print` command now ignores a depth limit entirely.
Previously, a depth limit caused it to show only transactions referencing \
accounts as deep or deeper than that.
- In the `roi` command, a division by zero error (when all assets were sold) has \
been fixed.
[#2281] (Dmitry Astapov)
- In a multi-line comment generated by CSV rules, tags on all lines now work \
(ie, can be matched).
Posting dates in comments generated from CSV also now \
[work](https://hledger.org/hledger.html#comment-field).
(#2241)
- hledger's bash shell completions are now up to date with the latest CLI.
[#986]
- When showing output with a pager, if `$PAGER` is set to something not found in \
PATH,
we now ignore it instead of raising an error.
- `hledger --color=yes | less -R` now shows bold headings as you'd expect.
Features
- The `print`, `register` and `aregister` commands now support HTML and FODS output,
and the `bs`/`bse`/`cf`/`is` commands now support FODS output.
This means all of the "STANDARD REPORTS" commands, and the `balance` \
command, now support text, HTML, CSV, TSV, or FODS output.
(Henning Thielemann)
- When generating HTML output with the register or balance commands,
the `--base-url` option will add hyperlinks to hledger-web,
allowing you to view the detailed transactions if you have hledger-web running.
(Henning Thielemann)
- Reports can now specify different display depths for certain accounts,
rather than showing all accounts with the same depth limit.
Multiple `--depth=ACCTREGEX=DEPTH` options (or `depth:ACCTREGEX=DEPTH` \
arguments can be used.
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`
(Stephen Morgan, #2292)
- In unix-like environments, hledger now uses a pager (`$PAGER`, `less`, or `more`)
for all large terminal output, not just for help.
You can override this with the new `--pager` option.
The pager is expected to handle hledger's ANSI colour output (unless you \
disable that).
If `less` is used, it will be configured automatically,
or you can override this by setting options in a `HLEDGER_LESS` environment \
variable.
- The `print` command's `beancount` output is now much more Beancount-compatible \
[#2295].
Other than using `--alias` to provide the top-level account names Beancount \
requires,
you should rarely have to do anything special to produce a journal that \
`bean-check` accepts.
hledger will automatically adjust problematic names, encode unsupported \
characters, and so on.
See [hledger: Beancount \
output](https://hledger.org/dev/hledger.html#beancount-output) for the full \
details.
This supersedes the `ledger2beancount` tool, and makes using Beancount tools,
especially Fava, practical for hledger users. In many cases this should just work:
```
hledger [ALIASES] print -o tmp.beancount; fava tmp.beancount
```
Improvements
- `if` blocks in CSV rules now allow `& !` (AND NOT) on the same line.
- When reading `.latest` files, whitespace is now ignored, and any date parse failure
is reported with the file and line number.
- In journal format, P directives now require a space after the first symbol,
preventing surprises like `P 2024-10-31 a0 1` parsed as `P 2024-10-31 a 01`.
[#2280]
- `aregister` has a new `--heading=YN` option, for disabling the report heading. \
(Henning Thielemann)
- `aregister` now supports the `--invert` and `--cumulative` flags, like the \
`register` command. (Henning Thielemann)
- The balance commands' HTML and FODS output now shows table borders consistently.
(Henning Thielemann)
- In the balance commands' HTML output, row headings now span multiple rows when \
appropriate, rather than being repeated.
(Henning Thielemann)
- Balance commands now support `--transpose` when generating HTML output.
(Henning Thielemann)
- The `balance` command's `--layout=tidy` now affects HTML and FODS output at \
least to some extent (not just CSV output).
And it always disables the totals row. (Henning Thielemann)
- The `balance` command's FODS output now picks a report title based on the \
report mode:
"Balance Report", "Multi-period Balance Report", or \
"Budget Report". (Henning Thielemann)
- `balance` and `aregister`'s HTML output will now use a hledger.css file if \
present, like `bs`/`bse`/`cf`/`is`.
- `bs`/`bse`/`cf`/`is` now support the `--count` (postings count) report type, \
like `balance`.
- The balance commands' options help has had some cleanup.
- The error messages from `check accounts` and `check recentassertions` are now \
clearer.
- The `check commodities` command now also checks commodities used in P \
directives. [#2280]
- The `commodities` command now also list commodities mentioned in P directives. \
[#2280]
- All of hledger's internal hidden (but searchable) tags can now be made visible
by `print --verbose-tags`, which is useful for troubleshooting `--infer-equity`,
`--infer-costs`, and the detection of redundant costs and conversion postings.
Also,
- Some hidden tags have been renamed for clarity:
`_modified` is now `_modified-transaction`,
`_cost-matched` is now `_cost-posting`,
`_conversion-matched` is now `_conversion-posting`.
- The `generated-posting:` tag added by `--infer-equity` is now valueless.
- The `modified-transaction:` tag added by `--auto` now appears on its own line.
- Using the `-NUM` shortcut (for `--depth NUM`) in a config file now works.
- Setting the `--color` option in a config file now works
(except it does not affect `--debug` output, currently).
- The `--color` option's suggested values are now `yes`/`y`, `no`/`n`, or `auto`/`a`.
`always` and `never` are no longer documented, though still supported.
- More compact and informative `--debug=2` output during valuation.
Market prices are now shown using one line each, the known prices
are listed, and the status of `--infer-market-prices` is shown.
[#2287]
- More informative `--debug=7` output from CSV rules.
- The hledger packages have a new `debug` build flag. Builds made with ghc 9.10+ \
and this flag
will show some kind of stack trace if the program exits with an error.
(These will improve in future ghc versions.)
- Disabled the unused `ghcdebug` build flag and ghc-debug support, for now.
- Allow megaparsec 9.7.
- ghc 9.10 / base 4.20 are now supported.
Docs
- Windows: added tips for setting `LEDGER_FILE` (Amadeusz Wieczorek, \
hledger_site#119)
- csv: if blocks: explain matchers and field names better [#2289]
- import: rewrite; rename "date skipping" to "overlap detection"
- import: added tips for first import
- assertions: mention their behaviour with posting status
- journal: rewrite the Tags section
- pager: note that `help -p TOPIC` uses less; link to less FAQ
- query types: updates, add headings, mention tag:'s infix matching
- Regular expressions: note possible RTL/bidi limitation (?)
- Special characters: rewrite, more precision, mention some Windows differences
- Output formats: expand, document beancount and FODS output
- Text output: expand/consolidate terminal topics
- FODS output: describe the advantages over CSV (Henning Thielemann)
- Debug output: note that the --debug option doesn't work in config files.
- bal: improve --layout doc
- bal: note that tree mode doesn't work in html output [#1846]
- bal: also mention hledger.css and text encoding in balance doc
- html: note safari text encoding issue
- timedot: mention the common journal+timedot file setup [#2238]
- Install, manual: new shell completions doc. [#986]
- Config files: rewrite [#2231]
- examples/csv: an example of YNAB 4 data, and RTL text, with a workaround
- examples: hledger2beancount.conf
Scripts/addons
- bin/*: remove obsolete _FLAGS markers from --help
- examples/csv/csv-hledger-1.py: a python-based CSV converter script
API
- Hledger.Utils.IO's ansi color helpers now respect the --color option.
- Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
- Hledger.Cli.Commands.Balance: export budgetReportAs* functions, for use in scripts.
(Dmitry Astapov)
# 1.40 2024-09-09
Fixes
- Account tags (and type declarations) declared in multiple files are now \
combined correctly. [#2202]
- Several kinds of report interval now choose a better start date:
- `every Nth day of month from DATE` with periodic transactions [#2218]
- `every M/D from DATE`
- `every Nth WEEKDAY from DATE`
- The balance commands' HTML output no longer repeats the "Total" and
"Net" headings when the totals row has multiple lines.
And the layout has been improved and made more consistent with the
text output.
- The `--tldr` flag now also works with the `tealdeer` tldr client.
- `hledger check tags` no longer warns about the internal `_price-matched` tag
being undeclared (and that tag has been renamed to `_cost-matched`).
[#2247]
- `hledger check accounts` no longer warns about the special `equity:conversion` \
account
being undeclared (the default account used by `--infer-equity`).
Features
- You can now save command line options in a [config \
file](https://hledger.org/hledger.html#config-files),
to be added to your hledger commands either on demand or automatically.
(This supersedes the older arguments files feature.)
This much-requested new feature has pros and cons, and is experimental;
your testing and feedback is welcome.
It changes the nature of hledger somewhat, which I have marked by
giving this release a more memorable version number (1.40).
- The balance commands can now output in FODS format, an XML spreadsheet
file format readable by LibreOffice. (Henning Thielemann)
- The `register` report can now be sorted by date, account, amount,
absolute amount, description, or a combination of these. (Michael Rees, [#2211])
Improvements
- All the balance-like commands now support FODS output, not just `balance`.
(Henning Thielemann)
- Config files can now also provide the command name.
If the first thing in a config file's general section is a non-flag argument,
that will be used as the command name argument,
taking precedence over any command line arguments.
This makes config files strictly more powerful than the older argument files.
- Improved debug output for command line and config file processing.
- The print command's beancount output is now better at producing \
Beancount-ready data,
converting hledger account names and commodity names to Beancount-compatible ones.
- Command line processing has been overhauled and should be more robust
in certain cases, with tweaked error messages and debug output.
Command-specific flags can now optionally appear before the command name.
(Though writing them afterward is usually more readable.
Addon-specific flags must still come last, after `--`.)
- The `--rules-file` option has been renamed to `--rules`.
The old spelling is still supported as a hidden option.
- Weekly reports' week headings are now more compact, especially in
single-year balance reports. ([#2204], Victor Mihalache)
- The `balance` command with no report interval, and also `balance --budget`,
now support html output. (Henning Thielemann)
- In balance commands' html and csv output, "Total:" and \
"Net:" headings
are now capitalised consistently.
- `bs`/`cf`/`is` reports now show the report interval in their title.
- The balance commands' text output with the `--pretty` flag now shows
an outer table border and inter-column borders.
- The `check recentassertions` error message is now more readable.
- Timedot format now allows comment lines to be indented.
- When running the `tldr-node-client` client, auto-update of the tldr
database is now suppressed.
- When running a tldr client fails, the warning now mentions the required
`--render` flag. [#2201]
- The error message for unsupported regular expressions like `(?:foo)` has
been improved.
- `--debug` has moved to "General help flags", making it available in
more situations.
- Some verbose debug output from command line processing has been demoted to level 2.
- Parsing timedot files now gives debug output at level 9.
- Allow doclayout 0.5.
Docs
- The hledger/hledger-ui/hledger-web manuals now list all command options as \
shown by `--help`.
- Added an example config file, `hledger.conf.sample`.
- The `diff` and `prices` commands' help layout has been improved.
- `add`'s doc described the effect of `D` wrongly, now fixed.
- Date adjustments: rewrites and corrections
- Period headings: added
- Input: clarify that multiple -f options are allowed
- Scripts and add-ons: edits, list add-ons again
- Timeclock: edits, fix `ti`/`to` scripts
- Fixed "hledger and Ledger" links [hledger_site#112]
- examples/csv: Monzo CSV rules added
- examples/csv: Tiller CSV rules added
- examples/csv: Nordea CSV rules added (Arto Jonsson)
Scripts/addons
- `bin/bashrc` updates; add years, eachyear scripts
- `bin/hledger-simplebal`: ignore config files
- `bin/hledger-script-example`: explain shebang commands better
- `bin/hledger-register-max`: update/fix
# 1.34 2024-06-01
Breaking changes
- `check ordereddates` no longer supports `--date2`.
Also (not a breaking change): `--date2` and secondary dates are now officially
[deprecated](https://hledger.org/1.34/hledger.html#secondary-dates) in hledger,
though kept for compatibility.
Features
- You can now get a quick list of example command lines for hledger or
its most useful subcommands by adding the `--tldr` flag (or just
`--tl`). For best appearance you should install the [`tldr`][tldr] client,
though it's not required.
These short "tldr pages" are a great counterbalance to verbose PTA docs.
You can also use `tldr` without hledger to view the latest versions, or \
translations:\
`tldr hledger[-COMMAND]`.
Or you can [browse tldr pages \
online](https://tldr.inbrowser.app/search?query=hledger+).
Consider contributing translations!
More tips at <https://github.com/simonmichael/hledger/tree/master/doc/tldr>.
[tldr]: https://tldr.sh
Improvements
- The `hledger` commands list has been reorganised,
with commands listed roughly in the order you'll need them.
- The general flags descriptions in `--help` have been updated and grouped.
- Correctness checks now run in a documented order. `commodities` are
now checked before `accounts`, and `tags` before `recentassertions`.
When both `ordereddates` and `assertions` checks are enabled,
`ordereddates` now runs first, giving more useful error messages.
- `-I`/`--ignore-assertions` is now overridden by `-s`/`--strict`
(or `check assertions`), enabling more flexible workflows.
Eg you can `alias hl="hledger -I"` to delay balance assertions
checking until you add `-s` to commands.
- `--color` and `--pretty` now also accept `y` or `n` as argument.
- When built with the `ghcdebug` flag and started with `--debug=-1`,
hledger can be controlled by [ghc-debug] clients like
ghc-debug-brick or a ghc-debug query script, for analysing
memory/profile info.
[ghc-debug]: https://gitlab.haskell.org/ghc/ghc-debug
Fixes
- `hledger COMMAND --man` and `hledger help TOPIC --man` now properly scroll
the man page to the TOPIC or COMMAND heading.
The exact/prefix matching behaviour has been clarified in `help --help`.
- In journal files, `include` directives with trailing whitespace are now parsed \
correctly.
- The help command's help flags are now consistent with other commands
(and it has `--debug` as a hidden flag).
- Build errors with GHC 8.10 have been fixed. [#2198]
Docs
- The tables of contents on hledger.org pages now just list top-level headings,
(and the hledger manual structure has been adjusted for this).
This makes the hledger manual on hledger.org more scannable and less scary.
- add: drop lengthy transcript, add simpler example commands (from tldr)
- Amount formatting: move down, it's not the best first topic
- balance: mention the `--summary-only` flag
- check: expand check descriptions
- examples: CSV rules: vanguard, fidelity, paypal updates
- Generating data: rewrite
- JSON output: link to OpenAPI spec
- manuals: synopsis, options cleanup/consistency
- Options: correction, NO_COLOR does not override --color
- PART 4: COMMANDS: reorganise into groups, like the CLI commands list.
- Period expressions: mention last day of month adjusting [#2005]
- Secondary dates: expand, and declare them deprecated.
- Time periods cleanup, simplify markup
- Unicode characters: mention UTF-8 on windows
Scripts/addons
- Added `hledger-pricehist`, an alias for the `pricehist` market price
fetcher so that it can appear in hledger's commands list.
[#2005]: https://github.com/simonmichael/hledger/issues/2005
[#2198]: https://github.com/simonmichael/hledger/issues/2198
|