Mykola Orliuk
097486a247
;lib: re-enable doctests
2019-11-19 03:58:56 -08:00
Dmitry Astapov
c4d650e6ad
lib: balance-style -> balance-type
2019-11-13 09:06:25 -08:00
Dmitry Astapov
39bc183340
lib: csv reader gets balance-style directive
2019-11-13 09:06:25 -08:00
Simon Michael
fb3c1a132c
csv: fix parsing of whitespace on line after an if block ( fix #1120 )
2019-11-13 05:41:32 -08:00
Dmitry Astapov
94f912e558
lib: better resolution of csv field aliases ("balance" vs "balance1", etc)
2019-11-12 12:20:09 -08:00
Simon Michael
c4d7cc198a
csv: finalise and check journals generated from CSV ( #1000 )
...
Invalid transactions generated from CSV will now be rejected.
I updated some csv tests to avoid this, except for 21, which
probably needs more cleanup.
2019-11-07 18:58:12 -08:00
Dmitry Astapov
fc001da1ef
lib: expenses:unknown is a much better default account name
2019-11-05 21:16:42 +00:00
Dmitry Astapov
c66ccc5cee
lib: do not try to balance transaction in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
95ec5715cc
lib: better compatibility code in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
d62f84bec2
lib: csv reader does not generate postings if account=""
2019-11-05 21:16:42 +00:00
Dmitry Astapov
8d24a40150
lib: csv parser fills out amounts on all postings, if possible
2019-11-05 21:16:42 +00:00
Dmitry Astapov
637741a755
lib: amount1 is no longer magical
2019-11-05 21:16:42 +00:00
Dmitry Astapov
977592e49c
lib: typo fix, "expense:unknown" -> "expenses:unknown"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
3c7d5d466d
lib, doc, test: csv parser gains "end" command for "if" block
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f92590f92c
lib: allow zero postings in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
1ab8631264
lib: change default rules file text to mention "amount1"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
32cbe4c7b3
lib: better inference for unknown account names in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
b5d4918c16
lib: allow recursive interpolation of fields with underscores in names
2019-11-05 21:16:42 +00:00
Dmitry Astapov
38db7eb24d
lib: implement skip end in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
b2ba1086b6
lib: fixed validation rules for minimul viable csv rules to include account1 etc
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f1ab107400
lib, doc: extended "skip" in "if" body to "skip N"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f108b52171
lib: fix for #1001 - empty field assignment consumes next line
2019-11-05 21:16:42 +00:00
Dmitry Astapov
5dac141a7e
lib: implement conditional line skips in csv ( fixes #1076 )
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f74df08e98
lib: fix accidental switch of income:unknown and expence:unknown in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
77fa81ea4d
lib: fix error message formatting (header displayed twice)
2019-11-05 21:16:42 +00:00
Dmitry Astapov
825b9ce5b3
lib: fixed amount vs amount1 conflict detection in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
881422cd0f
lib: fix recursive interpolation in CSV parser for fields with dashes
2019-11-05 21:16:42 +00:00
Dmitry Astapov
e4476dd2f1
lib: more robust "unknown" account assignment in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
28ca65b99a
lib: more explicit conditions for using legacy csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
e4add6df83
lib: fix for multiline descriptions in csv ( fixes #841 , #416 )
2019-11-05 21:16:42 +00:00
Dmitry Astapov
9aab476d53
lib: csv parser supports up to 9 postings. Fixes #570 , #627
2019-11-05 21:16:42 +00:00
Simon Michael
eff1b31c86
csv: allow csv records with varying lengths, padding with empties
...
Sometimes trailing empty fields are omitted entirely (including the
commas) in CSV records. (I see this in exported Google spreadsheets.)
Now we don't raise an error in this case, instead we automatically pad
any "short" records with empty fields. Not yet well tested.
2019-10-07 14:54:36 -10:00
Simon Michael
f92b2fe6ef
;lib: csv: refactor: clarify, get rid of some IO/ExceptT
...
Rule parsing doesn't need IO (since we are doing expandIncludes as a
pre-parsing step).
2019-09-14 03:45:37 -07:00
Simon Michael
3c05662ce2
;lib: csv: clarify confusing imports
2019-09-13 18:11:40 -07:00
Simon Michael
46caa1d4ef
;lib: csv: rename error-prone default rules
2019-09-13 17:51:14 -07:00
Simon Michael
499e20c0b2
lib, cli, ui: start using Control.Monad.Fail, allow base-compat 0.11
...
fail is moving out of Monad and into it's own MonadFail class.
This will be enforced in GHC 8.8 (I think).
base-compat/base-compat-batteries 0.11.0 have adapted to this,
and are approaching stackage nightly
(https://github.com/commercialhaskell/stackage/issues/4802 ).
hledger is now ready to build with base-compat-batteries 0.11.0, once
all of our deps do (eg aeson). We are still compatible with the older
0.10.x and GHC 7.10.3 as well.
For now we are using both fails:
- new fail (from Control.Monad.Fail), used in our parsers, imported
via base-compat-batteries Control.Monad.Fail.Compat to work with
older GHC versions.
- old fail (from GHC.Base, exported by Prelude, Control.Monad,
Control.Monad.State.Strict, Prelude.Compat, ...), used in easytest's
Test, since I couldn't find their existing fail implementation to update.
To reduce (my) confusion, these are imported carefully, consistently,
and qualified everywhere as Fail.fail and Prelude.fail, with clashing
re-exports suppressed, like so:
import Prelude hiding (fail)
import qualified Prelude (fail)
import Control.Monad.State.Strict hiding (fail)
import "base-compat-batteries" Prelude.Compat hiding (fail)
import qualified "base-compat-batteries" Control.Monad.Fail.Compat as Fail
2019-09-08 17:13:47 -07:00
Simon Michael
0a3af8d9ee
csv: strip outer whitespace when interpolating CSV values ( #1051 )
...
This removes a potential snag in amount field assignments, and
hopefully is harmless and acceptable otherwise.
2019-06-14 16:43:12 -07:00
Simon Michael
d2b3185062
csv: don't show invalid inter-field spaces in CSV error messages
...
Errors involving a record like:
2000-01-01,a,"1"
displayed the record with extra spaces:
the CSV record is: "2000-01-01", "a", "1"
which was not accurate or valid RFC-4180.
2019-06-14 16:17:40 -07:00
Simon Michael
90af360792
csv: fix parse error printing, broken since 1.11 ( #1038 )
2019-06-06 23:10:31 -07:00
Simon Michael
61e8ccbf88
csv: accept a balance field assignment instead of an amount ( #1000 )
2019-04-03 10:46:26 -07:00
Dmitry Astapov
3c3200fa66
lib: csv parser support for 'balance2', 'balance' renamed to 'balance1'
2019-03-15 16:18:43 -07:00
Simon Michael
c5df73910f
csv: update some parse errors which weren't in human format
...
cf
https://www.reddit.com/r/plaintextaccounting/comments/axekse/hledger_how_to_create_curved_brackets_with_rule/
2019-03-05 06:23:11 -08:00
Simon Michael
6f36702141
lib: rename, reposition tprecedingcomment field
2019-01-05 07:35:54 +00:00
Samuel May
e57ef9e9a9
lib: journal: Add support for exact assertions
2018-10-22 09:55:14 -07:00
Samuel May
cde91fc5f4
lib: Make BalanceAssertion a full datatype
...
Note: simplifies/moves whitespace parsing out of the balance assertion
parser.
2018-10-22 09:55:14 -07:00
Alex Chen
3d2584d869
lib: switch to megaparsec 7
2018-09-30 20:15:12 -06: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
91b111b60d
rename easytests_* to tests_*
2018-09-06 13:13:26 -07:00
Simon Michael
51618adc37
tests: use is in a few more places
2018-09-04 13:39:21 -07:00
Simon Michael
d1cff46ba7
tests: port CsvReader tests to easytest
2018-09-03 15:30:52 -07:00