Simon Michael
f42b140d53
lib: note about strict Map
2018-09-27 10:51:36 -10:00
Simon Michael
855bd54d19
budget: declaration and (actual) amount sorting for bal --budget
...
Account declaration-aware sorting is the default throughout hledger now.
2018-09-24 08:31:19 -10:00
Simon Michael
f2b4fca9b0
docs: journal: more account sorting updates
...
[ci skip]
2018-09-23 18:04:20 -10:00
Simon Michael
7a9ca5f6a9
docs: journal: more account sorting updates
...
[ci skip]
2018-09-23 17:55:21 -10:00
Simon Michael
477caa31c5
docs: journal: remove account code from example
...
[ci skip]
2018-09-23 17:48:19 -10:00
Dmitry Astapov
8c79d6529d
lib: fix balance --budget in the presence of --value
2018-09-23 07:45:34 -10:00
Simon Michael
3de8c11de1
journal: a new account sorting mechanism, and a bunch of sorting fixes
...
A bunch of account sorting changes that got intermingled.
First, account codes have been dropped. They can still be parsed and
will be ignored, for now. I don't know if anyone used them.
Instead, account display order is now controlled by the order of account
directives, if any. From the mail list:
I'd like to drop account codes, introduced in hledger 1.9 to control
the display order of accounts. In my experience,
- they are tedious to maintain
- they duplicate/compete with the natural tendency to arrange account
directives to match your mental chart of accounts
- they duplicate/compete with the tree structure created by account
names
and it gets worse if you think about using them more extensively,
eg to classify accounts by type.
Instead, I plan to just let the position (parse order) of account
directives determine the display order of those declared accounts.
Undeclared accounts will be displayed after declared accounts,
sorted alphabetically as usual.
Second, the various account sorting modes have been implemented more
widely and more correctly. All sorting modes (alphabetically, by account
declaration, by amount) should now work correctly in almost all commands
and modes (non-tabular and tabular balance reports, tree and flat modes,
the accounts command). Sorting bugs have been fixed, eg #875 .
Only the budget report (balance --budget) does not yet support sorting.
Comprehensive functional tests for sorting in the accounts and balance
commands have been added. If you are confused by some sorting behaviour,
studying these tests is recommended, as sorting gets tricky.
2018-09-22 21:45:07 -10:00
Simon Michael
598129ad6a
lib: pushAccount -> pushDeclaredAccount
2018-09-22 21:06:29 -10:00
Simon Michael
8c18bada0c
lib, cli, ui, web: update cabal files
2018-09-22 21:01:23 -10:00
Simon Michael
03acd40668
lib, cli, ui, web: upper bound to avoid megaparsec 7 for now
2018-09-20 20:48:47 -10:00
Simon Michael
059ad9eb76
refactor: jaccounts -> jdeclaredaccounts
2018-09-17 05:52:13 -07:00
Simon Michael
8d3cddc907
drop another old csv import
2018-09-07 12:51:10 -07:00
Simon Michael
362705a981
update cabal files
2018-09-07 12:44:52 -07:00
Simon Michael
23bdac41d9
csv: merge lucamolteni's cassava/custom separators (squashed) ( #829 )
...
commit 5ba464de761b298e50d57a8b7d14bc28adb30d5d
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:54:12 2018 +0200
Fix CI 2
commit f060ae9449f4b61a915b0ed4629fc1ba9b66fb4a
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:30:08 2018 +0200
Fix CI build
commit af0719a33b9b72ad244ae80198d881a1f7145e9d
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:19:01 2018 +0200
Fix rebase
commit 1a24ddfa54dfb4ff1326e1a51005ffa82d3dc3c8
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Aug 10 16:25:24 2018 +0200
Fixed some GHC warnings
commit 1ac43398a359b5925ef71f53347698f1c6c510ef
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Aug 10 16:14:49 2018 +0200
Fix .cabal
commit 422456b925d8aa4ab3e869f51e98c2b1c3dcde0a
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 22:56:20 2018 +0200
Removed to-do list
commit 1118b762e4fd15c4fe7ba48ba86676706ea3a5a5
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 22:53:28 2018 +0200
Better test
commit 1146ed0941655668bf7684f18aa15c5f4b9b20c2
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 15:32:28 2018 +0200
Fix parsing
commit 4fc2374b2b81802990da30c96756aab54d77399c
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 22:11:11 2018 +0200
Parsing of separator
commit f7a61737f1ad4460ba20ca9b2e86eb21468abb33
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 14:29:23 2018 +0200
Almost separator in options
commit ac8841cf3b9c80914bc3271ad9b9ff4ae9ba48a7
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 14:16:59 2018 +0200
Separator in parseCSV
commit 92a8b9f6ba77ea4237f769641e03029ac88542ea
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 13:30:41 2018 +0200
separator option
commit ec417a81ae625647cf35e61776cdf02bdb2c6aea
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 10:45:26 2018 +0200
Removed one qualified import
commit 8b2f386c2f780adcd34cff3de7edceacc1d325a7
Author: Luca Molteni <volothamp@gmail.com>
Date: Wed Jun 20 14:01:12 2018 +0200
Removed string conversions
commit a14d0e099e28a286bb81770cfc9cb8f5c7e5cf1f
Author: Luca Molteni <volothamp@gmail.com>
Date: Wed Jun 20 10:23:20 2018 +0200
custom delimiter in cassava
commit 694d48e2bc1ada0037b90367c017f3082f68ed45
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:51:54 2018 +0200
Use Text.getContents - remove UTF-8 compatibility library
commit a7ada2cc60033ebdd796ca34cc2ec69a4f387843
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:49:34 2018 +0200
todo list
commit 58ec47d3987909f6bace50e3e647e30dadd5bf03
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:45:22 2018 +0200
CSV test now has unicode characters
commit b7851e94c3f1683b63ec7250a12bcde3b7bed691
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 16:59:39 2018 +0200
Use decode from Text
commit 79f59fd28ccaca08fcd718fcd8d00b1c1d65d7e1
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 13:28:57 2018 +0200
Use Text and Lazy Bytestring
commit 470c9bcb8dc00669beb4ef0303a1e7d9f7aecc89
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:30:22 2018 +0200
Use megaparsec error
commit f978848ba249ef4f67b855bea5d4e549290c205c
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:22:07 2018 +0200
Renamed qualify and remove Parsec
commit 152587fde204c43a55798d212e43f37cd3038c2e
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:12:36 2018 +0200
Use cassava mega parsec
commit cf281577a3d3a071196484a6fc8485f2ea1f7d67
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 14:01:47 2018 +0200
Removed Data.Vector
commit 1272e8e758369d8cc5778029a705b277355a5029
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 12:16:18 2018 +0200
Removed Parsec ParseError
commit ae07f043135a19307fd65b281ade37a74c76acb2
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 12:06:14 2018 +0200
Type sinonim for ParsecError
commit 8e15b253c11bd1c0c35a7641aeb18aa54e0ba9b0
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 11:16:08 2018 +0200
Replaced with typeclasses
commit 1ed46f9c175603611325f3d377004e4b85f29377
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 11:01:33 2018 +0200
Replaced Text/CSV with Cassava
commit 362f4111b5854145703174b976fc7acbd71b8783
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 10:34:37 2018 +0200
Use cassava parsin instead of Text/CSV
commit 83e678e371618687cf7c15a4e2cfa67f570b6b64
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 08:22:51 2018 +0200
Text CSV error messages
commit f922df71d274beeacab9fb2530b16c97f005cc08
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 21:45:20 2018 +0200
Better types
commit edd130781c84790a53bff2283e6041eb8232e7cf
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 21:34:59 2018 +0200
Conversion to Text CSV type
commit 0799383214483018ad2d977a3c8022414959c2b2
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 16:06:21 2018 +0200
First function with cassava
commit e92aeb151ff527b383ff3d0ced7764e81b71af82
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 13:47:34 2018 +0200
Added cassava as dependency
commit 5ea005c558a3939af7e5f0cd735a9b4da931228e
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 13:18:47 2018 +0200
Better .gitignore for multi idea modules
2018-09-07 12:34:51 -07:00
Simon Michael
65807162b3
tests: make doctests suite run with old ghcs
...
(Require a newer doctest which supports --fast and --verbose.)
2018-09-07 12:34:51 -07:00
Simon Michael
86750d5cde
tests: make doctests suite build with ghc 7.10
2018-09-07 12:34:51 -07:00
Simon Michael
91b111b60d
rename easytests_* to tests_*
2018-09-06 13:13:26 -07:00
Simon Michael
f388d9311a
update embedded manuals
2018-09-06 12:03:50 -07:00
Simon Michael
622153e022
lib: doctests: note ghc 7.10 build failure
...
[ci skip]
2018-09-04 14:42:03 -07:00
Simon Michael
ce96001cfc
lib: keep Tests building with ghc 7.10
...
The doctests test suite fails to bulid with ghc 7.10, not fixed.
2018-09-04 14:27:10 -07:00
Simon Michael
d14d6e2b68
tests: update doctests after Transaction Show change
2018-09-04 14:02:04 -07:00
Simon Michael
d893ed64a5
lib: drop hunittests test suite & HUnit dependency
2018-09-04 13:53:59 -07:00
Simon Michael
cc0cf995b3
lib: fix easytests test suite
2018-09-04 13:53:16 -07:00
Simon Michael
4003264129
lib: drop HUnit helpers, rename expectEqPP
2018-09-04 13:52:36 -07:00
Simon Michael
54db19e857
tests: convert & re-enable StringFormat tests
2018-09-04 13:51:08 -07:00
Simon Michael
51618adc37
tests: use is in a few more places
2018-09-04 13:39:21 -07:00
Simon Michael
7370f2a553
tests: Hledger -> easytest
2018-09-04 12:25:52 -07:00
Simon Michael
09d9fbf487
tests: Reports -> easytest
2018-09-04 12:23:07 -07:00
Simon Michael
241d0dbebd
tests: ReportOptions -> easytest
2018-09-04 11:54:40 -07:00
Simon Michael
3b63c2ff2f
tests: Transaction, Data -> easytest
2018-09-04 11:54:15 -07:00
Simon Michael
a8175d8b14
tests: Timeclock -> easytest
2018-09-04 11:30:48 -07:00
Simon Michael
8d1506a4a4
tests: Posting -> easytest
2018-09-04 10:26:22 -07:00
Simon Michael
c5cd0dc648
tests: Ledger -> easytest
2018-09-04 10:24:07 -07:00
Simon Michael
d5c756e6c8
tests: Journal -> easytest
2018-09-04 10:10:10 -07:00
Simon Michael
0499b3f7e5
tests: Amount -> easytest
2018-09-04 10:01:26 -07:00
Simon Michael
dcc44d10a5
lib: export HasCallStack from Hledger.Utils.Test
2018-09-04 09:59:48 -07:00
Simon Michael
c3755f9a52
tests: AccountName -> easytest
2018-09-04 07:40:27 -07:00
Simon Michael
5de679ce62
tests: Query -> easytest
2018-09-04 07:29:48 -07:00
Simon Michael
bbecb28cae
tests: Utils -> easytest
2018-09-03 15:54:53 -07:00
Simon Michael
f713a413ff
clarify expectEq' arguments
2018-09-03 15:54:13 -07:00
Simon Michael
f3709f241d
tests: port Read tests to easytest
2018-09-03 15:42:24 -07:00
Simon Michael
d1cff46ba7
tests: port CsvReader tests to easytest
2018-09-03 15:30:52 -07:00
Simon Michael
1fced57c81
lib: export expectEq' helper
2018-09-03 15:30:27 -07:00
Simon Michael
cd67f8ea68
tests: clear out old boilerplate
2018-08-31 18:12:17 -07:00
Simon Michael
d1a7cc1c09
port remaining Read.Common tests
2018-08-31 18:12:17 -07:00
Simon Michael
f124007acf
tests: dehyphenate test names
2018-08-31 18:12:17 -07:00
Simon Michael
be7866da59
tests: parsedate -> fromGregorian
2018-08-31 18:12:17 -07:00
Simon Michael
f108b56e61
uniquify modules' easytests, simplify imports
2018-08-20 14:31:31 +01:00
Simon Michael
6568784bf6
port remaining JournalReader tests
2018-08-20 14:31:31 +01:00
Simon Michael
9733e0378e
journal: restore/port more old unit tests
2018-08-20 10:38:51 +01:00
Simon Michael
776d575610
test helpers: more line breaks, clarify monadic behaviour
2018-08-20 10:38:02 +01:00
Simon Michael
d6fb96cb4c
tests: expectParse, expectParseError helpers; parse to end of input
2018-08-20 08:59:06 +01:00
Simon Michael
5d9d9a8edb
tests: drop obsolete helpers
2018-08-20 08:25:03 +01:00
Simon Michael
9c0483fef2
tests: port another to easytest
2018-08-20 08:22:31 +01:00
Simon Michael
1a38beaad1
drop old transactionp hunit tests
2018-08-19 19:12:26 +01:00
Simon Michael
7706f8498e
tests: comment
2018-08-19 19:05:59 +01:00
Simon Michael
89357bb7b6
another parse test helper, use the IO variant always, port more tests
2018-08-19 19:02:59 +01:00
Simon Michael
3e6159e632
replace a bunch of custom Show instances for easier troubleshooting
...
Custom Show instances were obscuring important details in test failure
output again. The best policy seems to be: stick with default derived
Show instances as far as possible, but when necessary customize them
to conform to haskell syntax so pretty-show can do its thing (eg when
they contain Day values, cf https://github.com/haskell/time/issues/101 ).
2018-08-19 18:17:49 +01:00
Simon Michael
2778f6cf8f
lib: restore some old unit tests
...
Also change nullsourcepos, tests prefer JournalSourcePos for some reason.
2018-08-19 18:13:01 +01:00
Simon Michael
150b40e465
tests: remove empty scope
2018-08-19 18:07:33 +01:00
Simon Michael
bdcfba4eaa
whitespace
2018-08-18 20:31:47 +01:00
Simon Michael
fc11b5130f
journal: another failing test from #807
2018-08-18 19:50:15 +01:00
Simon Michael
7ab8bc2685
tests: import cleanups
2018-08-18 19:47:52 +01:00
Simon Michael
a8031de729
tests: fix build error with GHC < 8.4
2018-08-18 19:26:07 +01:00
Simon Michael
6081fead11
lib: clarify package test suites, run all easytests
2018-08-18 15:20:15 +01:00
Simon Michael
582e088325
lib: tests/ -> test/
2018-08-18 15:20:15 +01:00
Simon Michael
d778a92561
tests: export HUnit/EasyTest from Hledger.Utils.Test; more helpers
2018-08-18 15:19:59 +01:00
Simon Michael
4d578c008f
typo
2018-08-18 13:40:01 +01:00
Simon Michael
e0e21a2c6c
lib: note
2018-08-18 07:30:23 +01:00
Simon Michael
9c3a57f615
lib: some test fixes ( #823 )
2018-08-17 14:18:24 +01:00
Simon Michael
b4c336c874
test/_test/it/_it helpers; refactor easytests
...
This makes skipping/unskipping tests easier, and improves readability
a bit.
Note it's also possible to just write the test name with no preceding
function, when the type is constrained (see Journal.hs).
2018-08-17 13:40:37 +01:00
Simon Michael
626247bacd
journal: unit tests (2 skipped) for periodtransactionp ( #823 )
2018-08-17 12:42:43 +01:00
Simon Michael
b1bbbf0d93
lib: expectParseEqIO helper
2018-08-17 12:42:05 +01:00
Simon Michael
43d973e8ab
lib: more verbose show instance for PeriodicTransaction
2018-08-17 12:41:45 +01:00
Simon Michael
1d775a7a9c
lib: D should not affect automated posting multiplier amounts ( fix #860 )
2018-08-17 07:39:17 +01:00
Simon Michael
13436637c6
lib: "decimal point" -> "decimal separator" in error message
2018-08-17 07:37:26 +01:00
Simon Michael
e35dd19cc8
lib: refactor: tighten up amountwithoutpricep
2018-08-17 06:51:07 +01:00
Simon Michael
e9c5d13ac1
lib: update old failing amountp/postingp tests, at last ( #812 )
2018-08-16 06:42:52 +01:00
Simon Michael
dab75d98c8
lib: expectEq', expectParseEq: pretty-print compared values ( #812 )
2018-08-16 06:31:37 +01:00
Simon Michael
536eadb809
lib: improve expectParseEq ( #812 )
...
Show a pretty parse error, and avoid sequenced scopes
which are confusing (you can't run only the second).
2018-08-16 06:03:44 +01:00
Simon Michael
09d8e302db
lib: use unspaced scopes to simplify command lines ( #812 )
2018-08-16 05:58:17 +01:00
Simon Michael
50d666d5a0
test: refactor, document, organise easytests, port amountp tests ( #812 )
2018-08-15 19:58:07 +01:00
Simon Michael
69325da110
comment out failing tests to fix CI ( #812 )
2018-08-15 11:30:53 +01:00
Simon Michael
ab7dc3294e
lib: more informative failure output for amount tests ( #812 )
2018-08-15 11:24:52 +01:00
Simon Michael
e6181efe95
lib: more compact show instance for Amounts ( #812 )
...
Amount's default show instance hid important details, making eg test
failures hard to understand. Showing full detail required increasing
the debug level which was inconvenient.
Now it has a single show instance which shows more information, is
fairly compact, and is pretty-printable with pretty-show.
Ellipses (..) in the output indicate where fields are
- not shown in full detail, and/or
- shown in pseudo syntax (double quoted) to work with pretty-show.
ghci> usd 1
OLD:
Amount {acommodity="$", aquantity=1.00, ..}
NEW:
Amount {acommodity = "$", aquantity = 1.00, aprice = NoPrice, astyle = AmountStyle "L False 2 Just '.' Nothing..", amultiplier = False}
MixedAmount's show instance is unchanged, but showMixedAmountDebug
is affected by this change:
ghci> putStrLn $ showMixedAmountDebug $ Mixed [usd 1]
OLD:
Mixed [Amount {acommodity="$", aquantity=1.00, aprice=, astyle=AmountStyle {ascommodityside = L, ascommodityspaced = False, asprecision = 2, asdecimalpoint = Just '.', asdigitgroups = Nothing}}]
NEW:
Mixed [Amount {acommodity="$", aquantity=1.00, aprice=, astyle=AmountStyle "L False 2 Just '.' Nothing.."}]
2018-08-15 11:18:55 +01:00
Simon Michael
4c268f4a93
doc: journal: fix Transaction Modifiers formatting
...
[ci skip]
2018-08-14 16:07:26 +01:00
Simon Michael
681039b387
doc: journal: fix Transaction Modifiers heading
...
[ci skip]
2018-08-14 16:05:06 +01:00
Simon Michael
27d464f344
lib: some helpers for setting Amount internals ( #812 )
2018-08-14 16:05:06 +01:00
Simon Michael
efae8f8f2a
lib: comment
2018-08-14 16:05:06 +01:00
Simon Michael
e077aeff5f
lib: more informative test failure message ( #812 )
2018-08-14 16:05:06 +01:00
Simon Michael
321635274c
lib: move assertParseEqual' ( #812 )
2018-08-14 16:05:06 +01:00
Simon Michael
b03584dbce
lib: parse helper haddocks
2018-08-14 16:05:06 +01:00
Simon Michael
cfaa0501e6
lib: update some journal parser tests ( #812 )
2018-08-14 16:05:06 +01:00
Jakub Zárybnický
c67404c73d
lib: Fix compile errors in tests
2018-08-14 16:05:06 +01:00
Simon Michael
e88a9c4a5f
lib: followingcomment: parse no comment as "", not "\n"
...
Same-line & next-line comments of transactions, postings, etc.
are now parsed a bit more precisely. Previously parsing no comment
gave the same result as an empty comment (a single newline); now
it gives an empty string.
Also, and perhaps as a consequence of the above, when there's no
same-line comment but there is a next-line comment, we'll insert an
empty first line, otherwise next-line comments would get moved up to
the same line when rendered.
Some doctests have been added.
2018-08-03 19:38:55 +01:00
Simon Michael
46d6971da7
lib: doctests: file pattern arguments, more informative output
...
Limiting to just the file(s) you're interested can make doctest start
much quicker. With a big caveat: you can limit the starting files,
but it will also test all other local files those import.
2018-08-03 19:06:17 +01:00
Simon Michael
df430e5eb0
lib: AccountName: set OverloadedStrings for doctests
2018-08-03 19:05:14 +01:00
Simon Michael
ed93807ee5
lib: doctests: add --verbose and --slow flags to executable
...
--slow turns off doctest's --fast flag, which skips reloading between
tests.
--verbose shows progress output as tests are run, if doctest 0.16.0+
is installed (and I believe will be harmless otherwise)
2018-08-03 19:05:14 +01:00
Simon Michael
0135f8c863
tools: make doctest: use default snapshot/ghc 8.4, mention mac workaround
2018-08-03 19:05:11 +01:00
Joseph Weston
40d70ad10b
lib: fail when file to include is in stack of 'include' files
2018-08-02 18:43:00 +01:00
Joseph Weston
1d91ea43a5
lib: add whitespace around '$' operator
2018-08-02 18:43:00 +01:00
Simon Michael
86c36c1dcc
update embedded manuals
2018-08-02 08:25:49 +01:00
Simon Michael
481e2061d7
doc: journal: tweak mnemonics
2018-08-02 08:25:49 +01:00
Simon Michael
64bd88dd80
doc: journal: rename topic to Transaction Modifiers
2018-08-02 08:25:49 +01:00
Simon Michael
d685d1aa9b
lib,rewrite: simplify transactionModifierToFunction
...
This removes transactionModifierToFunction's extra query parameter;
the rewrite command sets it in the TransactionModifier instead, which
I think is equivalent. I had to change one functional test, but it
seems correct now, so perhaps it wasn't working right before ?
2018-08-02 08:25:49 +01:00
Simon Michael
72acb86299
cabal: bump tested-with declarations
2018-08-02 08:25:49 +01:00
Simon Michael
1e0a7ec8f1
remove some unneeded CPP pragmas
2018-08-02 08:25:49 +01:00
Simon Michael
eae9d78bb1
lib: generateAutomaticPostings -> applyTransactionModifiers
2018-08-02 08:25:49 +01:00
Simon Michael
bb36693155
lib: refactor, txnTieKnot automatically
2018-08-02 08:25:49 +01:00
Simon Michael
572f5a4b31
lib: drop parseAndFinaliseJournal', seems unused (api change)
2018-08-02 08:25:49 +01:00
Simon Michael
a49b1cd3bb
lib: AutoTransaction.hs -> TransactionModifier.hs, PeriodicTransaction.hs
2018-07-30 20:22:39 +01:00
Simon Michael
efc54c4c25
lib: ModifierTransaction -> TransactionModifier; try to clarify a bit
2018-07-30 19:38:21 +01:00
Simon Michael
007b9f8caa
lib: capitalised month names broke some period expressions ( fix #852 )
...
This was a regression in hledger 1.10.
mon[th]Index are now case insensitive.
2018-07-30 11:08:23 +01:00
Simon Michael
daa37a9993
lib: nthdayof(month|year)containing now validate input a bit ( #852 )
2018-07-30 11:08:14 +01:00
Simon Michael
0f3a030a40
lib: whitespace
2018-07-30 11:05:02 +01:00
Simon Michael
eb6baac6e7
lib: make applyN more robust ( #852 )
2018-07-30 11:04:33 +01:00
Simon Michael
d9d94e2cf6
journal: fix breakage in auto posting rule parser ( #745 )
...
I was negligent and did not test enough. This should ignore
transaction comments in auto posting rules more safely.
It also adds support for trailing comments on the first line of auto
posting rules, which previously were misparsed as part of the query.
2018-07-26 15:54:21 +01:00
Simon Michael
e2f5e98926
lib: clarify account name parsing rules
2018-07-26 08:30:32 +01:00
Simon Michael
41c985b5fb
journal: ignore transaction comments in auto posting rules ( #745 )
...
Previously they were misparsed as account names.
2018-07-26 08:29:02 +01:00
Joseph Weston
e23160059e
lib: add generated man files
2018-07-26 06:12:31 +01:00
Joseph Weston
1fca47cf18
lib: update documentation for globs in 'include' directive
2018-07-26 06:12:31 +01:00
Joseph Weston
f2c1586238
lib: sort the matched include files lexicographically
...
Now the files are included in the same order as they would be
listed by 'ls'.
2018-07-26 06:12:31 +01:00
Joseph Weston
1ec16c2dc0
lib: explicitly specify that the 'Glob' package should be used
...
Without this there are conflicts with the 'filemanip' package,
which itself exports a module 'System.FilePath.Glob'.
2018-07-26 06:12:31 +01:00
Joseph Weston
c69b16d826
lib: prefer use of 'parseErrorAt' to generic 'fail'
...
'fail' will just terminate the current parse branch, whereas here
we have encountered a definite error. Also bring the code to
get the current working directory inside 'getFilePaths', as it
logically belongs there.
2018-07-26 06:12:31 +01:00
Joseph Weston
5077443a84
lib: add tests and code for nonexistant files and malformed globs
2018-07-26 06:12:31 +01:00
Joseph Weston
2c4d0c0acd
lib: factor out logic for obtaining a list of files to include
2018-07-26 06:12:31 +01:00
Joseph Weston
2d420a33a4
lib: update cabal file with 'Glob' library depdendency
2018-07-26 06:12:31 +01:00
Joseph Weston
0ade323d2a
lib: use glob matching if filename in 'include' directive is a glob pattern
2018-07-26 06:12:31 +01:00
Joseph Weston
96f7a03487
lib: factor out parsing child journal into separate function
2018-07-26 06:12:31 +01:00
Joseph Weston
52da073828
lib: expand current directory separately from filepath
...
We will need the current directory as an absolute path when
adding glob patterns in a few commits time.
2018-07-26 06:12:31 +01:00
Joseph Weston
9e56ad24e2
lib: reorder code for reading include files
...
This should be before all journal and parser state manipulations,
so that those can be readily factored in a few commits time.
2018-07-26 06:12:31 +01:00
Simon Michael
aab7d2d964
lib: fix error triggered by upper-case day in period expression ( #847 )
2018-07-24 14:36:45 +01:00
Simon Michael
da8047d286
lib: type signatures
2018-07-24 14:24:45 +01:00
Simon Michael
fe73f2a6b5
csv: interpolated field names in values are now case insensitive
...
Field names are supposed to be case insensitive, but a field assignment like
fields ...,Transaction_Date,...
date %Transaction_Date
was failing, because of the capitalised letters. Fixed now.
2018-07-22 22:26:24 +01:00
Simon Michael
aebd6c50d6
smooth: smoothes out irregular transactions (experimental addon)
2018-07-16 23:36:06 +01:00
Simon Michael
d5430e7ddf
clean up debug helpers (api change)
2018-07-16 15:28:58 +01:00
Simon Michael
9d2e80aa2c
lib: Debug: simplify pprint, export ppShow as pshow (api change)
2018-07-16 12:51:50 +01:00
Simon Michael
92404bb847
prices: allow filtering by query, clarify docs
...
Query arguments are allowed, prices can be filtered by date, and
postings providing transaction prices can be filtered by anything.
2018-07-15 09:21:10 +01:00
Simon Michael
91e5baf617
lib: clean up queryDateSpan, queryDateSpan' (api change)
...
These now intersect date AND'ed date spans, instead of unioning them,
and docs are clearer.
2018-07-15 08:35:39 +01:00
Simon Michael
d461e96c34
doc: update manuals harder, they should say 1.10.99
...
[ci skip]
2018-07-04 15:09:57 +01:00
Simon Michael
4f40467d86
update embedded manuals
2018-07-04 13:33:27 +01:00
Simon Michael
d62f082bce
bump version to 1.10.99 (dev)
2018-07-04 13:32:42 +01:00
Simon Michael
91c487d4c2
doc: manuals: update version strings
2018-07-04 12:52:29 +01:00
Simon Michael
8d6667f698
lib: doc: forecast transaction dates tweak ( #835 )
...
[ci skip]
2018-07-04 09:48:32 +01:00
Simon Michael
0322638cf5
lib: doc: clarify how forecast transaction dates work ( #835 )
...
[ci skip]
2018-07-04 09:41:12 +01:00
Simon Michael
22f2e90a4b
update embedded manuals
2018-06-30 22:08:48 +01:00
Simon Michael
6242b1d784
bump version to 1.10
2018-06-30 22:08:02 +01:00
Simon Michael
6b8fcd7205
changelogs
2018-06-30 21:57:06 +01:00
Simon Michael
937333c2c1
doc: journal: more account codes limitations
...
[ci skip]
2018-06-27 12:42:05 +01:00
Simon Michael
2959356bd9
doc: journal: note another account codes limitation, in flat mode
...
[ci skip]
2018-06-27 12:19:25 +01:00
Simon Michael
35e68e23c5
doc: journal: clarify account aliases doc
...
[ci skip]
2018-06-27 11:44:26 +01:00
Simon Michael
6d215945b6
doc: journal: clarify account aliases doc
...
[ci skip]
2018-06-27 11:41:11 +01:00
Simon Michael
6924e8390c
lib: journal: let alias/apply account affect account directives ( #825 )
2018-06-27 11:33:12 +01:00
Simon Michael
422f1084c9
doc: journal: note that non-regex alias directive is case sensitive
...
[ci skip]
2018-06-27 11:15:46 +01:00
Alex Chen
e82b01bcf8
lib: refine parse errors and parser labels
2018-06-20 23:24:39 -06:00
Alex Chen
9674f2a8cc
lib: tweak whitespace parsing for better parse errors
...
- expands the set of expected tokens when e.g. parsing the invalid
posting `account $1 a`
- whitespace can affect parse errors because of the longest match rule
where errors that occur later take precedence over those that occur
earlier
2018-06-20 23:24:39 -06:00
Alex Chen
ed0106b209
lib: reduce backtracking of various parsers
2018-06-20 23:24:39 -06:00
Alex Chen
e3a755b5b1
lib: refactor amount parsers to minimize backtracking
...
- inline `spaceamountormissingp` into `postingp`
- combine `rightsymbolamountp` and `nosymbolamountp`
- the multiplier symbol '*' for an amount must now always preceed a sign '-'
[breaking change]
- make amount parser labels more generic to simplify error messages
2018-06-20 23:24:39 -06:00
Alex Chen
89b1fd7de3
lib: refactor date-time parser, add error messages
...
- also removed commented-out time-zone code
2018-06-20 23:24:39 -06:00
Simon Michael
bc9375e4e5
lib: doc: journal: describe current directive semantics, finally
...
It's amazing how you can build, document, support and fix a thing for
years and not know what exactly it does. Directives are tricky.
Here is a pretty accurate description of their current behaviour,
determined by testing.
2018-06-20 19:41:28 -07:00
Simon Michael
26489765ef
lib: manual updates
...
[ci skip]
2018-06-20 18:44:34 -07:00
Simon Michael
816ba0f89d
consistent comment wording
2018-06-18 17:54:25 -07:00
Simon Michael
b04dc82125
lib: doc: journal: clarify periodic transactions
...
[ci skip]
2018-06-18 17:54:07 -07:00
Simon Michael
c4d45cffc4
lib: journal: require a space between period expr. and other fields
2018-06-12 16:41:36 -07:00
Simon Michael
eb23504906
lib: periodexprp: don't consume trailing whitespace
2018-06-12 16:41:36 -07:00
Alex Chen
c6bfd92dd3
removing "re-parsing" for pull 807
...
For Data/Dates.hs in particular:
- Changed `SimpleTextParser` to `TextParser m` for all parsers
- Changed `string` to the case-insensitive `string'` to match the
behaviour of `T.toLower` found in `parsePeriodExpr`
- export `periodexprp` for "direct" use
2018-06-12 16:41:36 -07:00
Simon Michael
57f41697ba
update embedded manuals
2018-06-12 16:41:36 -07:00
Simon Michael
e3507ad944
lib: journal: allow descriptions/comments in periodic transactions
...
Also period expressions relative to today's date can now be used,
for what it's worth.
2018-06-12 16:41:36 -07:00
Simon Michael
dfcafc2cdf
lib: refactor some journal, period expression parsers
2018-06-12 16:41:36 -07:00
Simon Michael
1287081ffd
tools: doctest: slight cleanup
2018-06-12 16:41:36 -07:00
Simon Michael
7a4c3eea65
lib: doc: periodic/auto rule cleanups
2018-06-12 16:41:36 -07:00
Alex Chen
0fb737bc39
lib: reduce backtracking in commoditydirectiveonelinep
2018-06-11 14:29:18 -06:00
Alex Chen
0382bb5cd4
lib: move custom parse errors to Text.Megaparsec.Custom
2018-06-11 13:58:56 -06:00
Alex Chen
846a38139d
lib: add license to the code copied from megaparsec
2018-06-11 13:58:56 -06:00
Alex Chen
2b22f857ac
lib: make the parse errors module backwards compatible
2018-06-11 13:58:56 -06:00
Alex Chen
ff2b042c7e
lib: remove the ErroringJournalParser type
2018-06-11 13:58:56 -06:00
Alex Chen
39e7ef0311
lib: refine date parser error messages
2018-06-11 13:58:55 -06:00
Alex Chen
132f8706d7
lib: edit comments to satisfy doctest
2018-06-11 13:57:30 -06:00
Alex Chen
5f87e7cd5d
lib: enable the custom parse errors
2018-06-11 13:57:30 -06:00
Alex Chen
2d21ec0174
lib: weaken parser types
2018-06-11 13:57:30 -06:00
Alex Chen
4a9e418b7a
lib: refactor includedirectivep to avoid "re-parsing"
2018-06-11 13:57:30 -06:00
Alex Chen
b034fa7ca9
lib: weaken parser types
2018-06-11 13:57:30 -06:00
Alex Chen
9b6558401f
lib: rewrite comment parsers [API]
...
- avoid the "re-parsing" of comments using the `match` parser combinator
2018-06-11 13:57:30 -06:00
Alex Chen
d707b351cc
lib: switch to custom parse errors for parserErrorAt
...
Also weaken the types of the parsers that use it
2018-06-11 13:57:30 -06:00
Alex Chen
c5561f25f1
lib: switch parsers to the custom error type
...
Also add an explicit export list to `hledger-lib/Hledger/Utils/Parse.hs`
in order to re-export the custom error type (for convenience).
2018-06-11 13:57:30 -06:00
Alex Chen
ca201e4618
lib: add a module for custom parse errors
...
... for displaying the source line on which parse errors occured
Over the following set of commits, I will to refactor the parsers to
obviate the `ExceptT String` layer of the `ErroringJournalParser` type
so that all parse errors go through Megaparsec's parse error machinery.
2018-06-11 13:57:22 -06:00
Simon Michael
42f47e2b6b
update embedded manuals
...
[ci skip]
2018-06-08 17:27:04 -07:00
trevorriles
9b1343d0b9
Add fast flag to doctests.
...
Fixes #802
2018-06-07 10:41:09 -05:00
Simon Michael
061aad0431
remove some CPP that's obsolete since we require base 4.8+
2018-06-04 17:33:21 -07:00
Simon Michael
7ebecb1ab8
use newer hashtables to fix an instance warning with doctests/ghc 7 ( #794 )
2018-06-04 17:33:17 -07:00
Simon Michael
0ce9c5728a
switch to base-compat-batteries to fix ghc 7.10 support ( #794 )
...
base-compat-batteries provides the same API across more ghc versions
than base-compat does, at the cost of more dependencies. Eg it exports
Prelude.Compat ((<>)) with ghc 7.10/base 4.8, which we expect.
My belief is that several of our deps already require it so the added
cost is not too great. We should probably go back to base-compat when
possible though, eg when we stop supporting ghc 7.10.
2018-06-04 17:32:42 -07:00
Simon Michael
328b2dabfe
require latest base-compat, might as well ( #794 )
2018-06-04 17:32:32 -07:00
Peter Simons
6db7f800ee
hledger-lib: fix doctest suite after recent package updates
...
The new version of our package set apparently contains both base-compat and
base-compat-batteries in its transitive closure. This breaks the doctest suite,
which just imports everything into scope when the tests are run, thereby making
module names like Prelude.Compat ambiguous.
2018-06-04 21:41:15 +02:00
Peter Simons
8c0c168cd6
Fix the build of hledger-lib with ghc 8.0.x and base-compat 0.10.x.
...
We don't need to import Data.Monoid because Prelude.Compat exports "<>"
already. In fact, importing that module causes build failures:
Hledger/Read/Common.hs:725:62: error:
Ambiguous occurrence ‘<>’
It could refer to either ‘Sem.<>’,
imported from ‘Prelude.Compat’ at Hledger/Read/Common.hs:97:1-39
(and originally defined in ‘Data.Semigroup’)
or ‘Data.Monoid.<>’,
imported from ‘Data.Monoid’ at Hledger/Read/Common.hs:110:1-18
Fixes https://github.com/simonmichael/hledger/issues/794 .
2018-06-04 20:58:58 +02:00
Simon Michael
66fbdc5d61
lib: enable doctests on mac again, note workaround, fix link
...
[ci skip]
2018-06-01 07:18:12 -07:00
Alex Chen
1116261f5a
lib: simplify fromRawNumber
2018-05-27 07:50:26 -07:00
Alex Chen
c3f5659d75
lib: add some strictness annotations to the parser
...
This was done to reverse minor performance regressions introduced in the
previous commits
2018-05-27 07:50:26 -07:00
Alex Chen
d79e707485
lib: remove redundant check in accountnamep
2018-05-27 07:50:26 -07:00
Alex Chen
43aa3d479e
lib: fix up runJournalParser
2018-05-27 07:50:26 -07:00
Alex Chen
d56fca1ba2
lib: superficial parser cleanups
2018-05-27 07:50:26 -07:00