Commit Graph

3874 Commits

Author SHA1 Message Date
jneubrand
7482f1efc3 fix: use precompiled regexes to handle case insensitivity correctly 2025-07-03 14:25:50 -07:00
Simon Michael
fc93a4c644 fix:add: show green prompts properly instead of ANSI codes [#2410] 2025-07-01 16:41:05 -07:00
savanto
230998136f imp: areg: do not abbrev other accts in machine-readable output (#1995)
- Do not turn "other accounts" into a comma-delimited string when the
  report is constructed, but pass `AccountName`s up the chain. This
  requires modifying the `AccountTransactionsReportItem` type to contain
  `[AccountName]` rather than `Text`.

- Perform the account name summarization
  (`Hledger.Data.AccountName.accountSummarizedName`) closer to the
  actual rendering of the report, so that different report formats can
  choose summarization strategy.

- Continue to summarize as before for terminal/text output (ie.
  human-readable). Do not summarize any more for machine-readable output
  (csv/html/fods).
2025-06-28 13:38:58 -07:00
Stephen Morgan
8ab2fb6b77 feat: lib: Allow special string %account in auto-posting rules (#1975)
This allows using the special string `%account` in auto posting rules.
When run, this will be substituted with the account name of the matched
posting.
2025-06-24 10:12:57 -07:00
Simon Michael
714b346fdd imp: fully support quarter syntax in smart dates and period expressions 2025-06-23 18:37:08 -07:00
Simon Michael
afd18a10bf fix: show historical balances even if report period is empty [#2403]
This adds a safer version of spanDefaultsFrom that won't create spans
that end before they start, and updates all reports to use it.

The only related change noticed so far is that close now gives an
error instead of a malformed entry, when there's no data to close.
[#2409]
2025-06-15 22:42:58 -10:00
Simon Michael
9c7e5b2467 dev:MultiBalanceReport: consistent debug output labels 2025-06-15 22:16:50 -10:00
Simon Michael
427a5de1f3 dev:MultiBalanceReport: use error' consistently for clean output 2025-06-15 22:06:34 -10:00
Simon Michael
4a5775da71 imp: commodities/payees/tags: used/declared flags, like accounts
And general cleanup of options and help across
the accounts, commodities, payees, tags commands.
2025-06-15 07:32:40 -10:00
Simon Michael
38aadddf7b dev: Hledger.Query.matchesCommodity: check all query types, not just cur:
And default to False (unlike the other match functions. Ok ?)
2025-06-15 07:32:40 -10:00
Simon Michael
d3c86bafdf ;doc: finalise changelogs for 1.43.2 on 2025-06-13 2025-06-13 12:05:20 -10:00
Simon Michael
cc95eca1ce ;doc: update changelogs 2025-06-13 12:05:20 -10:00
Simon Michael
bd2d8728d1 fix: txn balancing: fix logic for the 1.50 message [#2402]
and add more tests.
2025-06-13 09:10:46 -10:00
Simon Michael
16fd84166a ;dev: cleanup 2025-06-12 18:48:48 -10:00
Simon Michael
57031b0e78 dev: rename exitOnError -> handleExit, improve doc 2025-06-12 18:48:10 -10:00
Simon Michael
0750a27d00 dev: ignore SIGPIPE errors from truncated output in a more robust way [#2405] 2025-06-12 18:36:41 -10:00
Simon Michael
cda62d9a59 ;dev: change "1.44" to "1.50" in docs and error messages 2025-06-12 17:55:13 -10:00
Simon Michael
0d388a6f93 ;imp: show a more helpful error for transactions unbalanced by upgrade [#2402]
(and drop the last sentence from the single-commodity unbalanced
transaction error)
2025-06-12 17:55:13 -10:00
Simon Michael
de4d637def dev: transaction balancing: cleanup [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
bf90b20f2c imp: --txn-balancing flag to select transaction balancing precision [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
442bd24bc5 ;dev: commodityStyleFromRawOpts: cleanup 2025-06-12 17:55:13 -10:00
Simon Michael
a9408b8cd5 imp:journal: balance transactions with local precisions [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
82ba831822 dev: move commodityStylesFromAmounts to Hledger.Data.Amount
Also drop canonicalStyleFrom, seems unused.
2025-06-12 17:55:13 -10:00
Simon Michael
eb6b48dded fix:cli: don't raise an error if output is truncated in a pipe [#2405]
This broke in 1.43.

Now we ignore any IOException whose message contains "broken pipe".
Hopefully this matches pre-1.43 behaviour and doesn't hide real errors.
2025-06-12 17:55:13 -10:00
Simon Michael
41e62885c4 dev: avoid a strange vscode/Haskell highlighting bug 2025-06-07 15:28:41 -10:00
Stephen Morgan
80cf1d1995 !dev: lib: Allow Account to store date-indexed balances.
This upgrades Account to enable it to store a multiperiod balance, with
a separate balance for each date period. This enables it do the hard
work in MultiBalanceReport.

Some new types are created to enable convenient operation of accounts.
- `BalanceData` is a type which stores an exclusive balance, inclusive
  balance, and number of postings. This was previously directly stored
  in Account, but is now factored into a separate data type.
- `PeriodData` is a container which stores date-indexed data, as well as
  pre-period data. In post cases, this represents the report spans,
  along with the historical data.
- Account becomes polymorphic, allowing customisation of the type of
  data it stores. This will usually be `BalanceData`, but in
  `BudgetReport` it can use `These BalanceData BalanceData` to store
  both actuals and budgets in the same structure. The data structure
  changes to contain a `PeriodData`, allowing multiperiod accounts.

Some minor changes are made to behaviour for consistency:
- --declared treats parent accounts consistently.
- --flat --empty ensures that implied accounts with no postings are not displayed, but
  accounts with zero balance and actual postings are.
2025-06-04 23:10:00 -10:00
Simon Michael
2899b46c59 ;doc: update embedded manuals 2025-06-04 07:31:18 -10:00
Simon Michael
af9822a60a ;cabal: update cabal files 2025-06-04 07:31:13 -10:00
Simon Michael
a0a539cb66 ;pkg: set version to 1.43.99 2025-06-04 07:31:12 -10:00
Simon Michael
847567095d ;doc: finalise changelogs for 1.43.1 on 2025-06-03 2025-06-03 18:44:40 -10:00
Simon Michael
c2972b3d5d ;pkg: update tested-with 2025-06-03 18:44:40 -10:00
Simon Michael
b67379c3d8 fix: cur: in posting-based reports filters multicommodity amounts again [#2396] 2025-06-03 18:44:08 -10:00
Simon Michael
6daba4edb8 dev: refactor journalValueAndFilterPostingsWith a bit [#2396] 2025-06-03 18:44:08 -10:00
Simon Michael
bdd2018663 lib:Hledger.Query: queryIsAmtOrSym 2025-06-03 18:44:08 -10:00
Simon Michael
5bbf31096d ;lib: note an issue with filterQuery 2025-06-03 18:44:08 -10:00
Simon Michael
959be5f51d fix:lib:Hledger.Query: parseQueryTerm: don't call error for a bad amt: argument 2025-06-03 10:10:04 -10:00
Simon Michael
2a4718d40a fix: make a few more error messages consistent, hiding call stack [#2367] 2025-06-03 10:10:04 -10:00
Simon Michael
59387cbf6b ;doc: finalise changelogs for 1.43 on 2025-06-01 2025-06-01 12:31:24 -10:00
Simon Michael
d9c512deee ;doc: changelogs 2025-06-01 12:31:24 -10:00
Michael Rees
0c3e7bc395 Always check added transaction, even if no immediate assertion 2025-05-31 23:19:47 -10:00
Michael Rees
b042115692 Ignore assertions during add with -I 2025-05-31 23:19:47 -10:00
Michael Rees
5a4aa87df8 Clarify some code after review 2025-05-31 23:19:47 -10:00
Michael Rees
17f914e571 imp: add: Verify balance assertions on each posting (#2355) 2025-05-31 23:19:47 -10:00
Simon Michael
713773cfc3 imp: simplify the unicode decode error message; refactor 2025-05-30 09:43:30 -10:00
Simon Michael
4587eccdf4 ;fix: recognise another case of text decoding failure 2025-05-29 12:25:06 -10:00
Simon Michael
e360e50497 imp:csv: more --debug=2 output for if rules
Also, in debug output show records more like what matchers are seeing,
ie with quotes removed.
2025-05-22 17:05:45 -10:00
Simon Michael
9474d808dc ;imp:lib:Hledger.Utils.Debug: more cleanups, docs
This and/or the previous related change also changed a few cases which
always traced or always logged; now all debug output is consistently
either traced or logged.
2025-05-22 17:03:50 -10:00
Simon Michael
0d014577c2 ;imp:lib:Hledger.Utils.Debug: more cleanup 2025-05-21 23:07:14 -10:00
Simon Michael
820a44eb07 imp:lib:Hledger.Utils.Debug: simpler, more consistent dbg* names 2025-05-21 22:54:00 -10:00
Simon Michael
297cf30e60 ;dev: journalValueAndFilterPostingsWith notes [#2371], [#2385] 2025-05-17 02:09:27 -10:00
Stephen Morgan
447a681645 fix: Ensure valuation happens after filtration (#2385) 2025-05-17 00:00:33 -10:00
Simon Michael
d3468812bf ;doc: finalise changelogs for 1.42.2 on 2025-05-16 2025-05-16 13:18:18 -10:00
Simon Michael
425540e8ca ;doc: update changelogs 2025-05-16 13:18:13 -10:00
Simon Michael
4999411bb0 ;doc: changelogs: fix 1.42.1 headings 2025-05-16 11:43:23 -10:00
Simon Michael
8f6a7c8a66 fix: web: don't hang when saving a large file [#2319] 2025-05-16 09:44:26 -10:00
Simon Michael
151b36a6f2 ;dev: haddock edits 2025-05-16 09:42:55 -10:00
Stephen Morgan
eda4c8dd62 dev: lib: Add NFData instances for Journal and subcomponents. 2025-05-02 08:30:38 -10:00
Stephen Morgan
468a3da1b7 dev: lib: Use strict data in Hledger.Data.Types.
This reduces memory usage and results in speedups in some commands.
2025-05-02 08:30:17 -10:00
Simon Michael
330f3fccaa ;dev: rename assertions.test 2025-04-27 08:30:18 -10:00
Simon Michael
2371f677e5 imp:journal: include directive now allows a same-line comment 2025-04-27 08:30:18 -10:00
samahri
4f9473240f cli: "balanced" check is enabled only with "check" command 2025-04-26 20:05:00 -10:00
Simon Michael
bca4b39c58 lib: defaultJournalSafely: don't strip newline 2025-04-25 15:42:47 -10:00
Simon Michael
f0f048326e lib: defaultJournalSafely wasn't very safe; now catches error calls 2025-04-25 15:21:11 -10:00
Simon Michael
bf40d28c8b imp: config files (and maybe timedot files) no longer require a final newline 2025-04-25 13:59:18 -10:00
Simon Michael
b0959cb23d lib:Hledger.Utils.IO: document some file reading utilities 2025-04-25 09:21:11 -10:00
Simon Michael
45d5fd7963 imp: show a clearer error message on unicode en/decoding failures [#73]
A very long-awaited improvement: for unicode exceptions, and I/O
exceptions which look like they were caused by a unicode error
(usually text decoding failure), our error message now includes
an explanation and advice on what to do.

Currently this uses the GHC.IO.Encoding API, which is not ideal:
"The API of this module is unstable and not meant to be consumed by
the general public. If you absolutely must depend on it, make sure to
use a tight upper bound, e.g., base < 4.X rather than base < 5,
because the interface can change rapidly without much warning."

Also it relies on scanning for patterns in GHC's various
unicode-related error messages, which may not be complete and could
change in future. To do: try the encoding package's IO helpers,
perhaps they give more specific exceptions.
2025-04-25 08:57:07 -10:00
Simon Michael
06cd0f9472 lib: exitOnExceptions -> exitOnError 2025-04-25 08:32:47 -10:00
Simon Michael
fea127fcb5 ;doc: note check-related bug in rawOptsToInputOpts [#2377] 2025-04-24 10:44:34 -10:00
Simon Michael
036be45c50 lib: make parseYN(A) total; export findPager 2025-04-23 21:43:30 -10:00
Simon Michael
4788bd9e41 lib: journalCommoditiesUsed 2025-04-23 21:43:30 -10:00
Simon Michael
255e79c550 lib: Hledger.Read: more ways to read the default journal
defaultJournalWith, defaultJournalSafely, defaultJournalSafelyWith
2025-04-22 18:50:42 -10:00
Simon Michael
a13b7d2a82 lib: Hledger.Data.Dates.parsedate: also accept YYYYMMDD format; document
- Added support for unseparated dates, for convenience in ghci and for parseHledgerVersion
- Noted two user-facing uses: --value's argument, and import's .latest files.
  YYYYMMDD dates will now also work there. Left this undocumented.
- Noted this is now more permissive, parsing many integers successfully; not expecting problems.
2025-04-22 16:59:57 -10:00
Simon Michael
98b40b2b0e ;dev: fix a warning 2025-04-22 12:26:55 -10:00
Simon Michael
b7509030c5 lib: Hledger.Data.Dates: parsedateM -> parsedate
M makes me think of monad and is awkward to type for this common helper; Maybe is expected for a parser.
2025-04-22 10:40:41 -10:00
Simon Michael
f37a4a7dcb lib: refactor, export getHomeSafe 2025-04-20 10:52:50 -10:00
Simon Michael
81238e5f27 feat: any:, all: queries allow more powerful transaction matching 2025-04-18 14:06:45 -10:00
Simon Michael
9340b73aae imp: improve/format errors for various failures [#2367]
These now call error' and show errors in the standard style:

- reading a nonexistent data file
- reading an unsafe dotted file name on windows
- web: using --socket on windows
- demo: demo not found
- demo: error while running asciinema
- diff: bad arguments
- print --match: no match found
- register --match: no match found
- roi: no investment transactions found
2025-04-11 08:06:47 -10:00
Simon Michael
454c669fe4 fix:cli,ui,web: consistent console error output independent of GHC version [#2367]
Hledger.Utils.IO helpers have been updated and new ones have been
added (exitOnExceptions, exitWithError) to allow consistent display of
program errors whether compiled with GHC <9.10, GHC 9.10, or GHC >9.10.
The trailing newlines added by GHC 9.10 are gone,
and so is the "uncaught exception" output added by GHC 9.12.
2025-04-11 08:06:47 -10:00
Simon Michael
9b6d3da677 ;cabal: update cabal files 2025-04-09 10:58:54 -10:00
Simon Michael
ee3b6c29ce ;pkg: allow ghc 9.12 2025-04-09 10:58:52 -10:00
Michael Rees
62071bc4c2 feat: timeclock: Add support for multiple clocked in sessions (#2141)
We now support having multiple sessions clocked in. These are paired by
account name if given on the out entry, and otherwise an out closes the
most recent in entry.

Note that this breaks some backwards compatibility, in that we
previously ignored the description on the clock out entry. To mitigate
this, a new hidden flag --timeclock-old has been added, which reverts to
the old behavior.
2025-04-03 11:19:18 -10:00
Simon Michael
2ff2fd1594 ;pkg: simplify LICENSE (try to fix github license detection) 2025-03-31 19:12:38 -10:00
Simon Michael
fb584e7e8b ;pkg: simplify LICENSE, add AUTHORS.md (try to fix github license detection) 2025-03-31 19:05:19 -10:00
Simon Michael
4535796d94 ;pkg: drop unused 2012 ledger parsing code
and possibly github-confusing license file
2025-03-31 19:04:14 -10:00
Simon Michael
20226283b8 ;pkg: tweak LICENSE files, try to get github to recognise 2025-03-31 18:18:10 -10:00
Simon Michael
47bb40f838 ;pkg: clean up LICENSE files, main module licensing headers 2025-03-31 18:10:19 -10:00
Simon Michael
8d1a8d3799 ;cabal: update cabal files 2025-03-31 17:40:30 -10:00
Simon Michael
ed6cef5c00 ;pkg: clean up package.yaml files
Consistent layout.
Group metadata at the top in similar order to `cabal format`.
2025-03-31 17:25:41 -10:00
Simon Michael
775507c2d4 ;pkg:cabal: specify GPLv3+ exactly; require cabal 2.2+ [#2359]
Previously our cabal files used cabal-version 1.12, and were in theory
buildable with any ancient version of cabal.  Now at least cabal 2.2
(or a version of stack built with with similar Cabal version) is
required to build hledger.
2025-03-31 16:55:36 -10:00
Simon Michael
b6ec245647 ;cabal: update cabal files 2025-03-31 16:33:50 -10:00
Simon Michael
cb6a9b2f97 ;pkg:cabal: update tested-with in all package.yamls 2025-03-31 16:27:40 -10:00
Thomas Miedema
e7cc2f1066 ;dev: lib: drop base-compat dependency 2025-03-31 16:21:38 -10:00
Thomas Miedema
4d5ff3fe4e ;dev: make doctest happy on ghc-8.10.7 2025-03-31 16:18:09 -10:00
Thomas Miedema
bf3d1b6b49 ;dev: extra >= 1.7.11 is required
Commit ff28aa32 introduced usage of Data.List.Extra.groupOnKey, which
first came with extra-1.7.11.

Fixes stack8.10.yaml build hopefully.
2025-03-31 16:18:09 -10:00
Simon Michael
efff1cfdb5 ;doc: finalise changelogs for 1.42.1 on 2025-03-12 2025-03-12 21:35:24 -10:00
Simon Michael
be1e921dca ;doc: update changelogs 2025-03-12 21:35:24 -10:00
Simon Michael
133560aa93 ;dev: csv: no need to test for unsupported feature [#2352] 2025-03-12 20:40:36 -10:00
Thomas Miedema
a8a0d3ee30 fix: csv: fix regression in parsing rules containing & (#2352) 2025-03-12 20:35:59 -10:00
Simon Michael
f7aec96db1 ;doc:changelogs: cleanups 2025-03-07 21:22:19 -10:00
Simon Michael
4e5506da1e ;cabal: update cabal files 2025-03-07 18:49:08 -10:00
Simon Michael
10c523c057 ;pkg: set version to 1.42.99 2025-03-07 18:49:07 -10:00
Simon Michael
fd0bcdfede ;doc: finalise changelogs for 1.42 on 2025-03-06 2025-03-07 06:36:53 -10:00
Simon Michael
8184d20b9f ;doc: update changelogs 2025-03-07 06:36:15 -10:00
Simon Michael
e25cd526b7 ;doc: update embedded manuals 2025-03-06 16:05:55 -10:00
Dmitry Astapov
1fc7006919 run: cache input files by (iopts, name), allows commands with different iopts 2025-03-06 11:54:00 -10:00
Simon Michael
d47107ab7a ;dev:readJournal: doc 2025-03-06 05:39:23 -10:00
Simon Michael
874771d47c dev:readJournal: assume default file name "-" rather than "(string)" [#2328]
"-" implies data from standard input so "string" is perhaps more
correct, but I think this is a harmless simplification and it
makes `files` output consistent when run by `run`.
2025-03-06 05:13:37 -10:00
Simon Michael
cb373447db fix:cli:paging: support older less, don't pass --use-color [#2335]
Older less versions (eg 551) require --use-colour, and break if --use-color is passed. So we no longer attempt to enable colour in less by default.
2025-03-04 16:38:25 -10:00
Thomas Miedema
2faceb8e1b feat: csv: allow multiple matchers on the same line
`If blocks` and `If tables` now allow multiple matchers on the same line
separated by `&&` (AND) or `&& !` (AND NOT).

Example `if block` with two matchers on the same line:

	if %description amazon && %date 2025-02-22
	    account2 expenses:books

Example `if table` with two matchers on the same line:

	if,account2
	%description amazon && %date 2025-02-22, expenses:books
2025-03-01 11:21:00 -10:00
Simon Michael
d346e56b79 dev: fix warnings, update yaml file, edit [#2340] 2025-02-27 13:41:48 -10:00
gesh
a24c39f13f fix: Use POSIX API to compute tty width (#2332)
On some systems, TERM is set to a value that doesn't have a valid
terminfo entry. Rather than hackily fall back on a value for TERM that
appears to work in most contexts (TERM=dumb) but which isn't guaranteed
anywhere to be valid, use proper POSIX ioctls to get the tty width.

This has the added bonus of also working on Windows.

In fact, we already settled on computing the terminal size in this way
in hledger-lib, so this commit centralizes the choice of the logic
there.

Also added a note for alternative methods and their tradeoffs, in case
this turns out to be fragile on some systems.
2025-02-27 13:41:48 -10:00
Thomas Miedema
5129a94bd7
;cln: unittest.hs: remove bothersome PackageImports (#2337)
When running `cd hledger-lib && ghci test/unittest.hs`, ghci complains
with:

```
  test/unittest.hs:7:1: error:
      Could not find module ‘Hledger’
      It is not a module in the current program, or in any known package.
    |
  7 | import "hledger-lib" Hledger (tests_Hledger)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Failed, no modules loaded.
```

This commit removes the "hledger-lib" package-qualified import, such
that above ghci command works as expected.

However, there is a comment in hledger-lib/test/unittest.hs that says:

> package-qualified import to avoid cabal missing-home-modules warning
> (and double-building ?)

The missing-home-modules warning and the double building can indeed be
reproduced by running (after removing the "hledger-lib"
package-qualified import): `cd hledger-lib && cabal build unittest`. It
will first build `hledger-lib`, then show a warning about
missing-home-modules, and then build `hledger-lib` again.

After comparing the unittest sections of hledger.cabal and
hledger-lib.cabal, the solution turned out to be to remove `./` from
hs-source-dirs for unittest. Don't ask me why though!

Overall it's a nice cleanup.
2025-02-26 11:54:59 -10:00
Joschua Kesper
5114962b2a feat:csv: add an encoding rule, allowing non-UTF8 CSV to be read [#2319]
Previously, hledger could read CSV files containing non-ascii
characters only if they are UTF8-encoded.  Now there is a new CSV
rule, encoding ENCODING, which allows reading CSV files with other
encodings.

This adds a dependency on the encoding library, which supports fewer
encodings than text-icu but does not require a third-party C library.
To avoid build issues on various platforms, we require version 0.10+.

This adds some use of the ImplicitParams language extension, required
by encoding's API, but only in a small code region.

This also changes the type of Reader's rReadFn; it now takes
a `Handle` rather than a `Text`, allowing more flexibility.
2025-02-15 14:48:30 -10:00
Simon Michael
39f3b2c7ba ;dev: doc 2025-01-31 02:04:40 -10:00
Simon Michael
63b939a201 imp:print: --invert now also negates balance assertion/assignment amounts [#2314] 2025-01-29 09:47:29 -10:00
Simon Michael
bbb06209e7 lib: +postingNegate 2025-01-29 09:42:15 -10:00
Simon Michael
0dca0911f3 lib: negatePostingAmount -> postingNegateMainAmount 2025-01-29 09:41:51 -10:00
Simon Michael
3e838e4d0f imp:print: support --invert [#2314] 2025-01-27 05:21:36 -10:00
Simon Michael
29885d15fa dev: refactor Hledger.Write.Html etc, reducing Lucid references
Clarify the HTML lib situation a bit, and clean up some imports.

Related: #2244
2025-01-25 11:53:51 -10:00
Simon Michael
14dd2c6200 dev: rename printHtml -> styledTableHtml 2025-01-25 11:53:51 -10:00
Simon Michael
adef1a8416 lib: add dropRawOpt, cliOptsDropArgs 2025-01-21 22:02:05 -10:00
Simon Michael
edfcd3554f lib: showAmountCost(B): drop leading whitespace 2025-01-15 16:28:43 -10:00
Simon Michael
e98af39e27 imp:pivot: support pivoting on amount (quantity) or cost 2025-01-15 13:47:04 -10:00
Simon Michael
e7e0b5c868 lib: Hledger.Data.Amount: showAmountCost 2025-01-15 13:22:03 -10:00
Simon Michael
90415875f5 imp:pivot: support pivoting on commodity symbol; doc improvements 2025-01-15 12:46:09 -10:00
Simon Michael
c23087f124 fix: show a week period beginning in the previous year correctly [#2304]
Eg the week beginning 2024-12-30 (which is week 1 of 2025 because the
thursday falls in 2025) was previously shown as 2024-W01, now 2025-W01.
2024-12-20 10:41:47 -10:00
Simon Michael
1a5353b988 dev: disable doctest testing error output, color breaks it 2024-12-20 08:51:38 -10:00
Simon Michael
aefa4e8f20 imp:cli: show first line of error messages in red
error' and usageError now redden and bolden the first line of error
messages, when ANSI codes are supported and permitted.
And warn goldens and boldens the first line of warning messages.
2024-12-20 08:51:38 -10:00
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