Commit Graph

3020 Commits

Author SHA1 Message Date
Simon Michael
1da7d4b7f7 imp: balanced, balancednoautoconversion: use new error format (#1436) 2022-07-10 12:12:03 +01:00
Simon Michael
b7e6583a72 imp: balance assertions now use new error format (#1436) 2022-07-10 11:39:41 +01:00
Simon Michael
42bcbad2fd imp: bal: budget goals now respect -H (#1879) 2022-07-09 09:59:17 +01:00
Stephen Morgan
3e60e784f3 fix: bal: Allow cumulative gain and valuechange reports
Previously, --cumulative with --gain or --valuechange would produce an
empty report. This fixes this issue to produce a reasonable report.
2022-07-08 16:34:23 +01:00
Simon Michael
dd14f9c822 imp: lib: Hledger.Utils.Parse: export HledgerParseErrors 2022-06-29 09:58:56 +01:00
Simon Michael
0c6cd819f2 ;doc: changelogs cleanup 2022-06-05 00:59:36 +01:00
Simon Michael
6017e5f237 ;doc: update changelogs 2022-06-05 00:56:10 +01:00
Simon Michael
f2db4c3840 ;cabal: update cabal files 2022-06-05 00:32:18 +01:00
Simon Michael
3e728b1d36 ;pkg: bump version to 1.26.99 2022-06-05 00:32:18 +01:00
Simon Michael
d8cce23b3f ;doc: changelogs: link 1.26 issues 2022-06-05 00:03:22 +01:00
Simon Michael
729a8b81e0 ;doc: update changelogs 2022-06-05 00:03:10 +01:00
Simon Michael
9833482c06 ;doc: update manuals 2022-06-05 00:02:59 +01:00
Simon Michael
d27a581e0f ;doc: update changelogs 2022-06-04 11:28:59 +01:00
Simon Michael
faa05764d7 ;cabal: update cabal files 2022-06-04 11:24:56 +01:00
Simon Michael
05dffe5029 imp: lib: allow doclayout 0.4 2022-06-04 11:24:35 +01:00
Stephen Morgan
9155d679fe fix!: Revert "fix!: utf-8: Use with-utf8 to ensure all files are read and written with utf8 encoding. (#1619)"
This reverts commit e233f001c5.

This would break at least some people's workflow. A lighter touch is
probably sufficient.
2022-06-01 09:35:18 +10:00
Simon Michael
1085a2a777 ;doc: update changelogs 2022-05-29 08:05:33 -10:00
Simon Michael
2bce910904 ;doc: update manuals 2022-05-25 11:35:47 -10:00
Simon Michael
a9779b2377 ref: move journal checking/pretty errors down further, to Hledger.Data
now at Hledger.Data.JournalChecks*, Hledger.Data.Errors
2022-05-21 18:29:13 -10:00
Simon Michael
307f723b0a lib: simpler, more consistent names for check functions
API changes:
journalCheckAccountsDeclared
journalCheckCommoditiesDeclared
journalCheckPayeesDeclared
->
journalCheckAccounts
journalCheckCommodities
journalCheckPayees
2022-05-21 18:29:13 -10:00
Simon Michael
65e913b7c5
Merge pull request #1834 from Xitian9/utf8
Use with-utf8 and don't use Data.Text.IO.
2022-05-21 17:50:59 -10:00
Stephen Morgan
e233f001c5 fix!: utf-8: Use with-utf8 to ensure all files are read and written with utf8 encoding. (#1619)
May also fix #1154, #1033, #708, #536, #73: testing is needed.

This aims to solve all problems where misconfigured locales lead to
parsers failing on utf8-encoded data. This should hopefully avoid
encoding issues, but since it fundamentally alters how encoding is dealt
with it may lead to unexpected outcomes. Widespread testing on a number
of different platforms would be useful.
2022-05-22 13:12:19 +10:00
Stephen Morgan
15a5d5d38b
Merge pull request #1814 from Xitian9/csverror
imp: csv: Give an error if unable to substitute csv templates. (#1803)
2022-05-22 11:35:39 +10:00
Simon Michael
db26456e1c imp: consolidate ordereddates check under Hledger.Read.Checks too
And remove the last vestiges of older more complex behaviour.
ordereddates now always checks all transactions in each file,
unaffected by a query. (But still affected by --date2).
2022-05-09 00:05:39 -10:00
Simon Michael
810a868c88 ref: consolidate most checks under Hledger.Read.Checks
and error message helpers in Hledger.Read.Error.
2022-05-09 00:04:33 -10:00
Simon Michael
2f8f922256 dev: fix doctests after "Error: " addition (#1436) 2022-04-25 02:56:59 -10:00
Simon Michael
a00dc04e0d imp: check: uniqueleafnames: use the standard error format (#1436)
Hledger.Read.Common:
export makePostingErrorExcerpt
2022-04-25 02:56:59 -10:00
Simon Michael
7e45ab338f imp: check: show column ranges properly (#1436) 2022-04-25 02:56:59 -10:00
Simon Michael
66d0beea5e imp: check: ordereddates: use the standard error format (#1436)
Hledger.Read.Common:
export makeTransactionErrorExcerpt
2022-04-25 02:56:59 -10:00
Simon Michael
792434ca7d imp: check: payees: use the standard error format (#1436) 2022-04-25 02:56:59 -10:00
Simon Michael
c7e8f58c33 imp: check: mark all error columns when that's preferable (#1436)
Undeclared commodity errors now mark the whole amount and assertion
region, since locating the exact position of commodity symbols is
difficult.
2022-04-25 02:56:59 -10:00
Simon Michael
8f4405e628 dev: check: refactor error messages (#1436) 2022-04-25 02:56:59 -10:00
Simon Michael
6ec0e05c42 imp: check: commodities: use the standard error format (#1436) 2022-04-25 02:56:59 -10:00
Simon Michael
4b3644d780 imp: check: accounts: print a standardised error message like megaparsec's (#1436)
added:
formatExcerptLikeMegaparsec
2022-04-25 02:56:59 -10:00
Simon Michael
f47d423a67 lib: error' now adds an Error: prefix 2022-04-25 02:56:59 -10:00
Simon Michael
5ab7b9f643 ref: HledgerParseErrors type alias 2022-04-25 02:56:59 -10:00
Simon Michael
2f28e1b0a7 ref: rename CustomErr -> HledgerParseErrorData
Verbose, but use every chance to clarify the complicated parse error
situation.
2022-04-25 02:56:59 -10:00
Simon Michael
81ad760e49 test: disable doctest for all but GHC 9.2 2022-04-25 01:36:14 -10:00
Simon Michael
353312e045 lib: enable doctests with GHC 9.2+ (#1503)
https://github.com/sol/doctest/issues/301 /
https://github.com/sol/doctest/issues/327
seem to be specific to GHC 9.0.
2022-04-25 00:33:07 -10:00
Simon Michael
53332ee6a5 stack: re-enable hledger-web with ghc 9.2 2022-04-15 15:07:17 -10:00
Simon Michael
133c54434a ;doc: changelogs 2022-04-14 13:59:03 -10:00
Simon Michael
8de85be658 ;doc: update manuals 2022-04-14 12:39:18 -10:00
Simon Michael
5af224d534 fix: tags: also match accounts declared but not used (#1857)
By default, all account declarations and all transactions are searched;
but when there's a query involving transaction fields,
account declarations unrelated to the matched transactions are not searched.

added:
queryIsCode
queryIsTransactionRelated
2022-04-14 12:28:43 -10:00
Simon Michael
4f26309328 ref: clean up Query definition 2022-04-14 11:56:37 -10:00
Simon Michael
161c911cb4 imp: Hledger.Query: new predicates, haddock cleanups
added:
matchesQuery,
queryIsAccountRelated,
queryIsTransactionOrPostingRelated,
2022-04-14 10:58:31 -10:00
Stephen Morgan
8cc59df513 fix: Ensure date2 is used for journal valuation if requested. (#1851) 2022-04-14 07:27:17 -10:00
Simon Michael
aa3807e157 ref: journalAccountTypes 2022-04-11 09:18:23 -10:00
Stephen Morgan
c48d98c515 imp: csv: Substitute empty string if csv template fails. (#1803) 2022-03-29 18:03:33 +11:00
Stephen Morgan
1aff74f702 cln: Reduce duplication in test utilities. 2022-03-26 15:35:19 -10:00
Stephen Morgan
8968733630 cln!: Clean up journal parsing.
parseAndFinaliseJournal' has been removed. In the unlikely event you
needed it in your code, you can replace it with:
parseAndFinaliseJournal' parser iopts fp t =>
initialiseAndParseJournal parser iopts fp t
>>= liftEither . journalApplyAliases (aliasesFromOpts iopts)
>>= journalFinalise iopts fp t

Some parsers have been generalised from JournalParser to TextParser.
2022-03-26 15:35:19 -10:00