Commit Graph

2269 Commits

Author SHA1 Message Date
Simon Michael
b9954bff60 journal, lib: the include directive no longer guesses the format
The include directive now tries just one reader, based on the file
extension and defaulting to journal, like the rest of hledger.
(It doesn't yet handle a reader prefix.)

Reader-finding utilities have moved from Hledger.Read to
Hledger.Read.JournalReader so the include directive can use them.

Reader changes:
- rExperimental flag removed
- old rParser renamed to rReadFn
- new rParser field provides the actual parser.
  This seems to require making Reader a higher-kinded type, unfortunately.
2020-03-01 14:06:29 -08:00
Simon Michael
b1f3880c3d lib: drop the file format auto-detection feature
For a long time hledger has auto-detected the file format when it's
not known, eg when reading from a file with unusual extension (like
.dat or .txt), or from standard input (-f-), or when using the include
directive (which currently ignores file extensions).

Auto-detecting has been done by trying all readers until one succeeds.
This could guess wrong in some cases, but it was so rare that it has
been working fine.

Recently, more conveniences have been added to timedot format,
increasing its overlap with journal format, which makes this kind of
auto-detection unreliable.

Auto-detection and auto-detection failures are (probably) still pretty
rare in practice. But when it does happen it's confusing, giving
misleading errors or false successes (eg printing timedot entries
instead of a journal error).

For predictability and to minimise confusion, hledger no longer tries
to guess; when there's no file extension or reader prefix, it assumes
journal format. To specify one of the other formats, you must use a
standard file extension (.timeclock, .timedot, .csv, .ssv, .tsv), or a
reader prefix (-f csv:foo.txt, -f timedot:-).

For now, the include directive still tries to autodetect
(journal/timeclock/timedot), and this can't be overridden; it will be
fixed later.

Experimental; testing and feedback welcome.
2020-03-01 14:06:29 -08:00
Simon Michael
32eb839eac timedot: rewrite the parser, making it more usable
Now, org headlines before the first day entry are ignored,
regardless of content.

Note, blank lines inside a day entry are not allowed, currently.

It's now easier to be both valid journal and valid timedot at the same
time, so guessing the format of stdin is unreliable, and some tests
are failing. See following commit.
2020-03-01 14:06:29 -08:00
Simon Michael
26c19c65b0 timedot: allow a note after the date, use as transaction descriptions 2020-03-01 14:06:29 -08:00
Simon Michael
190233b576 timedot: more org support: dates/entries can be org headlines
Org headline prefixes (stars and space at beginning of line) are ignored.
2020-03-01 14:06:29 -08:00
Simon Michael
50f8539911 ;lib: comments
[ci skip]
2020-03-01 14:06:29 -08:00
Eric Mertens
e33aa56d43 cli:Fixed NoLine column rendering after previous commit 2020-02-29 12:56:35 -08:00
Eric Mertens
011a864deb cli:Render pretty line-art tables with smooth borders 2020-02-29 11:44:13 -08:00
Simon Michael
3dce879731 ;timedot: fix accidentally committed debug output breaking CI 2020-02-29 11:39:16 -08:00
Simon Michael
c3680b868b lib: Hledger.Utils.Parse: restofline can go to eof also 2020-02-29 09:48:03 -08:00
Simon Michael
8ad2ea2fb4 lib: Hledger.Read cleanup 2020-02-27 23:51:54 -08:00
Simon Michael
2c8a6e988f lib: Hledger.Read.CsvReader cleanup
Exports added: CsvRecord, CsvValue, csvFileFor

Exports removed: expandIncludes, parseAndValidateCsvRules, transactionFromCsvRecord
2020-02-27 23:37:32 -08:00
Simon Michael
5365fde3bc ;lib: Hledger.Read.TimeclockReader cleanup 2020-02-27 22:51:27 -08:00
Simon Michael
1bb33be54d ;lib: Hledger.Read.TimedotReader cleanup 2020-02-27 22:49:53 -08:00
Simon Michael
af67c327ff ;lib: Hledger.Read.JournalReader cleanup 2020-02-27 22:44:35 -08:00
Simon Michael
2e5afd0a9f ;lib: Hledger.Read.Common cleanup 2020-02-27 22:44:27 -08:00
Simon Michael
8535939f33 ;timedot: update parser tracing 2020-02-27 18:11:07 -08:00
Eric Mertens
43b118c9b8 cli:Improve pretty table rendering
This fixes table edges always using single-width intersections and
adds support for double horizontal lines with single vertical lines
2020-02-27 14:54:47 -08:00
Simon Michael
bc4ea83d86 ;csv: refactor transactionFromCsvRecord 2020-02-27 12:58:30 -08:00
Simon Michael
2dd6e2d797 ;csv: refactor transactionFromCsvRecord 2020-02-27 12:09:39 -08:00
Simon Michael
b18f71a81b ;csv: extract mkPosting! and refactor 2020-02-27 11:51:11 -08:00
Simon Michael
f2767477ab ;csv: refactor transactionFromCsvRecord, extract those helpers 2020-02-27 11:19:37 -08:00
Simon Michael
6f08eed719 ;csv: refactor transactionFromCsvRecord, note forgotten rule
Clarify some helpers. Also note the forgotten default-accountN rule.
2020-02-27 11:03:58 -08:00
Simon Michael
43c55bf4ea ;lib: add YYYY.MM.DD to parsedate/parsedateM helpers
For a bit more consistency with simple dates. And document better.
2020-02-27 10:57:55 -08:00
Simon Michael
5a2f28f3ac ;csv: refactor transactionFromCsvRecord
[ci skip]
2020-02-27 01:23:28 -08:00
Simon Michael
a87baf4b29 ;csv: refactor: rename JournalFieldName -> HledgerFieldName 2020-02-27 01:00:35 -08:00
Simon Michael
be5fc09ebb ;csv: refactor: more transactionFromCsvRecord cleanups 2020-02-27 00:41:10 -08:00
Simon Michael
93358d72b4 ;csv: refactor transactionFromCsvRecord 2020-02-27 00:30:45 -08:00
Simon Michael
02f2e3bd9b csv: refine unknown accounts more thoroughly, a better fix for #1192 2020-02-26 22:45:49 -08:00
Simon Michael
58bb0df5ab csv: undo failed #1192 fix, causing "_unknown_" accounts; refactor
Restore the old logic, while also trying to clarify this
transaction-generating code, and add some tests.
See also #1198.
2020-02-26 21:46:11 -08:00
Simon Michael
fb788a64e8 ;csv: cleanups, drop match operator for now 2020-02-26 11:52:47 -08:00
Simon Michael
a33a9d61c2 json: use a simpler, more consumable number representation (#1195)
Amounts in JSON are now rendered as simple Numbers with up to 10
decimal places, instead of Decimal objects which would in some cases
have 255 digits, too many for most JSON parsers to handle.
A provisional fix, see the comment in Json.hs for more detail.
2020-02-26 11:48:09 -08:00
Simon Michael
99aec9d476 ;csv: doc: use field matchers in manual examples
[ci skip]
2020-02-26 09:38:30 -08:00
Simon Michael
d537f1fe07 csv: allow single field matching; more docs and tests 2020-02-26 08:55:55 -08:00
Simon Michael
becd891dd1 ;csv: Matcher type, simplify 2020-02-25 13:44:45 -08:00
Simon Michael
1cbce98a68 ;csv: refactor, ConditionalBlock ADT 2020-02-25 13:44:45 -08:00
Simon Michael
2a5f7819af bs,cf,is,bal,print,reg: support json output format 2020-02-24 17:49:53 -08:00
Simon Michael
7f16d23898 ;refactor: extract --value=then error message 2020-02-24 17:49:53 -08:00
Simon Michael
7ec25da13a web: edit/upload: normalise line endings, avoiding parse errors (#1194)
Renamed: writeValidJournal -> writeJournalTextIfValidAndChanged

Added comments clarifying line ending behaviour of:
add, import, appendToJournalFileOrStdout, readFilePortably,
writeFileWithBackupIfChanged, writeJournalTextIfValidAndChanged

Summary of current behaviour:

- hledger add and import commands will append with (at least some)
  unix line endings, possibly causing the file to have mixed line
  endings

- hledger-web edit and upload forms will write the file with
  the current system's native line endings, ie changing all
  line endings if the file previously used foreign line endings.
2020-02-24 14:04:44 -08:00
Simon Michael
696ec4998b ;doc: regen help/manuals
[ci skip]
2020-02-22 11:40:41 -08:00
Simon Michael
2d90074b2e ;csv: avoid a potential display of internal placeholder (#1192)
With a multicommodity amount, the unknown account name will always be
"expenses:unknown".
2020-02-15 14:02:53 -08:00
Simon Michael
017d3355f8 csv: allow manual assignment of "expenses:unknown" again (fix #1192) 2020-02-15 13:52:59 -08:00
Simon Michael
7359fdd32a ;doc:journal: edits (#1187)
[ci skip]
2020-02-11 10:38:08 -08:00
Simon Michael
86ffef1057 ;doc:journal: edits, Amount display format -> Amount display style (#1187)
Drop occasional use of "display format", prefer "display style".

[ci skip]
2020-02-11 10:23:52 -08:00
Simon Michael
9112e077ba ;doc: journal: edits (#1187)
[ci skip]
2020-02-11 10:18:39 -08:00
Simon Michael
0b2349c28f ;doc: journal: fix D example (#1187)
[ci skip]
2020-02-11 10:09:20 -08:00
Simon Michael
8ff225920a ;doc: journal: update D doc (#1187)
[ci skip]
2020-02-11 10:06:36 -08:00
Simon Michael
e4a0bdff8d journal: default commodity (D) limits display precision too (#1187)
D directives are now fully equivalent to commodity directives for
setting a commodity's display style. (Previously it was equivalent to
a posting amount, so it couldn't limit the number of decimal places.)
When both kinds of directive exist, commodity directives take precedence.
When there are multiple D directives in the journal, only the last one
affects display style.
2020-02-11 09:47:26 -08:00
Simon Michael
1741b607e2 lib: more cleanup of amount canonicalisation helpers (#1187)
Stop exporting journalAmounts, overJournalAmounts, traverseJournalAmounts.
Rename journalAmounts helper to journalStyleInfluencingAmounts.

D directives are now a little better at influencing amount
canonicalisation, eg in the updated test case.
2020-02-11 09:23:04 -08:00
Simon Michael
926b01f2eb ;lib: try to clarify this amount traversing stuff (#1187) 2020-02-11 08:34:22 -08:00
Simon Michael
ae9d8d6e56 ;add then and t to --value's error message
[ci skip]
2020-02-10 12:40:02 -08:00
Simon Michael
aa96b41efe print, register: add --value=then, valuing at each posting's date
Currently this will give an error with other kinds of report.
2020-02-10 08:20:39 -08:00
Jakob Schöttl
50acfc9119 Fix documentation, make ISO date format standard in some places 2020-02-09 07:26:54 -08:00
Simon Michael
0f5f573db7 ;doc: journal: fix wrong account type: value (hledger_site/#20)
[ci skip]
2020-02-08 12:44:54 -08:00
Simon Michael
4d94a5273b ;doc: manuals: whitespace cleanup
Remove a bunch of trailing whitespace with M-x whitespace-cleanup.
Except for examples showing hledger output, which might be tested
with shelltest some day, so stripping that whitespace might be problematic.

[ci skip]
2020-02-08 12:44:54 -08:00
Simon Michael
98d0cc9c17 ;doc: regen manuals
[ci skip]
2020-02-08 11:56:03 -08:00
Simon Michael
54e633e186 ;doc: hledger, journal, csv: consistent use of pipe tables
For consistency, ease of editing, and to fix unwanted content display
when cycling visibility in markdown-mode.

[ci skip]
2020-02-08 11:52:18 -08:00
Simon Michael
e3ab3b9985 ;doc: regen all manuals, bumping month
[ci skip]
2020-02-08 11:20:25 -08:00
Simon Michael
fd64d7bb3a ;doc: regen manuals
[ci skip]
2020-02-07 10:45:57 -08:00
Simon Michael
4dc82fc2b3 ;doc: journal: comments
[ci skip]
2020-02-05 19:41:07 -08:00
Simon Michael
088e253eff ;doc: journal: note quotes needed in auto posting queries (#1185)
[ci skip]
2020-02-03 10:37:30 -08:00
Simon Michael
bb6e1e3ce2 ;lib: export textQuoteIfNeeded
[ci skip]
2020-02-03 10:10:46 -08:00
Simon Michael
56b51c1961 ;lib: couple of doctests
[ci skip]
2020-02-03 10:10:32 -08:00
Simon Michael
e0a46a6523 ;lib: update doctests for ISO 8601 date output
[ci skip]
2020-02-03 08:03:44 -08:00
Simon Michael
b3711488a7 lib: apply canonical display styles to auto posting amounts too 2020-01-31 06:00:06 -08:00
Simon Michael
fccd88149d ;lib: refactor, clarify finaliseJournal a bit 2020-01-31 05:39:16 -08:00
Simon Michael
c67ffedea5 ;doc: journal: more cleanups to intro, secondary dates
[ci skip]
2020-01-29 08:42:04 -08:00
Simon Michael
06a54f70b0 ;doc: regen manuals
[ci skip]
2020-01-29 08:27:29 -08:00
Simon Michael
150a74c5a0 ;doc: journal: reorg; rewrite transactions, simple & secondary dates
[ci skip]
2020-01-29 08:26:00 -08:00
Simon Michael
c920bd3169 ;doc: journal: virtual postings rewrite
[ci skip]
2020-01-29 07:09:54 -08:00
Simon Michael
181de60ff7 ;doc: journal: hide FILE FORMAT heading on web; move editor info
[ci skip]
2020-01-29 06:13:35 -08:00
Simon Michael
93644a52ba ;doc: journal: layout fix
[ci skip]
2020-01-27 12:53:12 -08:00
Simon Michael
7011160bfd ;allow base 4.14/GHC 8.10 2020-01-26 08:12:25 -08:00
Simon Michael
b1de2f2308 ;doc: drop redundant version message from web manuals
[ci skip]
2020-01-25 19:33:12 -08:00
Simon Michael
24c6828a5c ;doc: regen manuals
[ci skip]
2020-01-25 17:10:34 -08:00
Simon Michael
490ab140cd ;doc: timedot: drop FILE FORMAT heading
[ci skip]
2020-01-25 17:10:10 -08:00
Simon Michael
444c4342ed ;doc: manuals: hide NAME/SYNOPSIS/DESCRIPTION headings in web manuals
[ci skip]
2020-01-25 16:57:51 -08:00
Simon Michael
9710c86c7f ;doc: regen manuals
[ci skip]
2020-01-22 12:52:41 -08:00
Simon Michael
5f7ae2ced6 ;lib: Amount: export mixedAmountStripPrices 2020-01-22 11:57:42 -08:00
Simon Michael
9874d29953 ;doc: journal: 2 spaces required in same line account comments (#1182)
[ci skip]
2020-01-22 05:42:22 -08:00
Simon Michael
090f65ec83 ;doc: regen manuals
[ci skip]
2020-01-20 18:02:42 -08:00
Simon Michael
64546cd54a lib: export mapMixedAmount 2020-01-20 18:01:33 -08:00
Simon Michael
80ab45984b csv: also recognise .tsv, .ssv extensions; document thoroughly (#1179) 2020-01-20 12:58:47 -08:00
Simon Michael
42dfde141a ;doc: changelogs: update from 1.16.2, cleanups 2020-01-14 11:19:05 -08:00
Simon Michael
dba0b117f4 ;doc: draft changelogs 2020-01-14 10:08:59 -08:00
Simon Michael
445e8aa3cc add support for megaparsec 8 (#1175) 2020-01-14 09:54:06 -08:00
Brian Wignall
473b3376ab ;doc: update shell output in hledger*/*.m4.md to use ISO date formatting 2020-01-13 12:32:41 -08:00
Jakob Schöttl
c7a88b50fb Fix timeclock format parsing
Fix presumably copy-paste errors

timeclock format has only timeclock lines or empty/comment lines

Update test format to v3, add new tests

Throw error on unexpected clock codes in timeclock format

Fix missing case in pattern matching
2020-01-12 13:17:36 -08:00
Simon Michael
65efdea4c0 ;doc: regen some manuals
[ci skip]
2020-01-07 16:24:51 -08:00
Brian Wignall
ab12ff916f Update "showPeriod" to use yyyy-mm-dd formatting 2020-01-07 15:58:54 -08:00
Brian Wignall
00eb0b3c8f Make "stack test" pass again 2020-01-07 15:58:22 -08:00
Brian Wignall
35481a665b Change Date output to yyyy-mm-dd 2020-01-07 15:58:22 -08:00
Simon Michael
be72497ebb ;doc: journal: corrections for D directive's scope (#1170)
[ci skip]
2020-01-07 07:38:51 -08:00
Aleksandar Dimitrov
3bf6ef9a8b Update documentation on separators 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
3ead97975c Inline function, add debug statement 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
9011aaa5ba Refactor getSeparator 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
92f680875f Parse reserved words case insensitively 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
8df4e1ed83 Remove --separator command line argument 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
02d9205af7 Allow separator to be overridden from command line
This also fixes that parsing separators on the command line and the
rules file was not handled the same way.
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
b524a088c7 Implement getting separator from rules 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
32ccc3a2b2 Add directive 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
ec0f55d18e Add missing type signature 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
b104b3b8a3 Explictly discard result 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
42d585d20b Refactor: rename variable 2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
63cda87e86 Whitespace 2020-01-05 14:45:57 -08:00
Simon Michael
07029047f5 ;doc: regen manuals again
[ci skip]
2020-01-05 09:17:02 -08:00
Simon Michael
cfb2a61ae1 ;bump to dev version; bump man page dates
[ci skip]
2020-01-05 09:04:50 -08:00
Simon Michael
f91076cc6a ;doc: regen manuals
I think all the non-content changes are due to newer
doc tools and harmless, including this one hopefully:

    -.B \f[C]--watch\f[R]
    +\f[B]\f[CB]--watch\f[B]\f[R]

[ci skip]
2020-01-05 07:06:42 -08:00
Simon Michael
ce5eccfbc0 ;spelling fix
[ci skip]
2020-01-04 21:17:50 -08:00
Stephen Morgan
228edf6ba6 Don't store leaf name in PeriodReport.
Calculate at the point of consumption instead.
2020-01-04 21:15:42 -08:00
Stephen Morgan
2e20d0717f lib: Generalise PeriodicReport to be polymorphic in the account labels. 2020-01-04 17:23:17 -08:00
Stephen Morgan
88dc619257 lib: Use records instead of tuples in PeriodicReport. 2020-01-04 17:23:17 -08:00
Stephen Morgan
beb8b6d7c8 lib: Use PeriodicReport in place of MultiBalanceReport. 2020-01-04 17:23:17 -08:00
Stephen Morgan
74778efcf5 Use nubSort instead of nub . sort. 2020-01-04 08:31:10 -08:00
Simon Michael
390cea7f7c ;doc: note that -I does not disable balance assignments
[ci skip]
2020-01-04 08:22:45 -08:00
Stephen Morgan
38904372b2 Calculate MultiReportBalance columns more efficiently.
Only calculate posting date once for each posting, and calculate their
columns instead of checking each DateSpan separately.
2020-01-03 16:11:46 -08:00
Simon Michael
0b734be445 ; silence safe 0.3.18's deprecation warnings for now
(max|min)imum(By)?Def are being replaced by (max|min)imumBound(By)?
but the old functions have the semantics I want and
I don't understand the new ones yet.
This can hide other deprecation warnings in this file,
and presumably the old functions will be removed later,
so this is temporary.
Cf https://github.com/ndmitchell/safe/issues/26
2019-12-28 15:52:32 -08:00
Simon Michael
c5537cedb5 ;lib: drop more unnecessary toJSON calls 2019-12-27 15:49:42 -08:00
Stephen Morgan
b9b16da8ed Correct finding latest date in queryEndDate Or queries and simplify date
comparison code.
2019-12-24 05:04:51 -08:00
Brian Wignall
2852f9dbee Fix typos 2019-12-21 12:09:05 -08:00
Simon Michael
4266db5633 ;csv: doc: document balance-type
[ci skip]
2019-12-20 10:41:24 -08:00
Simon Michael
7fa7ccc033 ToJSON instances for all (?) remaining data types, up to Ledger 2019-12-16 17:17:00 -08:00
Simon Michael
46d516e7a3 move JSON instances from hledger-web to hledger-lib 2019-12-16 17:17:00 -08:00
Simon Michael
47567cd770 ;fix some warnings with GHC 8.10 alpha
hledger is GHC 8.10 ready!
2019-12-14 17:30:19 -08:00
Simon Michael
2a2f08bb58 ;doc: csv: mention that fields rule's separator != csv separator
[ci skip]
2019-12-14 14:00:59 -08:00
Simon Michael
2825a06e8e ;doc: csv: expand help on other separator characters
[ci skip]
2019-12-14 13:57:48 -08:00
Simon Michael
f099fb558e ;doc: csv: mention entr for rapid feedback
[ci skip]
2019-12-09 14:46:02 -08:00
Simon Michael
95aa2e16cc ;doc: fix some old wiki and Cookbook references (hledger_site/#10) 2019-12-09 06:08:03 -08:00
Simon Michael
c759c9b3de ;lib: fix some more warnings in Transaction 2019-12-09 06:08:03 -08:00
Simon Michael
13e6c7dfdf lib: drop "assertion" alias for nullassertion
Perhaps we'll stick with the null* convention. Fixes a warning in Transaction.hs.
2019-12-09 06:08:03 -08:00
Jacek Generowicz
29211868bb Fix issue 457
Issue #457 pointed out that commands such as

    hledger ui 'amt:>200'

failed. This was becasue the process of dispatching from `hledger ui`
to `hledger-ui` (note addition of `-`) lost the quotes around
`amt:>20` and the `>` character was interpreted as a shell redirection
operator, rather than as part of the argument.

The machinery for quoting or escaping arguements which cointain
characters which require quoting or escaping (thus far whitespace and
quotes) already existed. This solution simply adds shell stdio
redirection characters to this set.

Fixes #457
2019-12-08 18:33:43 +01:00
Simon Michael
5a2bcecf26 ;doc: finalise changelogs 2019-12-03 08:41:44 -08:00
Simon Michael
06b70194c0 ;doc: regen manuals 2019-12-03 08:41:44 -08:00
Simon Michael
093dca570d lib, cli, web: bump version to 1.16.1 2019-12-03 08:41:44 -08:00
Simon Michael
6ae837f820 ;doc: changelogs 2019-12-03 08:41:44 -08:00
Simon Michael
e032eff8eb ;doc: changelog updates 2019-12-02 08:59:58 -08:00
Simon Michael
0ce890e5ff lib, cli, web: drop unnecessary mtl-compat dependency 2019-12-02 08:23:00 -08:00
Simon Michael
62a9e1aa62 ;lib: clarify Hledger.Read imports a little 2019-12-02 08:21:06 -08:00
Simon Michael
a0b92e02b9 Revert "remove old fail compatibility imports that are obsolete ?"
They are needed with ghc <8.4, not for fail but for <> I think.
Try cleaning up again another time.
This reverts commit 318ce7eb07.
2019-12-01 11:32:51 -08:00
Simon Michael
d922b6e798 ;doc: regen manuals 2019-12-01 10:12:29 -08:00
Simon Michael
6daebf60ea ;regen cabal files 2019-12-01 10:05:37 -08:00
Simon Michael
87d0491103 ;bump version to 1.16 2019-12-01 10:03:58 -08:00
Simon Michael
c90c0867c4 ;doc: changelogs
[ci skip]
2019-12-01 09:59:01 -08:00
Simon Michael
4b66bc2ed9 lib: disable doctest suite again till we can run it with cabal (#1139) 2019-12-01 09:13:18 -08:00
Simon Michael
318ce7eb07 remove old fail compatibility imports that are obsolete ? 2019-12-01 08:31:50 -08:00
Simon Michael
279e9624ed ;lib: clarify docs for setFullPrecision, setNaturalPrecision 2019-11-30 16:56:45 -08:00
Simon Michael
a081404bd7 ;doc: journal: rewrite commodity directive doc
[ci skip]
2019-11-30 08:34:13 -08:00
Simon Michael
359a118900 ;doc: draft changelog updates
[ci skip]
2019-11-29 07:57:54 -08:00
Simon Michael
caf8cdf0ca ;test: consistent singular naming for test suites and files 2019-11-29 06:35:29 -08:00
Simon Michael
c7574b8005 ;lib, cli: test suite cleanups, don't run hledger-lib tests twice 2019-11-29 06:11:25 -08:00
Simon Michael
2b2a0b3cf8 ;tests: use "test" alias for testCase everywhere
Easier to type and read, and a little clearer to my eyes;
"testCase" implies a single case, but it can contain many assertions.
2019-11-28 15:33:33 -08:00
Simon Michael
030b633cd6 ;fix build issues with old GHC versions 2019-11-28 15:22:12 -08:00
Simon Michael
ebedae01cf ;cabal: remove special cases for unsupported GHC 7 2019-11-28 14:59:18 -08:00
Simon Michael
08951ac3e8 ;cabal: add ghc 8.8 to tested-with
[ci skip]
2019-11-28 14:59:10 -08:00
Simon Michael
ca4fade4af ;tests: re-add hledger-lib's tests to the cabal file, as unittests 2019-11-28 14:45:10 -08:00
Simon Michael
5dac8af2ef ;ui: fix build error due to tests rewrite 2019-11-27 21:54:31 -08:00
Simon Michael
4faefcfab2 ;doc: regen manuals
[ci skip]
2019-11-27 13:18:08 -08:00
Simon Michael
b36f6df110 tests: port all unit tests to tasty, second pass (#1090)
Hledger.Util.Tests helpers have been cleaned up, and test names are
now shown.

Tests have been cleaned up a bit. Some groups of unnamed tests have
been collapsed into a single named test containing a sequence of
assertions. The test command counts named tests, not assertions, so
the reported unit test count has dropped from 199 to 188.
2019-11-27 13:17:34 -08:00
Simon Michael
13a3542464 tests: port all unit tests to tasty, first cut (#1090)
easytest is not actively maintained and requires an old version of
hedgehog which does not support base-compat 0.11 & ghc 8.8.

This is still using the old easytest helpers, and not displaying test
names properly.
2019-11-27 12:43:43 -08:00
Simon Michael
3f0892556d ;lib: clarify choiceopt doc 2019-11-23 13:03:26 -08:00
Simon Michael
0beca72275 ;csv: doc: one-posting txns can now be generated (#1111/#1133)
[ci skip]
2019-11-23 12:28:41 -08:00
Dmitry Astapov
aa051a05cf lib: support generation of (un)balanced virtual postings in csv reader 2019-11-23 10:28:10 -08:00
Simon Michael
332624f9fa ui: B and V keys toggle display of cost, value 2019-11-21 17:33:04 -08:00
Brian Wignall
f8269e21ab Fix some simple typos 2019-11-20 13:33:33 -08:00
Mykola Orliuk
2a36ac0d62 ;lib: fix doctest for RawOptions 2019-11-19 20:43:19 +01:00
Simon Michael
f0b2eed6c2 ;lib: clarify test suites recompilation workaround (#1125)
[ci skip]
2019-11-19 04:10:46 -08:00
Mykola Orliuk
f82ed83153 ;lib: re-enable easytests 2019-11-19 03:58:56 -08:00
Mykola Orliuk
097486a247 ;lib: re-enable doctests 2019-11-19 03:58:56 -08:00
Mykola Orliuk
5287fe671b ;all: hide RawOpts internals
This way we can ensure we always use only functions from RawOptions.
2019-11-18 17:38:39 -08:00
Mykola Orliuk
31ae3d3aaf ;lib: drop SystemString left from GHC pre 7.2
We are relying on base-4.9 or newer. Thus we don't compile anymore with
GHC version lower than 8.0.1.
2019-11-18 17:38:39 -08:00
Simon Michael
68b1cacf0f lib: refactor, prepare to drop showTransactionUnelided functionality
It seems we don't use it at all, and ony says it's not robust with
prices either.

Merge remote-tracking branch 'ony/chores/drop-elide-in-showTransaction'
2019-11-18 17:27:30 -08:00
Simon Michael
4cb2a03f7f ;lib: more docs for unifyMixedAmount
[ci skip]
2019-11-18 17:22:42 -08:00
Michael Kainer
79ca4a767e cli: Add -% to compound balance commands
This commit introduces the commandline argument -%/--percent to show
percentages of the column's total instead of the absolute amounts for
each account in reports. The signs of the values are preserved.

This option is especially useful for the balance and incomestatement
commands.

If there are multiple commodities involved in a report hledger bails
with an error message. This can be avoided by using --cost. Also note
that if one uses -% with the balance command the chances are high that
all numbers are 0. This is due to the fact that by default balance sums
up to zero. If one wants to use -% in a meaningful way with balance one
has to add a query.

In order to keep the implementation as simple as possible --tree has no
influence over how the percentages are calculated, i.e., the percentages
always represent the fraction of the columns total. If one wants to know
the percentages relative to a parent account, one has to use a query to
narrow down the accounts.
2019-11-18 17:10:59 -08:00
Mykola Orliuk
aca214b0ac lib: drop amount elision in showing last posting
This behavior is highly depends on journal. If we want to re-introduce
it we'd better re-consider how transaction entry can be "simplified".
I.e. besides dropping last amount we may drop prices that can be assumed
implicitly.
Note that there is no need to knit it into showTransaction since it
easily achievable with pre-processing (similar to implicit balances
etc).
2019-11-16 12:53:07 +01: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
Simon Michael
9b74471d02 ;doc: regen csv manuals
[ci skip]
2019-11-12 13:32:35 -08:00
Simon Michael
470b5aca7b ;csv: doc: fix typo
[ci skip]
2019-11-12 13:32:05 -08:00
Simon Michael
dbe8638ba2 ;csv: doc: remove currencyN/amount limitation (#1113)
[ci skip]
2019-11-12 13:24:59 -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
205ff9d2d6 ;csv: doc: more cleanups, consistency
[ci skip]
2019-11-12 12:04:57 -08:00
Simon Michael
8b237cd4a0 ;csv: doc: reorder sections, greatly expand examples
too much ?

[ci skip]
2019-11-12 10:37:17 -08:00
Simon Michael
4eeb8f6264 ;csv: doc: more cleanups, note some limitations
[ci skip]
2019-11-11 18:29:36 -08:00
Simon Michael
01823d6329 ;csv: doc: testing/cleanup pass
[ci skip]
2019-11-11 18:10:09 -08:00
Simon Michael
d4cddc5402 ;csv: doc: another currency clarification, posting fields cleanup
[ci skip]
2019-11-10 18:33:50 -08:00
Simon Michael
a8f1f5da62 ;csv: doc: more notes about currency (#1095)
[ci skip]
2019-11-09 09:53:05 -08:00
Simon Michael
7200c2c4da ;doc: changelog update
[ci skip]
2019-11-07 19:28:52 -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
Simon Michael
5264a7ebc1 ;lib: refactor, split out finaliseJournal 2019-11-07 18:08:41 -08:00
Simon Michael
3f530f5b54 ;doc: update changelogs, including #1095
[ci skip]
2019-11-07 16:37:03 -08:00
Simon Michael
6e951962f9 ;csv: doc: cleanups
[ci skip]
2019-11-06 18:42:39 -08:00
Simon Michael
7ecc42f142 ;doc: regen manuals
[ci skip]
2019-11-06 13:15:17 -08:00
Simon Michael
d92351e21a csv: doc: clean up/expand manual after #1095
[ci skip]
2019-11-06 13:15:17 -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
09f17f2b2b doc: mention the magic sauce 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
a6d91da217 doc: remove "you need to create at least 1 posting" bit 2019-11-05 21:16:42 +00:00