Commit Graph

3737 Commits

Author SHA1 Message Date
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