Commit Graph

3922 Commits

Author SHA1 Message Date
Simon Michael
e8672b3a18 fix:Hledger.Utils.String: quoteForCommandLine now quotes "&" [#2468]
This explains the mysterious "7".
2025-10-01 18:15:02 -10:00
Simon Michael
71b1293f06 fix:Hledger.Utils.String: quoteForCommandLine no longer quotes "7" [#2468]
7 is no longer considered a scary shell character.

(This appears to have been harmless, used only for formatting the
balance assertion failure message.)
2025-10-01 17:56:49 -10:00
Simon Michael
215ef5e12d fix:check accounts: don't garble non-ascii account names in errors [#2469]
This regressed in 1.27 or so.
2025-10-01 14:40:08 -10:00
Simon Michael
061d105fed dev:Hledger.Data.Journal: fix a recent ghc 9.6 / old base breakage 2025-09-29 19:31:49 -10:00
Simon Michael
2f007c93d2 dev: switch all qualifed imports to ImportQualifiedPost style 2025-09-29 19:28:59 -10:00
Simon Michael
e10f51e3ae ;cabal: update cabal files 2025-09-29 19:12:00 -10:00
Simon Michael
525f3e76e3 pkg: package.yaml files cleanup, consistency 2025-09-29 19:08:50 -10:00
Simon Michael
e51e6c4e3d ;dev: remove old prototype 2025-09-29 18:35:20 -10:00
Simon Michael
64832c65e8 ;dev: build everything with at least GHC2021 language extensions by default
Previously everything was built with hpack's default, which is Haskell2010.
2025-09-29 18:27:19 -10:00
Simon Michael
81f228cf7f ;doc:changelogs, relnotes:1.50.2 2025-09-26 15:27:15 -10:00
Simon Michael
2b86b806d9 ;doc:changelogs 2025-09-26 15:05:09 -10:00
Simon Michael
a2af816611 dev:Hledger.Utils.IO: inputToHandle -> textToHandle; set utf8 not utf8_bom 2025-09-26 01:08:48 -10:00
Simon Michael
5db4ee7420 dev:Hledger.Utils.IO: readHandlePortably, readHandlePortably' -> hGetContentsPortably 2025-09-26 01:08:43 -10:00
Simon Michael
9351c70f74 fix:csv: respect encoding rule when rules file is input file [#2465] 2025-09-26 00:34:01 -10:00
Simon Michael
8542d8beba imp:errors: improve decode failure wording [#2465] 2025-09-25 01:28:32 -10:00
Simon Michael
e414446076 imp: pivoting on the type tag normalises type values to their short spelling. 2025-09-25 01:11:03 -10:00
Simon Michael
b5f954abf5 imp:errors: decode failures now also mention a possible CSV encoding [#2465] 2025-09-24 10:40:30 -10:00
Simon Michael
19620ba61b ;pkg:lib: make hashtables bounds consistent in cabal file 2025-09-21 11:44:06 -07:00
hseg
240757b259
Avoid hashtables 1.3.x for best gcc compatibility [#2463]
* Forbid solving for hashtables 1.3

On modern gccs, this sometimes causes build failures, see
https://github.com/gregorycollins/hashtables/issues/97

* Propagate constraint to package.yaml too

* stack98: include valid hashtables version

* stack92: add valid hashtables version

* stack94: add valid hashtables version

* stack96: add valid hashtables version
2025-09-21 11:41:57 -07:00
Simon Michael
603185b600 ;doc:changelogs:clarify; show API changes in hledger & hledger-lib separately 2025-09-16 10:11:30 -07:00
Simon Michael
36a1cbaff6 ;doc: changelogs 2025-09-16 05:20:48 -07:00
Simon Michael
fe0d4fd3ec ;doc: changelogs 2025-09-16 04:24:00 -07:00
Stephen Morgan
f515c5f811 fix: balance: Don't display zero rows with --no-elide (#2454)
Zero rows with --no-elide should only be displayed if either --empty is
called or they have non-zero children at some depth.
2025-09-15 15:40:32 -07:00
Simon Michael
8c4e2e08b6 ;cabal: update cabal files 2025-09-13 06:57:22 +01:00
Simon Michael
1d0ea95b9c ;doc:changelogs 2025-09-11 11:09:12 +01:00
Simon Michael
6d164b48a0 imp:journal: in amounts, also allow and ignore empty {} (or {{}}) 2025-09-11 07:33:22 +01:00
Stephen Morgan
aad61e465d fix: balance: Correctly handle empty journals (#2452)
Eliminate several partial functions.
2025-09-11 07:29:27 +01:00
Simon Michael
82552b4ea8 ;doc: update embedded manuals 2025-09-03 20:22:46 +01:00
Simon Michael
8be3e85676 ;cabal: update cabal files 2025-09-03 20:22:40 +01:00
Simon Michael
7ee721eab0 ;pkg: set version to 1.50.99 2025-09-03 20:22:40 +01:00
Simon Michael
dc84d54ae1 ;cabal: update cabal files 2025-09-03 20:07:41 +01:00
Simon Michael
541e0ebf48 ;doc: finalise changelogs for 1.50 on 2025-09-03 2025-09-03 20:03:21 +01:00
Simon Michael
38116dce19 ;doc: update changelogs 2025-09-03 20:03:15 +01:00
Simon Michael
80e659b51c ;pkg: bump minimum supported GHC from 8.10.7 to 9.6 (and base 4.18)
System.IO.hGetContents' was the latest paper cut; I could keep
supporting ghc 8.10.7, or at least 9.0-9.4, released 2021-2023;
but feck it. Debian Stable has 9.6 and this time can be better spent.
2025-09-03 20:02:59 +01:00
Simon Michael
bc55e1c58f dev: fix liftA2, Foldable1 build errors with ghc <9.6 [#2395] 2025-09-03 20:02:12 +01:00
Simon Michael
4f03d22501 ;pkg: update tested-with 2025-09-03 20:00:16 +01:00
Simon Michael
00fae3ac3b fix: ensure liftA2 is imported, build with ghc <9.6
This broke in 1.43.1.
2025-09-02 08:00:08 +01:00
Simon Michael
91d785aee8 dev:fix: use compatible code rather than new T.show added yesterday 2025-09-01 20:08:17 +01:00
Simon Michael
65eb0b1f78 fix:timeclock: change misleadding error message in --old-timeclock mode 2025-09-01 08:49:11 +01:00
Simon Michael
9849f196cb fix:timeclock: process in parse order; fully support overlapping sessions [#2417]
We no longer attempt to process timeclock entries in time order - that
was a wrong requirement, probably given by me, that can't work.  Now
we just process them in parse order. This plus a little tweaking of
error checking fixes several ordering bugs with overlapping sessions
and also allows same-named overlapping sessions.

More cleanup will follow. More testing might show that --old-timeclock
is no longer needed.
2025-09-01 08:27:08 +01:00
Simon Michael
7ac0fa1aaa dev:TimeclockReader, Timeclock: refactor/reindent [#2417] 2025-09-01 08:27:01 +01:00
Simon Michael
a2710a5c2b dev:timeclock: make --old-timeclock parser call itself, not new parser [#2417]
There was no known visible bug, but this seems more correct.
2025-09-01 08:26:44 +01:00
Simon Michael
e37caf0f27 imp:journal: better error when attempting to include a rules file 2025-09-01 08:26:44 +01:00
Simon Michael
efe1d11edb fix:timeclock: --old-timeclock also affects included files [#2417]
This required changing the Reader type and passing InputOpts down to
journal's include directive parser.
2025-09-01 08:26:44 +01:00
Simon Michael
8bd9d92981 imp:timeclock: improve overlapping sessions error [#2417] 2025-09-01 06:03:26 +01:00
Simon Michael
04e6c140c0 imp:timeclock: more informative error output for clashing sessions [#2417] 2025-08-31 17:35:13 +01:00
Simon Michael
539a876e7a ;dev:Timeclock: indentation 2025-08-31 16:20:58 +01:00
Simon Michael
e6dbe5d231 fix:timeclock: sessions can begin at a same-named session's end time
Now we process entries in a more careful order: time, then parse
order, like journal format. This fixes the original issue and another
one mentioned at #2417.
2025-08-31 12:01:04 +01:00
Simon Michael
5a3e34cc55 imp:timeclock: syntax is more robust and featureful
The default timeclock parser (ie when not using --old-timeclock) has
the following changes, related to issues such as
[#2141], [#2365], [#2400], [#2417]:

- semicolon now always starts a comment; timeclock account names can't include semicolons
  (though journal account names still can)
- clock-in and clock-out entries now have different syntax
- clock-ins now require an account name
- clock-outs now can have a comment and tags
- the doc has been rewritten, and now mentions the --old-timeclock flag

- lib: accountnamep and modifiedaccountnamep now take a flag to allow semicolons or not
2025-08-31 10:58:37 +01:00
Simon Michael
97899f9a9b feat:csv: support data generating scripts
and rewrite the rules reader.
2025-08-28 21:38:38 +01:00
Simon Michael
c7878e88da lib:Hledger.Utils.IO: add warnIO 2025-08-28 21:38:38 +01:00
Simon Michael
b22f94007f dev: source, archive, rules reader: improve docs 2025-08-28 21:38:38 +01:00
Simon Michael
e796a00fc4 dev:import: drop archiving of original data
just archive clean data
2025-08-28 21:38:38 +01:00
Simon Michael
b64ddfe813 dev:rules reader: drop "fall back to reading latest archived" 2025-08-28 21:38:38 +01:00
Simon Michael
c60ec90756 dev:import: improve buggy detection of import command 2025-08-28 21:38:38 +01:00
Simon Michael
c515fedf70 feat:csv: support data cleaning scripts 2025-08-28 21:38:38 +01:00
Simon Michael
c930fd0952 imp:end value reports: future P directives don't influence report end/valuation date [#2445]
In end-value reports with unspecified end date, a market price later
than the latest transaction can extend the default report end date and
valuation date. Now, only market prices on or before "today" can do this;
market price declarations dated in the future will be ignored.

Report span and valuation date calculations have been clarified.
2025-08-28 17:26:42 +01:00
Simon Michael
4e52c7bd76 ;lib:spanExtend: improve doc 2025-08-28 17:26:42 +01:00
Stephen Morgan
ef5c220690 fix: balance: Clip account names in generateMultiBalanceAccount, not before (#2434)
Previously accounts were clipped in getPostings, however compound
balance reports re-use the output of getPostings for the different
subreports. This caused a problem when clipping erased the information
needed to determine the account type, as would be used by e.g.
incomestatement.

Add some extra tests for --count.
2025-08-28 05:26:42 +01:00
Simon Michael
8951e11584 fix:import: don't erase .latest files when there are no new txns [#2444]
Fixes a regression caused by the #2125 fix.
2025-08-25 19:25:52 +01:00
Simon Michael
e2bb24e902 dev: make LatestDatesForFile showable 2025-08-25 19:24:38 +01:00
Simon Michael
03262f3fff fix📟 don't use --mouse in default less options
Avoid an error on systems where less does not have mouse support.
2025-08-22 07:56:13 +01:00
Simon Michael
cb1d6a71a6 dev:import:archive: fix bugs in new code
Too hard to rebase
2025-08-14 19:22:52 +01:00
Simon Michael
7dfe2d84e7 dev:import: fix debug message 2025-08-14 17:52:54 +01:00
Simon Michael
88b451d6eb imp: when source rule finds no files, read the latest archived 2025-08-14 14:23:53 +01:00
Simon Michael
3dec0a8944 dev: indentation 2025-08-14 14:23:53 +01:00
Simon Michael
76dc6d089a feat:import:archive: archive data files, and process oldest first 2025-08-14 12:54:40 +01:00
Simon Michael
db7783b16d dev: cleanups 2025-08-14 12:54:40 +01:00
Simon Michael
bfbef4bcbb dev: refactor PrefixedFilePath 2025-08-14 12:37:11 +01:00
Simon Michael
cc3923d6d4 imp: the all: query now requires at least one posting 2025-08-03 06:34:00 +01:00
Simon Michael
f604b7a416 fix: accounts: a tag: query only matches account tags, not posting tags
Eg, `hledger accounts tag:t` lists only account a from this journal:

    account a  ; t:

    2025-01-01
        a          1
        b         -1  ; t:
2025-08-03 05:38:33 +01:00
Simon Michael
e69c72a6c7 dev: include: revert wrong error position fix; refactor
Errors in the main file are being reported a few lines too high,
due to the setOffset in includedirectivep.

It seems reverting this should have restored the original bug with
wrong line number in certain include error messages, but I can't find
that right now.
2025-07-28 11:57:46 +01:00
Simon Michael
79fbfb9f5f dev: Hledger.Utils.Parse: cleanups 2025-07-18 07:31:05 -07:00
Simon Michael
c48c41bcd2 dev:timeclock: cleanups 2025-07-18 07:17:45 -07:00
Simon Michael
b7e35f84a2 imp: include: add hidden --old-glob flag to restore old dot behaviour
This disables the workaround for Glob#49, allowing glob patterns to
find dot files and traverse dot directories again (sometimes too much).
2025-07-17 08:00:08 -07:00
Simon Michael
01e0c34b85 dev: Hledger.Utils.IO: getFlag helper, like getOpt 2025-07-17 07:51:05 -07:00
Simon Michael
5ec770badd imp: include: more flexible **; show the correct line in read errors 2025-07-16 06:52:19 -07:00
Simon Michael
b35dcfda28 imp: include: give a clearer error for trying to include a csv file
And note that other read errors may be unclear when occurring in included files.
2025-07-16 06:52:19 -07:00
Simon Michael
8215f19baa dev: include: cleanup 2025-07-16 06:52:19 -07:00
Simon Michael
3741f9f030 fix: include: report read failures with correct line number 2025-07-16 06:52:19 -07:00
Simon Michael
2dcfe22c89 imp: include: report ** without / as an error, for clarity 2025-07-16 06:52:19 -07:00
Simon Michael
460ae28826 imp: include: globs exclude current file; more cleanup 2025-07-16 06:52:19 -07:00
Simon Michael
b4a1add267 imp: include: more robust tests and glob pattern handling
This switches from filepattern back to Glob, which is more powerful.
New notes, implementation, workarounds and tests.
2025-07-16 06:52:19 -07:00
Simon Michael
1046f652b1 dev: PrefixedFilePath cleanups
And some helpers that weren't needed after all, but maybe in future
2025-07-16 06:52:19 -07:00
Simon Michael
28f60bcf92 dev: includedirectivep: refactor 2025-07-11 20:34:50 -07:00
Simon Michael
3a03927018 imp: include: show including file path in debug output 2025-07-11 20:12:13 -07:00
Simon Michael
0add2e90db imp: include: glob patterns always exclude the current file
Eg include **/*.journal is less likely no complain
2025-07-11 19:36:17 -07:00
Simon Michael
08017366b5 imp: file reading: demote some debug=6 output to level 7 2025-07-11 13:48:58 -07:00
Simon Michael
536589e2c2 imp: include: improve cycle and read failure error messages 2025-07-11 13:36:47 -07:00
Simon Michael
b71e001c51 imp: include: more robust ** patterns, and ignore dotted directories
** now ignores anything under dotted directories, ie directories whose
name begins with a dot. Eg .git/, foo/.secret/, etc.

Switched from Glob to filepattern lib.
2025-07-11 13:36:47 -07:00
Simon Michael
b1f416dee7 dev: parseIncludedFile: doc cleanup 2025-07-11 13:01:54 -07:00
Simon Michael
b7c4dc3b53 fix:journal: cyclic include error messages now show the correct line 2025-07-11 13:00:51 -07:00
Simon Michael
801a7adaa4 imp:include: better errors, eg for missing argument; more debug output 2025-07-11 12:13:52 -07:00
Simon Michael
c8a5b8eb37 dev: includedirectivep: cleanup 2025-07-11 12:13:12 -07:00
Simon Michael
f5d3b7bd38 fix:journal: include directive error messages now show the correct line
They were showing the line after the include directive, confusingly.
2025-07-11 11:55:29 -07:00
Simon Michael
251af8529f dev: Hledger.Utils.Parse: cleanups 2025-07-11 11:38:50 -07:00
Simon Michael
2815a1865f dev: includedirectivep: cleanups, docs 2025-07-11 11:38:50 -07:00
Simon Michael
b23af9275d imp: simplify bad account type error message 2025-07-09 12:00:13 -07:00
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