Compare commits

..

3686 Commits

Author SHA1 Message Date
ab1e176010 Fix transaction visibility without add permission 2026-01-25 22:43:42 +02:00
ef936a0733 Make filter links exact 2026-01-25 20:42:05 +02:00
8f0a7bdecc Filter by payee by clicking on it 2026-01-25 20:42:05 +02:00
a8d51001f8 Unify filtering style rules 2026-01-25 20:42:05 +02:00
a40507ccea Filter by code by clicking on it 2026-01-25 20:42:05 +02:00
8635ef8b17 Filter by tag by clicking on it 2026-01-25 20:42:05 +02:00
4dd58ee2d5 Display all accounts in the tree mode 2026-01-25 20:42:05 +02:00
7b18e75676 Display balance assertions in hledger web 2026-01-25 20:42:05 +02:00
4f9dcfec1c Add links to tosite tags 2026-01-25 20:42:05 +02:00
f509a091e6 Add links to URI-valued tags 2026-01-25 20:33:57 +02:00
040cd7a680 Draw table lines over entire row, not only cells 2026-01-17 20:04:55 +02:00
3d32a45ffe Enable viewing elided transaction descriptions 2026-01-17 19:47:21 +02:00
efdf60263d Fix spacing after tags without a value 2026-01-16 19:53:46 +02:00
a9070df40e Display transaction status in hledger-web 2026-01-16 19:42:37 +02:00
807f9d800a Display payee and note separately hledger-web 2026-01-16 12:31:14 +02:00
961fd71e57 Display transaction code in hledger-web 2026-01-16 12:02:15 +02:00
10c71cb447 Display posting tags in hledger-web 2026-01-16 11:48:59 +02:00
e5ac735110 Display transaction tags in hledger-web 2026-01-16 09:53:21 +02:00
b40628c1e6 Construct transactionsreport as a list 2026-01-15 16:04:02 +02:00
9aecef432c FIXUP translate to finnish 2026-01-15 11:15:08 +02:00
76e7b7d613 Add guix.scm 2026-01-14 12:30:35 +02:00
0098ac874f Translate to Finnish 2026-01-14 12:30:12 +02:00
Simon Michael
6c33f6d821 ;examples:debconf: add missing commodity declarations for consistent display 2026-01-10 00:25:59 -10:00
Simon Michael
85bedb77ac ;examples:debconf: update scripts, restore Ledger price-db support 2026-01-10 00:25:39 -10:00
Simon Michael
1e257c4daa ;bin:readme: fix ledgereval link 2026-01-09 16:35:55 -10:00
Simon Michael
a6060375ec ;examples: debconf: edits 2026-01-09 16:18:21 -10:00
Simon Michael
1feebd0813 ;examples: debconf: more reports, all.ledger 2026-01-09 16:15:02 -10:00
Simon Michael
343f957cad ;examples: debconf: reports 2026-01-09 14:54:25 -10:00
Simon Michael
1ba12c5396 ;examples: debconf: cleanups 2026-01-09 13:52:58 -10:00
Simon Michael
0286068c0f ;examples: debconf: fixes 2026-01-09 13:48:42 -10:00
Simon Michael
87a53ff77d ;examples: debconf: makefile fix; drop 2026 2026-01-09 13:46:04 -10:00
Simon Michael
5b7d8346bd ;examples: debconf: hledger readability 2026-01-09 13:43:08 -10:00
Simon Michael
a55455e19d ;bin:ledgereval 2026-01-09 12:33:46 -10:00
Simon Michael
c3ea87ca20 ;examples: debconf: fix make check-* 2026-01-09 12:27:33 -10:00
Simon Michael
a0c8004147 ;examples: debconf: make check-* 2026-01-09 11:58:12 -10:00
Simon Michael
f4e642093d ;examples: debconf: fetch all years 2026-01-09 11:47:16 -10:00
Simon Michael
e15edcff69 ;examples: how to get debconf's ledger files 2026-01-09 11:11:50 -10:00
Simon Michael
f2ec9d58bc ;doc:issue template: improve 2026-01-09 09:48:48 -10:00
Simon Michael
8295e521a7 ;doc:issue template: improve 2026-01-09 09:32:33 -10:00
Simon Michael
9307c178c9 ;doc:issue template: improve 2026-01-09 09:29:31 -10:00
Simon Michael
932de54aa9 ;doc:issue template: edit 2026-01-09 09:09:27 -10:00
Simon Michael
b96a8bf01d ;doc:issue template: encourage a modern version 2026-01-09 09:08:13 -10:00
g. nicholas d'andrea
e678e09704 feat: accounts: add Gain (G) account type as subtype of Revenue [#2522]
Add a new account type Gain with single-letter code G as a subtype of
Revenue, similar to how Cash is a subtype of Asset and Conversion is a
subtype of Equity. This enables tracking capital gains/losses separately
while still including them in income statements and close --retain.

Usage: account revenues:capital  ; type: G

- type:G matches only Gain accounts
- type:R matches both Revenue and Gain (subtype matching)
- Auto-detection from account names matching:
  ^(income|revenue)s?:(capital[- ]?)?(gains?|loss(es)?)(:|$)
  e.g. income:gains, revenue:capital-gains, income:losses
2026-01-08 19:18:13 -10:00
Simon Michael
c7732c7600 ;workflows:binaries:linux: ensure the linux binary uses a fixed haskeline [#2410] 2026-01-08 18:23:43 -10:00
Simon Michael
e36f55c98a ;add: allow older haskeline again, it's needed for stackage (reopens [#2410])
For now, `hledger add` with the stackage build of hledger 1.51.2+ will once again show ANSI junk.
Dev builds, the github release binaries, stackage builds of hledger-1.50..1.51.1,
and stackage hledger builds in future snapshots with a GHC that provides the fixed haskeline,
will remain free of that bug.
2026-01-08 18:15:35 -10:00
Simon Michael
7ab155de67 ;pkg:stack: revert to ghc 9.12.2, 9.12.3 is buggy and not yet available with ghcup 2026-01-08 13:51:27 -10:00
Simon Michael
9e79fe7182 ;doc: REGRESSIONS 2026-01-08 02:28:21 -10:00
Simon Michael
81547f371c ;pkg:stack: nightly-2026-01-08 / ghc 9.12.3 2026-01-08 02:15:02 -10:00
Simon Michael
4a79b29f42 ;doc:gh relnotes 2026-01-08 02:14:55 -10:00
Simon Michael
95dc030005 ;doc:relnotes 2026-01-08 02:14:03 -10:00
Simon Michael
cc7cbed4d9 ;doc:ANNOUNCE 2026-01-08 02:12:24 -10:00
Simon Michael
1eaf37ca0f ;doc:changelogs: 1.51.2 2026-01-08 02:10:53 -10:00
Simon Michael
62a104c42c fix:web:register: prevent line wrapping in dates [#2520] 2026-01-08 00:57:28 -10:00
Simon Michael
1d596c494b ;bin:bashrc: fix LEDGER_FILE typo 2026-01-08 00:44:05 -10:00
Simon Michael
3c0a02a34a Revert "fix:lib:Hledger.Query: words'': Parse escaped quotes in quoted patterns" [#2513]
This reverts commit de900e5b24, it's not
as safe as we thought.
2026-01-06 21:55:35 -10:00
Simon Michael
98fdffd516 ;doc: hledger's regular expressions: no lazy quantifiers 2026-01-06 21:42:32 -10:00
Simon Michael
dd6061ed65 ;bin:bashrc: cleanup 2026-01-06 21:42:32 -10:00
Simon Michael
3b656ff372 imp:add,import: also create directories when autocreating journal file
When autocreating a journal file specified by -f or LEDGER_FILE,
required parent directories will now also be autocreated if needed.
2026-01-06 21:39:59 -10:00
Simon Michael
e7d7c49562 imp: -f now errors if given a glob matching no files, like LEDGER_FILE
Previously LEDGER_FILE=foo hledger add did, but hledger -f foo add didn't.
Now they both consistently will error if given a glob
(a path contining [, {, *, or ?) that matches nothing,
rather than auto-creating a file with a glob-like name.

Hledger.Utils.IO:
expandPathOrGlob
2026-01-06 21:39:59 -10:00
Simon Michael
88f6c16dd5 fix:add,import: autocreate missing journal files again (but later) [#2514]
This restores the pre-1.50.3 behaviour of add and import, which once
again auto-create a missing file (specified by -f or LEDGER_FILE or
the builtin default path) rather than giving an error.
This fixes #2514 and refines the fix for [#2485].

There's also an improvement: they no longer create it unconditionally at the start;
they create lazily, when they have data to write.

Hledger.Read:
defaultExistingJournalPath
defaultExistingJournalPathSafely
readPossibleJournalFile

Hledger.Cli.Utils:
withPossibleJournal
2026-01-06 21:39:59 -10:00
Oleg Bulatov
abd7d60884 imp:lib:valuation: optimize price lookup with pre-built indexes [#2511]
Replace O(n log n) re-sorting of all prices on every valuation date
with O(log n) indexed lookups. By pre-building sorted price indexes
once at startup using O(n log n) time, we avoid redundant work
during reports.

This significantly improves performance for --value=end,COMM with daily
reports over long periods and large price databases.

Implementation:
- PriceIndex maps commodity pairs to a Map from date to effective
  price, enabling O(log n) temporal lookups via M.lookupLE.
- DefaultValuationIndex provides efficient resolution of destination
  commodities using the same temporal logic.
- makePriceGraph is updated to consume these indexes.

Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
2026-01-02 17:05:24 -10:00
Simon Michael
1a5f10f928 ;doc:ghtestbinnotes: bump version for diffing 2025-12-31 13:38:43 -10:00
Simon Michael
6e0ef6b88e ;doc:ghtestbinnotes: fix urls 2025-12-31 13:37:05 -10:00
Simon Michael
20389ad844 ;workflows:binaries-linux-x64: add more caching 2025-12-31 13:16:54 -10:00
Simon Michael
656c779c6f ;workflows: rename nightly -> testbin
The nightly tag is no longer usable, having been used in a test of
immutable releases on Github. The branch/tag/workflow/release is
now "testbin", intended for publishing unreleased binaries for testing.
2025-12-31 12:49:44 -10:00
Simon Michael
01c79b357e readme: heading 2025-12-31 09:34:27 -10:00
Simon Michael
dbdf199e42 ;dev: gitignore 2025-12-31 09:30:31 -10:00
Simon Michael
3d85549e79 dev:Hledger.Utils.IO: clarify expandPath, expandHomePath 2025-12-31 00:28:05 -10:00
Simon Michael
6a9c5d41d9 ;cabal: update cabal files 2025-12-31 00:28:05 -10:00
Jens Petersen
ada160db3a hledger-ui: allow vty-crossplatform 0.5 2025-12-30 23:35:46 -10:00
Simon Michael
ea043df56e ;examples:csv: opencollective: update 2025-12-30 12:54:21 -10:00
Simon Michael
6aaeddfcf0 ;examples:csv: opencollective: update 2025-12-30 12:43:04 -10:00
Simon Michael
2dd2ad5cf9 ;examples:csv: Open Collective 2025-12-30 11:26:18 -10:00
Simon Michael
3d5704fe22 ;doc:README: badges updates 2025-12-30 05:55:36 -10:00
Simon Michael
9b0555e657 ;doc:COMMON TASKS:Setting LEDGER_FILE: updates 2025-12-29 09:30:40 -10:00
Simon Michael
327ff6ef0c ;doc:REGRESSIONS 2025-12-29 08:46:30 -10:00
Simon Michael
d505c98910 ;doc:REGRESSIONS 2025-12-29 01:15:36 -10:00
Dmitry Astapov
edfea86656 ;roi: rephrase IRR solver errors a bit 2025-12-27 09:43:53 -10:00
Dmitry Astapov
1c37dc44a7 ;roi: more input sanity checks (fixes #2505) 2025-12-27 09:43:53 -10:00
Simon Michael
2fb09f0d1e cabal: update cabal files 2025-12-26 17:10:47 -10:00
Simon Michael
1a0a81d9e7 fix: add, ui: better fix for add's [#2410], also fixes ui's [#2512]
By using newer haskeline fixing https://github.com/haskell/haskeline/issues/130.
2025-12-26 17:09:26 -10:00
Simon Michael
91d019741e ;pkg: allow base 4.22 / ghc 9.14 2025-12-26 15:17:16 -10:00
Simon Michael
262e6d2c2e ;examples:cctax: wording 2025-12-26 15:05:34 -10:00
Simon Michael
ff018bf482 ;doc:README: new badges provided by gitscope.dev 2025-12-26 15:05:34 -10:00
Simon Michael
60293349bb ;imp:lib:Hledger.Utils.IO.expandHomePath: handle a bare ~ 2025-12-26 15:05:34 -10:00
Tuong Nguyen Manh
de900e5b24 fix:lib:Hledger.Query: words'': Parse escaped quotes in quoted patterns 2025-12-26 12:09:49 -10:00
Ilja Kocken
ed94e7f174
;examples:csv: add Interactive Brokers example CSV rules files (#2508) 2025-12-24 16:51:05 -10:00
Simon Michael
64af3a9d11 ;doc:cctax: updates 2025-12-19 08:58:23 -10:00
Simon Michael
bafdc72980 ;doc:cctax: updates 2025-12-19 08:36:45 -10:00
Simon Michael
824d10b406 ;doc:cctax: updates 2025-12-19 08:31:21 -10:00
Simon Michael
fc34c76eda ;examples: csv/cctax: notes on exporting to cryptocurrency tax calculators 2025-12-19 07:45:21 -10:00
Simon Michael
c0971c1c09 dev: cleanup 2025-12-16 00:18:28 -10:00
Simon Michael
48620c8e8c imp:journal:include: don't read file attributes unnecessarily
When including a literal path, don't use the Glob library at all.
Glob seems to read attributes of all files in a directory,
which disturbs build tools like tup which detect dependencies
based on filesystem operations.
2025-12-15 21:54:53 -10:00
Simon Michael
05b1798b7e ;doc:relnotes: drop hackage links 2025-12-13 09:21:00 -10:00
Simon Michael
ebaabe4305 imp:journal: fix a slight pessimisation of include directives
Since 1.50.3, canonicalizePath was being called wastefully when
processing journals with many nested include files and/or many matches
for include glob paths. On a slow filesystem, with unusually
many includes, this might have been quite noticeable.

Now we canonicalise each file path just once as it is encountered,
avoiding the wasted IO work.
2025-12-10 19:21:59 -10:00
Simon Michael
0d336dc3f8 ;dev: gitignore cleanups 2025-12-10 19:09:08 -10:00
Simon Michael
5bd57e7585 ;doc:REGRESSIONS: reduce word wrapping in table 2025-12-09 19:12:22 -10:00
Simon Michael
98abcb7a03 ;doc: ANNOUNCE: updates, new source text for announcements & blurbs 2025-12-09 10:35:31 -10:00
Simon Michael
11c6d85194 ;doc:relnotes: reorder 2025-12-08 13:34:06 -10:00
Simon Michael
31f14535cb ;doc:relnotes: update package links 2025-12-08 13:32:36 -10:00
Simon Michael
b04618ede6 ;doc:REGRESSIONS 2025-12-08 12:41:48 -10:00
Simon Michael
385b346b3c ;doc:ANNOUNCE: consolidate
Keep it short and ordered by priority for use in announcements of
different length
2025-12-08 12:38:13 -10:00
Simon Michael
0ca71e2f35 ;doc:RELEASING 2025-12-08 12:38:03 -10:00
Simon Michael
82cf87c61b ;doc: merge change docs from 1.51.1 2025-12-08 11:02:51 -10:00
Simon Michael
81846aa747 ;doc:changelogs, relnotes: merge 1.50.5 2025-12-08 10:19:24 -10:00
Simon Michael
665e2d0a55 fix:journal:include: relative includes from a symlinked file work again [#2503] 2025-12-08 09:36:13 -10:00
Simon Michael
784bdb4637 imp:aregister: correct that comment about transaction numbering 2025-12-07 17:44:01 -10:00
Simon Michael
67b2063809 imp!:aregister, journal: same-day txns respect order of -f options
If transactions on the same date are coming from two files specified
with -f options, we expect them to be displayed in parse order, ie
respecting the order of the -f options. This wasn't always the case,
now it is.

Also, transactions' tindex field is now unique across all files,
where previously it started at 1 in each file. This affects hledger
data generally, not just the aregister command.
2025-12-07 17:21:36 -10:00
Simon Michael
28f2180649 imp:areg: keep no matched account error on one line 2025-12-07 16:51:26 -10:00
Simon Michael
6bdaef89c0 ;dev:journal:include: more tests, note a new regression like [#2499] 2025-12-06 11:07:57 -10:00
Simon Michael
f3bf7e80b9 imp:journal:include: grammar fix in "neither found" error message 2025-12-06 11:07:53 -10:00
Dmitry Astapov
7b8684ba7a ;scripts: fix all the scripts in ./bin. Fixes #2497 2025-12-05 13:46:35 -10:00
Simon Michael
41a81fa527 ;doc:changelogs:edits 2025-12-05 07:34:52 -10:00
Simon Michael
c8acfcf4af ;doc:relnotes:edits 2025-12-05 07:34:35 -10:00
Simon Michael
12234e0b7e ;fix:journal: including an unreadable file now shows a clearer error
showing the problem include directive (previously the line number was
off by one). Likewise for other IO errors like when resolving ~ and
a home directory can't be found.
2025-12-05 02:34:08 -10:00
Simon Michael
3ad9f87e18 ;doc:REGRESSIONS 2025-12-05 01:44:57 -10:00
Simon Michael
6311469a6d ;doc:ANNOUNCE: add contributor names 2025-12-05 01:38:50 -10:00
Simon Michael
bed578458c ;doc:RELEASING: shorter release script 2025-12-05 01:26:52 -10:00
Simon Michael
cda2eb7d74 ;doc: update embedded manuals 2025-12-05 01:12:50 -10:00
Simon Michael
b59bce2137 ;cabal: update cabal files 2025-12-05 01:10:17 -10:00
Simon Michael
1cd3b3d95a ;pkg: set version to 1.51.99 2025-12-05 01:10:16 -10:00
Simon Michael
8d6988571d ;tools:just:ghrel-bin-upload -> ghrel-upload, fix 2025-12-05 00:59:57 -10:00
Simon Michael
425ddf406c ;doc:ANNOUNCE.short:edit 2025-12-05 00:49:43 -10:00
Simon Michael
e662ca4f92 ;doc:gh relnotes:1.51 2025-12-05 00:36:02 -10:00
Simon Michael
62b18e70c0 ;doc:announcements:1.51 2025-12-05 00:35:59 -10:00
Simon Michael
a0d4717ddb ;doc:relnotes:1.51 2025-12-05 00:35:57 -10:00
Simon Michael
93da076299 ;doc: finalise changelogs for 1.51 on 2025-12-05 2025-12-05 00:35:49 -10:00
Simon Michael
42b0f4a66f ;doc: changelogs 2025-12-04 19:49:33 -10:00
Simon Michael
2f18c85879 ;doc: update embedded manuals 2025-12-04 17:15:51 -10:00
Simon Michael
b6fa98ecf0 ;tools:just devtag-push: simplify 2025-12-04 17:11:29 -10:00
Simon Michael
9e9f4e4bbf ;tools:just:ghrel-bin-upload 2025-12-04 16:28:33 -10:00
Simon Michael
6e06812c5c ;doc:ghrelnotes:1.50.4 2025-12-04 16:21:13 -10:00
Simon Michael
326d35dc2f ;doc:ghnightlynotes:1.50.4 2025-12-04 16:20:09 -10:00
Simon Michael
96d74ccb08 ;doc:announcements:1.50.4 2025-12-04 16:19:18 -10:00
Simon Michael
c55f4b2eeb ;doc:relnotes:1.50.4 2025-12-04 16:18:52 -10:00
Simon Michael
3c672dee55 ;doc:changelogs:1.50.4 2025-12-04 16:17:50 -10:00
Simon Michael
4f5a3b06ca ;tools: just: cleanups (still applicable to master) 2025-12-04 16:14:50 -10:00
Simon Michael
2ee2d29f2b ;tools:just: manuals, manuals-site, ver, majorver 2025-12-04 16:10:03 -10:00
Simon Michael
809525302a ;tools:Shake: drop mandates target, update manual dates automatically 2025-12-04 16:04:42 -10:00
Simon Michael
e1458ee8b3 ;tools:just: reltags: cleanup 2025-12-04 13:55:30 -10:00
Simon Michael
45ba9e3948 ;doc:REGRESSIONS 2025-12-04 09:24:38 -10:00
Simon Michael
a184ccddd1 ;doc:journal:include: edits 2025-12-04 09:20:54 -10:00
Simon Michael
8cd113389a fix:journal:include: drop 1.50's exclusion of glob-matched dot paths [#2498]
1.50* attempted to work around Glob's implicit searching of non-top-level dot dirs.
This was overzealous; it meant that journal's include completely
excluded paths involving a glob and a dot dir or dot file anywhere in the path.

Now, the pre-1.50 behaviour is restored:
`*` and `**` won't implicitly match dot files or top-level dot directories.
They will implicitly search non-top-level dot directories, as before (#Glob#49).
2025-12-04 05:54:54 -10:00
Simon Michael
ade7ff83eb dev:test:journal:include: add missing symlinks 2025-12-01 12:22:56 -08:00
Simon Michael
53b923160c dev:test: exclude perf tests from func tests more robustly 2025-12-01 12:12:42 -08:00
Simon Michael
81744d81a1 fix:journal:include: fix some regressions with glob matching in 1.50-1.50.3
Before 1.50, journal's include directive's handling of glob patterns (*, **, ?, etc.)
had these limitations:

- ** always searched intermediate dot directories
- ** matched only directories, not files

In 1.50-1.50.3, it had different limitations, some unintended:

- it ignored all dot files, dot dirs, and symbolic links to dot dirs,
  even when explicitly mentioned in the pattern (unless using --old-glob)
- it showed symbolic links dereferenced, eg in `hledger files` output

Now it has fewer limitations, mainly this:

- it ignores all dot files and dot dirs, even when explicitly mentioned (unless using --old-glob)

Ie it no longer ignores symbolic links to dot dirs, and it no longer shows symbolic links dereferenced.
Also: including the current file is now always harmless, whether using a glob pattern or not.

Internally, file paths in the "include file stack" (jincludefilestack) are now just absolute,
but not canonicalised; showing symbolic links un-dereferenced in output and error messages seems
generally more useful. This might affect output elsewhere also.
(Those paths are still canonicalised on the fly when checking for include cycles,
not so efficiently: each time an include directive is parsed, all the current parent files
and all the new glob-matched include files will be re-canonicalised.
Hopefully this is unnoticeable.)
2025-12-01 11:28:51 -08:00
Simon Michael
00f6a832d4 fix:journal: consistent error message when include has no argument 2025-12-01 11:00:42 -08:00
Simon Michael
92a3ea48f9 dev:test:journal: clean up, expand include tests 2025-12-01 11:00:42 -08:00
Simon Michael
bb9ec4eadf ;dev:test:perf: edits 2025-12-01 11:00:42 -08:00
Simon Michael
a280e02102 ;dev:comment 2025-11-27 12:36:14 -08:00
Simon Michael
63afecbe54 ;tools:Justfile: less safari dependence 2025-11-26 13:49:10 -08:00
Simon Michael
a695a554b7 ;doc:REGRESSIONS 2025-11-26 13:48:51 -08:00
Simon Michael
8847c9aeb6 ;doc:changelogs 2025-11-26 13:48:43 -08:00
Simon Michael
fc85fa2609 ;examples: csv: cleanup 2025-11-23 12:44:11 -08:00
Simon Michael
9747b1951d ;examples: csv: cleanup 2025-11-23 10:16:47 -08:00
Simon Michael
7ad58a2d10 ;examples: csv: cleanup 2025-11-23 10:08:22 -08:00
Simon Michael
f986e2167d ;examples: organise/start the CSV rules library 2025-11-23 09:55:35 -08:00
Simon Michael
4965046a3a ;tools: just rels-major 2025-11-21 10:46:33 -10:00
Simon Michael
655e9f0d0d ;doc:REGRESSIONS 2025-11-20 12:54:02 -10:00
Simon Michael
dc3907443b ;pkg:Dockerfile: a likely fix, not tested 2025-11-20 12:31:58 -10:00
Simon Michael
de0b6603e3 ;bin: hledger-check-buynothing 2025-11-20 12:26:57 -10:00
Simon Michael
4d0550f1b4 ;dev: add performance tests, logging to perf.log, run by just perftest 2025-11-20 12:26:57 -10:00
Simon Michael
64b97b2658 ;doc: update embedded manuals 2025-11-19 22:25:44 -10:00
Simon Michael
d5ceb7bba3 ;doc: update command docs 2025-11-19 22:25:25 -10:00
Simon Michael
f58d3835b1 imp:stats: one-line mode; fix -o; doc updates
The new -1 flag prints a single line of output in machine-friendly
tab-separated format, including the program version, journal file
name, and performance stats.

Also -o now redirects all output, including the performance stats.
2025-11-19 22:23:47 -10:00
Simon Michael
0835a2485f ;doc:csv: CSV fields and hledger fields: edits 2025-11-19 10:45:45 -10:00
Simon Michael
c0ec0f4381 ;doc:csv: CSV fields and hledger fields: edits 2025-11-19 10:44:20 -10:00
Simon Michael
19efd392b9 ;doc:csv: Regular expressions in CSV rules: edits 2025-11-19 10:19:10 -10:00
Simon Michael
2a8fdccdd4 ;doc:csv: Regular expressions in CSV rules: edits 2025-11-19 10:17:08 -10:00
Simon Michael
35fbad37c4 ;doc:csv: Regular expressions in CSV rules 2025-11-19 10:06:37 -10:00
Simon Michael
1fec479d35 ;doc:csv: CSV fields and hledger fields 2025-11-19 10:06:37 -10:00
Simon Michael
087244848b ;doc:RELEASING 2025-11-18 18:26:18 -10:00
Simon Michael
6c86648e02 ;doc: update embedded manuals 2025-11-18 18:25:11 -10:00
Simon Michael
99bbc22de1 ;doc: update command docs 2025-11-18 18:25:03 -10:00
Simon Michael
518d367b88 ;dev: update internal error message 2025-11-18 17:50:05 -10:00
Simon Michael
e04c2ee0d7 fix:add: clean up typos after an over-eager search-replace 2025-11-18 17:47:34 -10:00
Simon Michael
4e66d43984 ;doc: add the 1.50.3 changelogs 2025-11-18 17:46:50 -10:00
Simon Michael
f5b254108b ;doc:gh releases:nightly 2025-11-18 16:24:37 -10:00
Simon Michael
e01bff140c ;doc:gh releases:nightly 2025-11-18 16:23:27 -10:00
Simon Michael
6e66221139 ;doc:REGRESSIONS 2025-11-18 16:10:07 -10:00
Simon Michael
77df19b577 ;doc:announcements 2025-11-18 13:47:24 -10:00
Simon Michael
a783b748e5 ;doc:relnotes: 1.50.3 2025-11-18 13:47:22 -10:00
Simon Michael
ec4e9a2ccc ;tools:relnotes.hs: update 2025-11-18 13:46:37 -10:00
Simon Michael
25817b65b1 ;tools:just changelogs*: update 2025-11-18 12:52:51 -10:00
Simon Michael
9eb4248348 ;tools:shake: fix project changelog updating 2025-11-18 12:52:24 -10:00
Simon Michael
4493f0615b dev:add: refactor, simplify names 2025-11-18 10:32:34 -10:00
Simon Michael
2c80a0feac ;ci: check for installed shelltestrunner again 2025-11-18 10:16:26 -10:00
Simon Michael
b2a0de75e2 dev: balanceTransaction -> balanceSingleTransaction 2025-11-18 09:39:16 -10:00
Simon Michael
69b63695fc ;doc:REGRESSIONS 2025-11-18 09:24:21 -10:00
Simon Michael
b2265ec5bb ;doc:REGRESSIONS 2025-11-18 09:23:16 -10:00
Simon Michael
c501bb69bb ;dev:test:errors: make csvnoinclude test more robust
It was failing on github's machines.
2025-11-18 09:16:15 -10:00
Simon Michael
eddba0845b ;dev:add: add missing test file 2025-11-18 08:36:58 -10:00
Simon Michael
de4f72a080 ;dev:test:errors: readme 2025-11-18 08:10:45 -10:00
Simon Michael
fe3fa26940 ;ci: force use of and upgrade to shelltestrunner 1.11, 2 2025-11-18 08:02:11 -10:00
Simon Michael
6f9a8d2f66 ;ci: force use of and upgrade to shelltestrunner 1.11 2025-11-18 07:48:39 -10:00
Simon Michael
72a8dd12de ;ci:binaries-mac-x64: switch to macos-15-intel 2025-11-18 07:40:33 -10:00
Simon Michael
1ff8098934 ;ci: use shelltestrunner 1.11 2025-11-18 07:36:00 -10:00
Simon Michael
dc60fcb2f7 ;tools: just oldest 2025-11-17 23:23:10 -10:00
Simon Michael
0d2dc96067 ;doc: Setting LEDGER_FILE: update 2025-11-17 23:05:06 -10:00
Simon Michael
22ea58a866 ;dev:tests:errors: update readme, tests 2025-11-17 22:44:22 -10:00
Simon Michael
5849c78538 imp:setup: tidier output for missing LEDGER_FILE or default file 2025-11-17 22:26:04 -10:00
Simon Michael
4087e72683 imp:lib:Hledger.Read: safer defaultJournal* functions 2025-11-17 22:26:04 -10:00
Caleb Maclennan
62092749ef ;bin: sortandmergepostings: Overhaul for more robust determinism
* Avoids non-deterministic flip-flopping when the alphabetical account sort has multiple commodities
* Sorts postings commodities so commodities are in the same order across transactions
* Sorts postings with matching commodity by posting amount
2025-11-17 22:25:14 -10:00
Simon Michael
9031612c30 fix!: error if LEDGER_FILE points to a nonexistent file [#2485]
Avoiding potentially confusing silent fallback. Also,

- Drop support for Ledger's legacy LEDGER environment variable;
  we now support only LEDGER_FILE, for simplicity.

- Clarify the behaviour, eg when a glob pattern matches multiple files
  or when the value is empty.
2025-11-17 21:09:55 -10:00
Simon Michael
f7bd563fc5 ;doc:add: edits 2025-11-17 18:58:42 -10:00
Simon Michael
482e688d07 ;doc:add: now balance assignment adding, as a separate commit 2025-11-17 18:56:08 -10:00
Simon Michael
16a3031357 ;doc:add: don't mention balance assignment adding yet
It doesn't really belong in the upcoming minor release; but it got
committed along with a fix which does.
2025-11-17 18:54:37 -10:00
Simon Michael
f29fbbe9ea fix:add: check balance assertions more accurately; allow balance assignments [#2478]
Balance assertions are now checked more accurately, with awareness of
how everything is ordered in the journal.
Also, it's now possible to add balance assignments.
2025-11-17 18:49:56 -10:00
Simon Michael
4920d76a3a imp:cli,ui,web: always build with -threaded [#2495]
It's required for runPager and presumably for the web server among
other things. The old "threaded" build flag has been dropped.
2025-11-17 14:57:13 -10:00
Simon Michael
098e65352c fix:pkg: make threaded (and dev and library-only) build flags manual [#2495]
The threaded runtime is required at least for hledger's pager output,
and probably for other things. It's controlled by the "threaded" build
flag for some historical reason. Now, that flag is marked as manual,
so that it can no longer be toggled by cabal. (Probably the build flag
should be dropped, that can be tried later.)

Related: Debian bug #1120833, causing an unusable hledger-1.50.2 package.
2025-11-17 14:51:23 -10:00
Simon Michael
97266bca13 ;doc:csv:if: link skip, end more clearly 2025-11-17 06:45:15 -10:00
Simon Michael
346d922f2d ;doc:print: note another way print can disrupt journal readability
(same-day balance assertions)
2025-11-16 21:24:10 -10:00
Simon Michael
73d9608c66 ;doc:add: balance assertions/assignments: edits [#2494] 2025-11-16 15:05:44 -10:00
Simon Michael
08c44d2c98 ;doc:add: balance assertions/assignments: clarify, fix [#2494] 2025-11-16 15:00:17 -10:00
Simon Michael
19377ae5ff ;doc:REGRESSIONS 2025-11-16 11:11:19 -10:00
Simon Michael
86acb04462 ;pkg:cabal: fix build with ghc <9.14 2025-11-15 21:33:57 -10:00
Simon Michael
356e2ba88a fix:journal: repair 1.50's journal reading slowness [#2493]
Since 1.50, sourceFilePath, which does IO operations, was being called for every item in the journal.
On my machine this was causing a ~40% slowdown,
but probably it could be more depending on storage system.

Now it's once again called only once per include directive.
Speed seems slightly better now than 1.43 for some reason
(eg: 13k txns/s -> 8k txns/s -> 14k txns/s).
2025-11-15 21:22:36 -10:00
Simon Michael
3d0bc53657 ;doc:dev: edits 2025-11-14 12:53:16 -10:00
Simon Michael
c3307a5050 ;doc:dev: link to obsidian dev notes 2025-11-14 12:48:56 -10:00
Simon Michael
17c55c366b ;doc:csv:source: wording 2025-11-14 05:39:28 -10:00
Simon Michael
17508cc844 ;scripts: hledgerj1: example of a wrapper reading a custom format 2025-11-13 12:42:09 -10:00
Simon Michael
508f011b1d ;doc:ACHIEVEMENTS 2025-11-13 08:46:28 -10:00
Simon Michael
8fbbd80cce ;doc:ACHIEVEMENTS: non-programming-tools ranking 2025-11-13 08:42:59 -10:00
Simon Michael
93683b5a3f ;doc:dev: link to the deepwiki AI docs 2025-11-12 20:00:52 -10:00
Simon Michael
671c761464 ;doc:areg: edits 2025-11-12 20:00:45 -10:00
Simon Michael
cf315c05b7 ;doc:areg: formatting 2025-11-11 07:15:50 -10:00
Simon Michael
33e3eba828 ;doc:check: edits, correction 2025-11-09 10:34:05 -10:00
samahri
b588ba0dcc imp: Show parent accounts in tree mode for context 2025-11-04 18:46:52 -10:00
Joschua Kesper
e2f2a22346 fix: html: Nested tables resulting in broken HTML on export
A HTML export results in a table which has a stylesheet and another table
nested inside. This is not valid HTML and gets auto corrected by closing the
first table and opening another table. The result is the heading of the table
can expand further than the remaining table.

This results in a few notable changes:

- The date is in a far bigger cell and it's very noticeable it's centered compared to the amounts
  (we may want to right align the date, though I don't have any particular thoughts about this)
- We no longer have two consecutive lines with black background and the start
- The table is as big as the heading (+ the default left margin)
2025-11-04 18:42:03 -10:00
Simon Michael
6111706eba Summary: ;doc:Value reporting: edits 2025-11-03 08:14:08 -10:00
Simon Michael
a42b256712 Summary: ;doc:Value reporting: edits 2025-11-03 08:12:32 -10:00
Simon Michael
7820eb6b48 ;doc:Value reporting: more advice, examples for COMM 2025-11-03 08:11:02 -10:00
Simon Michael
38f7e521a1 ;doc:Value reporting: warn about -V, emphasise -X 2025-11-03 08:00:22 -10:00
Simon Michael
f5fdc8679c ;doc:check: edit 2025-11-03 06:48:58 -10:00
Simon Michael
7af1b8f1c0 ;doc:check: edit 2025-11-03 06:46:39 -10:00
Simon Michael
97e4495ef3 ;doc:check: edit 2025-11-03 06:42:42 -10:00
Simon Michael
8a5be241b0 ;doc: update embedded manuals 2025-11-03 06:35:05 -10:00
Simon Michael
652df1a28d ;fix:check:doc: drop obsolete note about transaction balancing 2025-11-03 06:30:58 -10:00
Simon Michael
07fa6bbc9c ;doc:argument files: edits 2025-11-01 22:22:56 -10:00
Simon Michael
aed9e9e9b7 ;doc:argument files: edits 2025-11-01 22:03:36 -10:00
Simon Michael
a1c4c8bbed ;doc:argument files: corrections 2025-11-01 22:02:54 -10:00
Simon Michael
de822ae813 ;fix:close:doc:customisation: edit [#2492] 2025-11-01 10:37:41 -10:00
Simon Michael
a50d02ca04 ;fix:close:doc:customisation: edit [#2492] 2025-11-01 10:19:50 -10:00
Simon Michael
e4430ea7bc ;fix:close:doc:customisation: clarify [#2492] 2025-11-01 10:17:58 -10:00
Simon Michael
9bfa3862c6 ;doc:ghrelnotes, RELEASING: plan for immutable github releases 2025-10-31 09:29:53 -10:00
Simon Michael
2b15846636 ;doc:depth: rewrite, note combining issue 2025-10-28 14:11:50 -10:00
Simon Michael
db368edb42 ;doc:REGRESSIONS: manage expectations 2025-10-27 12:52:58 -10:00
Simon Michael
45bcc210f9 ;tools:gitignore: don't ignore website source files under site/
allowing them to be easily opened in vscode.
2025-10-26 10:56:12 -10:00
Simon Michael
d66c9d3d74 ;doc:bin/README: link new simplefin doc 2025-10-26 10:55:26 -10:00
Simon Michael
d97fa51b65 ;doc:CHANGES, relnotes:hledger 1.33: fix typo 2025-10-24 11:00:35 -10:00
Simon Michael
54652fa509 ;doc: Setting LEDGER_FILE: rewrite, new windows procedures 2025-10-24 10:30:46 -10:00
Simon Michael
b67555bdb7 ;doc: demote COMMON TASKS subheadings 2025-10-24 10:30:46 -10:00
ooker
e3736fddde ;docs:manual: add info about the -c command line option in the commodity directy section 2025-10-20 03:28:42 -10:00
Simon Michael
8f2b84a783 ;doc:ROADMAP 2025-10-15 13:31:43 -10:00
Simon Michael
7b52df8436 ;doc:ROADMAP 2025-10-15 13:28:44 -10:00
Simon Michael
31b571ae8f ;doc:ROADMAP 2025-10-15 13:28:04 -10:00
Simon Michael
1cfac4318a ;doc:ROADMAP for 2025 2025-10-15 13:25:42 -10:00
Simon Michael
3d79ba5fad ;doc: ACHIEVEMENTS updates 2025-10-15 13:07:00 -10:00
Simon Michael
ddc229b510 ;doc:dev: homebrew install stats 2025-10-15 12:20:15 -10:00
Simon Michael
b9c435fdd6 ;doc: ACHIEVEMENTS: fix rendering with server's older mdbook 2025-10-15 12:16:53 -10:00
Simon Michael
93b184ccca ;tools: just site-restart 2025-10-15 11:58:48 -10:00
Simon Michael
e052ab64d9 ;doc: move github stars info to ACHIEVEMENTS 2025-10-15 11:36:26 -10:00
Simon Michael
b28f028ac7 ;doc:ACHIEVEMENTS 2025-10-15 08:27:02 -10:00
Simon Michael
d798498db6 ;doc:ACHIEVEMENTS: made the top 20 2025-10-15 08:15:21 -10:00
Simon Michael
c17b15e454 ;imp:setup: accounts of all types wording 2025-10-13 11:46:07 -10:00
Simon Michael
71b4a1a281 ;doc:changelogs 2025-10-13 11:35:15 -10:00
Simon Michael
7e885134b3 ;doc: update embedded manuals 2025-10-13 11:28:41 -10:00
Simon Michael
d066c62dd0 ;doc: update command docs 2025-10-13 11:28:36 -10:00
Simon Michael
9af95105b4 imp:print: rename --location to --locations for consistency
with `accounts`. --location still works, as a hidden flag.
2025-10-13 10:14:38 -10:00
Simon Michael
64023478b7 imp:accounts: rename --positions to --locations for consistency
with `print`. --positions still works, as a hidden flag.
2025-10-13 10:11:18 -10:00
Simon Michael
8b125a2ee6 ;doc:aregister: clarify 2025-10-13 09:55:54 -10:00
Simon Michael
25f04dd367 feat:commodities,payees,tags: add --find mode, like accounts command
This improves consistency (in error messages too) and seems useful.

Also sync the order of account's options/option docs.
2025-10-13 09:55:22 -10:00
Simon Michael
102c972130 ;tools:gitignore: don't ignore bin/* 2025-10-12 12:55:09 -10:00
Simon Michael
0a7699d0a8 ;doc:print: note another parseability breaker 2025-10-12 12:54:56 -10:00
Simon Michael
61b0190cf4 ;doc:print: clarify amount styling 2025-10-11 18:02:23 -10:00
Simon Michael
13d1642e5c ;doc:changelogs 2025-10-11 15:03:26 -10:00
Simon Michael
7c04f67c08 ;doc:REGRESSIONS 2025-10-11 11:28:40 -10:00
Simon Michael
bd0a45d448 fix:PeriodData: simplify, use Day keys [#2479]
This is clearer and slightly better-performing than using Integer.
2025-10-11 11:27:58 -10:00
Simon Michael
438c4a0469 fix:PeriodData: use Integer keys to avoid date wraparound bugs [#2479]
PeriodData's use of Int keys caused wrong results with periodic
reports involving dates outside the machine-specific limits of Int.
Those were:

64 bits: -25252734927764696-04-22..25252734927768413-06-12
32 bits: -5877752-05-08..5881469-05-27
16 bits:  1769-02-28..1948-08-04
 8 bits:  1858-07-12..1859-03-24

32 bits is supported by MicroHS; 16 and 8 bits aren't supported by
any known haskell version, but that could change in future.

For example, on 64 bit machines we got:

25252734927768413-06-12 PeriodData's max date
   (expenses)   1

25252734927768414-01-01 next year past PeriodData's max date
   (expenses)   2

$ hledger reg -O csv --yearly
"txnidx","date","code","description","account","amount","total"
"0","-25252734927764696-11-10","","","expenses","1","1"

Now it uses Integer (like the time package), fixing the bug.
And benchmarking shows memory and time usage slightly improved
(surprisingly; tested with up to 500 subperiods, eg
hledger -f examples/10ktxns-1kaccts.journal reg -1 cur:A -D >/dev/null)
2025-10-11 11:27:58 -10:00
Simon Michael
70e9e7b060 ;dev: lookupDayPartition -> dayPartitionFind 2025-10-11 11:02:18 -10:00
Simon Michael
2e78a53931 ;dev: dayPartitionSpans -> dayPartitionStartEnd 2025-10-11 11:02:18 -10:00
Simon Michael
8779f2481a ;dev: PeriodData, DayPartition: haddock updates
Clarify some things. Also note an example of PeriodData wrapping around.
2025-10-11 11:02:18 -10:00
Simon Michael
cef35b97bd ;doc: move the project changelog to doc/, for easy consistent paths
Leave a top-level CHANGES placeholder for discoverability.
2025-10-11 10:11:10 -10:00
Simon Michael
d6ddacbec4 ;doc:AUTHORS.md: move to doc/ 2025-10-11 10:09:06 -10:00
Simon Michael
8e589835b7 ;pkg:hls config for cabal & haskell-debugger 2025-10-10 20:25:40 -10:00
Simon Michael
fc70e0d300 ;pkg:stack config for ghc 9.14 2025-10-10 20:20:03 -10:00
Simon Michael
f4c8508271 ;pkg:cabal config for ghc 9.14 2025-10-10 19:15:49 -10:00
Simon Michael
d798be69c5 ;doc:REGRESSIONS 2025-10-10 18:13:42 -10:00
Simon Michael
653cf189e0 ;doc:1.50.2: use correct real name 2025-10-09 15:31:58 -10:00
Stephen Morgan
4e9fa1615c dev!: lib: Refactor splitSpan to return Maybe DayPartition.
This eliminates all error calls from the chain calculating report
periods.
2025-10-09 15:31:28 -10:00
Stephen Morgan
b9caa4d948 dev!: balance: Use DayPartition for multibalance reports.
This allows us to guarantee that the report periods are well-formed and
don't contain errors (e.g. empty spans, spans not contiguous, spans not
a partition).

Note the underlying representation is now for disjoint spans, whereas
previously the end date of a span was equal to the start date of the
next span, and then was adjusted backwards one day when needed.
2025-10-09 15:31:28 -10:00
Simon Michael
288ced572c ;doc:Special characters: edits [#2468] 2025-10-09 13:58:34 -10:00
Simon Michael
917e5bb8d5 ;doc:Special characters: edits [#2468] 2025-10-09 13:44:25 -10:00
Simon Michael
1ad6f30bf0 ;doc:Special characters: rewrite [#2468] 2025-10-09 13:20:41 -10:00
Simon Michael
cca39bc371 ;tools: just nightlyrel-notes: fix 2025-10-09 11:53:00 -10:00
Simon Michael
d8df3a3ec3 ;tools:just: nightlyrel-bin-copy -> nightlyrel-bin 2025-10-09 11:53:00 -10:00
Caleb Maclennan
e76a2b04b0 docs: Correct documentation about shell escapes 2025-10-09 11:52:37 -10:00
Caleb Maclennan
3c731ae2f7 fix: Only escape special characters by single quoting, not escaping *and* quoting 2025-10-09 11:52:37 -10:00
Caleb Maclennan
8cbe4c6003 fix: Escape special symbols when passing arguments to addons 2025-10-09 11:52:37 -10:00
Simon Michael
abc559f39a ;doc:ui: edit [#2451] 2025-10-09 10:45:01 -10:00
Simon Michael
e42e137b18 ;doc:ui: mention how --pivot makes I reload like g [#2451] 2025-10-09 10:36:01 -10:00
Simon Michael
4aa7d7e20d fix:ui: re-check balance assertions properly when --pivot is used [#2451]
When hledger-ui is started with --pivot, re-enabling balance
assertions with the I key now does a full journal reload, to check
balance assertions accurately. It means that in pivot mode, the I key
can also show other data changes (as if you pressed the g key).
2025-10-09 10:29:39 -10:00
Simon Michael
1c86e02d99 ;dev: journalTransform: doc 2025-10-09 08:34:59 -10:00
Simon Michael
5206b10d8e ;examples:csv: monefy 2025-10-08 06:44:50 -10:00
Caleb Maclennan
a982f385c7 ;doc:ui: remove caveat about unsupported editors 2025-10-07 12:28:45 -10:00
Caleb Maclennan
a7c447a393 ;fix:ui: fix file watcher to catch file overwrites 2025-10-07 12:28:45 -10:00
Simon Michael
85a88327b3 ;doc: REGRESSIONS 2025-10-07 11:51:01 -10:00
Simon Michael
f52cc6aced ;github:workflows:binaries-linux-x64: fix for brick workaround 2025-10-02 11:06:15 -10:00
Simon Michael
74e2cb274c ;tools:just nightlybin tweak 2025-10-02 10:40:10 -10:00
Simon Michael
0848189e76 ;github:workflows:binaries-linux-x64: work around brick bounds issue
https://github.com/jtdaugherty/brick/issues/539
2025-10-02 10:34:15 -10:00
Simon Michael
3121deda2f ;pkg:ui: allow brick 2.10, vty 6.5 2025-10-02 10:33:49 -10:00
Simon Michael
91ba75d12d ;github:workflows: rename ghc caching id for clarity 2025-10-02 10:20:02 -10:00
Simon Michael
f7a9190d5b ;github:workflows: update some ghc caching ids 2025-10-02 10:20:02 -10:00
Simon Michael
84f037dc7e ;tools:just: more updates 2025-10-02 10:20:02 -10:00
Simon Michael
c871ca0ebb ;tools:just: drop the nightly tag, use a github nightly branch again
It's simpler.
2025-10-02 09:49:35 -10:00
Simon Michael
8c5bcbb7d3 ;tools:just: release script updates 2025-10-02 09:41:35 -10:00
Simon Michael
b26c274080 ;doc:REGRESSIONS 2025-10-02 07:50:29 -10:00
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
7dbdbf1e17 ;doc:REGRESSIONS 2025-10-01 15:05:54 -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
bde323b311 ;bin:tt: make it a little more generic 2025-10-01 13:33:01 -10:00
Simon Michael
94f44f5674 ;github:issue template: improve 2025-10-01 11:25:24 -10:00
Simon Michael
5441da0d01 ;github:issue template: improve 2025-10-01 11:20:37 -10:00
Simon Michael
6c4766199d ;github:issue template: improve 2025-10-01 11:12:40 -10:00
Simon Michael
dd81a4073f ;github:issue template: improve 2025-10-01 11:08:40 -10:00
Simon Michael
aba65d47f5 ;pkg:stack: drop unsupported old stack yamls
so they're not maintained.
2025-09-30 15:41:30 -10:00
Simon Michael
6f3382d100 ;workflows:binaries-windows: fix stack yaml 2025-09-30 12:59:43 -10:00
Simon Michael
3cf78ecd03 ;tools: update scripts to ghc 9.12 2025-09-30 12:09:23 -10:00
Simon Michael
95301c4430 ;pkg:stack: build with ghc 9.12 by default 2025-09-30 12:09:23 -10:00
Simon Michael
5e3ac602a7 ;pkg:stack: archive the ghc 9.10 config 2025-09-30 12:09:23 -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
9f8110a55e ;dev: consistent one LANGUAGE pragme per line 2025-09-29 18:34:11 -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
3efb1ae98a ;doc:DECISIONS 2025-09-29 17:55:25 -10:00
Simon Michael
a2c06e8fe7 ;doc:pivoting: typo 2025-09-29 10:45:30 -10:00
Simon Michael
ae95dca429 ;doc:Two space delimiter: simplify heading/url 2025-09-28 09:00:39 -10:00
Simon Michael
944b44f4be ;doc:Tags: edits 2025-09-28 08:41:23 -10:00
Simon Michael
232baf4a64 ;doc:Tags: edits 2025-09-28 08:40:03 -10:00
Simon Michael
b57d10ce34 ;doc:Tags: edits 2025-09-28 08:38:06 -10:00
Simon Michael
a6c004400e ;doc: Tags: rewrite [hledger_site#141] 2025-09-28 08:28:48 -10:00
Simon Michael
0b42094376 ;doc:Tags: fix list formatting 2025-09-27 21:16:10 -10:00
ooker
5f8a3f1cf0 ;doc:contributing: add translation job 2025-09-27 19:19:38 -10:00
Simon Michael
4f5e5f1368 ;doc:tldr:README 2025-09-27 18:44:20 -10:00
Simon Michael
cf11c5d825 ;bin: hledger-dc: dev notes 2025-09-27 18:44:20 -10:00
Ooker
ca0683ad68
;examples: add Vietnamese translations for top-level accounts (#2466)
* ;examples: add Vietnamese translations for top-level accounts

* ;examples: add a Vietnamese translations for the comment on top of the account type translation
2025-09-27 18:21:32 -10:00
Simon Michael
75ce0dde37 ;bin: hledger-dc, hledger-timedothm: dev notes 2025-09-27 09:51:03 -10:00
Simon Michael
fb28178e1a ;examples: add the sample files for hledger-dc & hledger-timedothm 2025-09-27 09:29:55 -10:00
Simon Michael
cd3e4937bd ;bin:hledger-dc: make dr/cr case insensitive 2025-09-27 09:27:28 -10:00
Simon Michael
f09ffe9b20 ;bin: add hledger-dc & hledger-timedothm, based on today's #hledger chats
Examples of preprocessing input and postprocessing output
to test new input syntax or output formats.
2025-09-27 09:21:31 -10:00
Simon Michael
a107ca5cce ;doc:REGRESSIONS 2025-09-27 05:19:21 -10:00
Simon Michael
287989f2f9 ;doc:RELEASING 2025-09-26 16:04:27 -10:00
Simon Michael
e93e5dce49 ;doc:relnotes: typo 2025-09-26 16:03:22 -10:00
Simon Michael
580d36b8da ;doc:RELEASING 2025-09-26 16:01:21 -10:00
Simon Michael
e97e3c4ef6 ;doc:relnotes: bump changelog links 2025-09-26 15:59:58 -10:00
Simon Michael
9406f7e22f ;doc:RELEASING 2025-09-26 15:53:42 -10:00
Simon Michael
dac0d5a4ee ;tools:just: nightly-tag-release -> nightly-tag 2025-09-26 15:50:48 -10:00
Simon Michael
81f228cf7f ;doc:changelogs, relnotes:1.50.2 2025-09-26 15:27:15 -10:00
Simon Michael
79cda7b457 ;doc:ghnightlynotes: 1.50.2 2025-09-26 15:23:16 -10:00
Simon Michael
2b86b806d9 ;doc:changelogs 2025-09-26 15:05:09 -10:00
Simon Michael
d7e7cd26f2 ;doc:DOCS 2025-09-26 14:32:14 -10:00
Simon Michael
af9bf0fb24 ;doc:DOCS 2025-09-26 14:10:06 -10:00
Simon Michael
14c82b30d1 ;doc:DOCS 2025-09-26 14:09:26 -10:00
Simon Michael
57abdd89d9 ;doc:DOCS: updates, add doc-update diagram 2025-09-26 14:06:07 -10:00
Simon Michael
f000c3f116 ;doc:doc-update.png: simplify 2025-09-26 14:05:53 -10:00
Simon Michael
d8d14f3480 ;doc:DOCS: document more procedures 2025-09-26 13:58:56 -10:00
Simon Michael
a345116f29 ;doc:DOCS 2025-09-26 10:48:30 -10:00
Simon Michael
d1138c0f33 ;doc:DOCS 2025-09-26 09:59:05 -10:00
Simon Michael
6a8d4f4509 ;doc:DOCS 2025-09-26 09:56:32 -10:00
Simon Michael
cab2f33aa6 ;doc:DOCS 2025-09-26 09:42:30 -10:00
Simon Michael
908468b976 ;doc:DOCS 2025-09-26 09:41:34 -10:00
Simon Michael
a98f007ed1 ;doc:DOCS 2025-09-26 09:22:50 -10:00
Simon Michael
82007ca983 ;tools:Shake manuals: more contributor instructions in the header comment [hledger_site#140] 2025-09-26 08:27:06 -10:00
Simon Michael
3d0c1e40c8 ;doc:DOCS: document current manual updating procedures 2025-09-26 07:58:05 -10:00
Simon Michael
2e96b03587 ;doc:REGRESSIONS 2025-09-26 06:40:20 -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
1100c7e62e ;dev:test:errors:csvstdinrules: cleanup 2025-09-26 00:34:01 -10:00
Simon Michael
cbd11ada76 ;doc:REGRESSIONS 2025-09-25 10:03:30 -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
60a1c0b861 ;doc: update embedded manuals 2025-09-24 18:09:45 -10:00
Simon Michael
fdee9d93cf ;doc:register: fix a typo in --depth example [hledger_site#140]
(reported by Quả Cầu)
2025-09-24 18:06:34 -10:00
Simon Michael
ef560e6b57 ;doc:Depth: rewrite; mention use of quotes [hledger_site#140]
(Quả Cầu, Simon Michael)
2025-09-24 18:05:16 -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
6fc3e85c2b ;doc:Account names: edits 2025-09-22 16:23:17 -10:00
Simon Michael
b525178f43 ;doc:Account names: edits 2025-09-22 10:52:35 -10:00
Simon Michael
4bc9c1484c ;doc:Account names: edits 2025-09-22 10:49:03 -10:00
Simon Michael
84dfaa2c97 ;doc:Account names: edits 2025-09-22 10:46:07 -10:00
Simon Michael
cfcdd47549 ;doc:Account names: edits 2025-09-22 10:43:39 -10:00
Simon Michael
133ca9a2bb ;doc:Account names: edits 2025-09-22 10:35:05 -10:00
Simon Michael
9075f22296 ;doc:Account names: edits 2025-09-22 10:34:13 -10:00
Simon Michael
74c1067f1a ;doc:Account names: edits 2025-09-22 10:28:16 -10:00
Simon Michael
1a96071d5f ;doc:Account names: edits 2025-09-22 10:27:14 -10:00
Simon Michael
cf83f604da ;doc:Account names: edits 2025-09-22 10:05:06 -10:00
Simon Michael
29052680cf ;doc:Account names: rewrite, emphasise the two space delimiter 2025-09-22 06:49:57 -10:00
Simon Michael
c88a900e17 dev:accounts: fix test 2025-09-21 12:53:32 -07:00
Simon Michael
d9bc45b523 imp:accounts: --types shows a tag only when type is known 2025-09-21 11:44:06 -07:00
Simon Michael
18f5c8aa24 imp:accounts: sort options a little 2025-09-21 11:44:06 -07: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
8dbe69c70b ;pkg:stack98: restore needed encoding 0.10 extra dep 2025-09-20 15:44:23 -07:00
Simon Michael
4bd96722c8 ;tools: update just releasediag, add just docupdatediag 2025-09-19 08:43:16 -07:00
Simon Michael
816488e5ed ;doc:doc-update.png: update 2025-09-19 08:43:16 -07:00
Simon Michael
41c77aa836 ;doc: doc-update diagram: cleanups, headings 2025-09-19 08:43:16 -07:00
Simon Michael
3532d039bc ;doc: update command docs 2025-09-19 08:43:16 -07:00
Simon Michael
99ba445c8e ;doc:journal: Editor configuration -> Editors 2025-09-18 09:55:01 -07:00
Simon Michael
887a732448 ;doc:REGRESSIONS: updates 2025-09-16 13:08:16 -07:00
Simon Michael
f04e78a30b ;doc:REGRESSIONS: more separators 2025-09-16 13:01:11 -07:00
Simon Michael
27c4b0035e ;doc:ui changelog, relnotes: fixes 2025-09-16 11:53:49 -07:00
Simon Michael
f5c629014e ;doc:relnotes: use more reliable changelog links 2025-09-16 11:36:22 -07:00
Simon Michael
77517e9f21 ;doc:RELEASING: updates 2025-09-16 11:27:28 -07:00
Simon Michael
39d95753be ;tools:just: reorganise, cleanups 2025-09-16 11:21:14 -07:00
Simon Michael
d97a10d32c ;doc:RELEASING: updates 2025-09-16 10:49:28 -07:00
Simon Michael
ae2774ecfc ;tools: just updates 2025-09-16 10:49:20 -07:00
Simon Michael
980a0d6e45 ;doc:RELEASING: drop checkboxes 2025-09-16 10:29:21 -07:00
Simon Michael
75325fe626 ;doc:RELEASING: updates, formatting 2025-09-16 10:25:37 -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
8def1143d2 ;doc:changelogs:1.50.1: add issue links 2025-09-16 10:10:30 -07:00
Simon Michael
90a7f191d4 ;doc: relnotes: drop API changes, not needed here 2025-09-16 08:59:25 -07:00
Simon Michael
b6b519ab1b ;tools:just ghnightly* -> nightly* 2025-09-16 06:56:29 -07:00
Simon Michael
15eb1016e0 ;doc:ANNOUNCE.short: 1.50.1 2025-09-16 06:56:09 -07:00
Simon Michael
36a1cbaff6 ;doc: changelogs 2025-09-16 05:20:48 -07:00
Simon Michael
0dc6b32374 ;doc: rename ANNOUNCE.short
Use whenever a short announcement is needed, eg for minor releases.
Keep short enough and plain text enough for mastodon posts.
2025-09-16 05:05:16 -07:00
Simon Michael
534fd75ed9 ;doc: relnotes: 1.50.1 2025-09-16 05:05:09 -07:00
Simon Michael
ffb6b9ec1b ;tools:relnotes: fixes 2025-09-16 05:05:04 -07:00
Simon Michael
fe0d4fd3ec ;doc: changelogs 2025-09-16 04:24:00 -07:00
Simon Michael
53b5c371e0 ;pkg:bump stack snapshots 2025-09-15 16:27:35 -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
8c051f3af1 ;doc:Text encoding: updates 2025-09-13 15:08:13 +01:00
Simon Michael
3e449fe238 fix:setup: fix "undeclared commodities" whitespace 2025-09-13 14:35:59 +01:00
Simon Michael
546b172be2 dev:ui:transaction, error screens: fix for third fix 2025-09-13 09:46:48 +01:00
Simon Michael
112272fd8f fix:ui:transaction, error screens: more robust updating, third fix [#2014], [#2288]
This makes both transaction screen and error screen below the
transaction screen update as we'd expect when using the E key, g key,
or --watch. No visible bugs known at the moment.
2025-09-13 09:23:59 +01:00
Simon Michael
549ccd2743 ;tools: Shake cabalfiles: note issue 2025-09-13 07:34:06 +01:00
Simon Michael
8c4e2e08b6 ;cabal: update cabal files 2025-09-13 06:57:22 +01:00
Simon Michael
d303e09603 imp:ui: improve debug output 2025-09-12 22:56:31 +01:00
Simon Michael
e9c1fc36a3 fix:ui:transaction screen: update on data changes, second fix [#2288]
This one is more thorough and hopefully more robust.
Compared to the first fix, it fixes an error seen in --watch mode
when you save an error (and maybe then save a second edit,
and then repair the error - I forget)
2025-09-12 10:04:41 +01:00
Simon Michael
e87d9e3ce3 ;dev:ui: note issue with regenerateScreens 2025-09-12 10:02:35 +01:00
Simon Michael
5d1bb5c2ad ;dev:ui:ErrorScreen: note possible updating issue after E key 2025-09-12 10:02:35 +01:00
Simon Michael
27fcd50914 dev:ui:refactor, clarify uiReload* 2025-09-12 10:02:35 +01:00
Simon Michael
51842034dd dev:ui:refactor, rename enableForecast 2025-09-12 10:02:35 +01:00
Simon Michael
53bd228973 imp:ui: debug output improvements 2025-09-12 10:02:35 +01:00
Simon Michael
7ccc0d5bdd lib:Hledger.UI.ErrorScreen: rename, clarify uiReload*
uiReloadJournal -> uiReload
 uiReloadJournalIfChanged -> uiReloadIfFileChanged
2025-09-12 10:02:35 +01:00
Simon Michael
c7c196caa6 fix:ui:transaction screen: update on data changes, first fix [#2288]
Make the transaction screen refresh properly after running an editor
with E, or reloading with g or --watch.
2025-09-12 10:02:02 +01:00
Simon Michael
c906788334 ;dev:ui: RegisterScreen: cleanup 2025-09-11 16:45:52 +01:00
Simon Michael
1d0ea95b9c ;doc:changelogs 2025-09-11 11:09:12 +01:00
Simon Michael
f731d3c25a lib!: Hledger.Cli.Utils: stop exporting pivotByOpts, anonymiseByOpts 2025-09-11 10:51:16 +01:00
Simon Michael
46c2980fa0 ;doc:CHANGES edit 2025-09-11 10:44:05 +01:00
Simon Michael
c19620f3bc lib!: refactor, rename
pivotByOpts -> maybePivot
anonymiseByOpts -> maybeWarnAboutAnon
2025-09-11 10:18:41 +01:00
Simon Michael
e64c26e603 lib!: rename withJournal -> withJournalDo, with alias and deprecation warning 2025-09-11 10:03:10 +01:00
Simon Michael
2c18614e7b ;dev: journalTransform notes 2025-09-11 09:58:24 +01:00
Simon Michael
a4692a4a38 fix:ui: preserve --pivot (and --obfuscate) options when reloading [#2451] 2025-09-11 09:56:42 +01:00
Simon Michael
8fe97adbef ;tools: just ghci-ui: make :main work again 2025-09-11 09:30:08 +01:00
Simon Michael
e113dcec6d ;doc:ISSUES: links 2025-09-11 07:55:36 +01:00
Simon Michael
ed5cf569b5 imp:print: alphabetise flags, mostly 2025-09-11 07:33:22 +01:00
Simon Michael
3a1e30255c fix:print: remove unused --show-costs flag from command line help 2025-09-11 07:33:22 +01:00
Simon Michael
6d164b48a0 imp:journal: in amounts, also allow and ignore empty {} (or {{}}) 2025-09-11 07:33:22 +01:00
Simon Michael
eb9fa40d5b ;doc:valuation: edit 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
1d56db0ad8 ;bin:README: link to csv rules doc 2025-09-07 09:31:51 +01:00
Simon Michael
917700718e ;bin: paypal*, simplefin*: add usage examples 2025-09-07 08:31:27 +01:00
Simon Michael
7cab6939ae ;doc:ROADMAP: drop TODO link 2025-09-06 07:08:12 +01:00
Simon Michael
c79c66a740 ;doc:posting dates: link to legacy syntax 2025-09-06 07:03:05 +01:00
Simon Michael
c0636a03ba ;doc:TODO: drop 2025-09-05 08:22:15 +01:00
Simon Michael
e7cf3f6f65 ;doc:ISSUES: update urls 2025-09-05 08:21:36 +01:00
Simon Michael
658399afe3 ;tools:just: cleanup 2025-09-05 08:09:24 +01:00
Simon Michael
99b60b0868 ;doc: changes, relnotes: move import stderr output to "Breaking changes" 2025-09-05 07:34:30 +01:00
Simon Michael
ad90948092 ;doc:REGRESSIONS 2025-09-04 05:54:06 +01:00
Simon Michael
0b4e80f178 ;doc:RELEASING 2025-09-04 05:53:56 +01:00
Simon Michael
e2f5858916 ;doc: changes, relnotes: edit 2025-09-03 22:31:32 +01:00
Simon Michael
8a99192ea1 ;doc:RELEASING 2025-09-03 22:22:31 +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
f93ceeef97 ;doc:relnotes: drop old hledger-install link 2025-09-03 20:20:26 +01:00
Simon Michael
dc84d54ae1 ;cabal: update cabal files 2025-09-03 20:07:41 +01:00
Simon Michael
5530917129 ;ci:binaries-windows: work around vty-windows breakage in stackage
https://github.com/commercialhaskell/stackage/issues/7832
2025-09-03 20:04:34 +01:00
Simon Michael
9e39f5cffd ;ci:binaries-windows: be more verbose 2025-09-03 20:03:48 +01:00
Simon Michael
ddff672c67 ;doc: github nightly notes 2025-09-03 20:03:48 +01:00
Simon Michael
8d8a607dd6 ;doc: ANNOUNCE* 2025-09-03 20:03:48 +01:00
Simon Michael
c64a16b4c4 ;pkg: drop hledger-install script, no longer used 2025-09-03 20:03:48 +01:00
Simon Michael
6879676088 ;doc:relnotes: 1.50 2025-09-03 20:03:30 +01:00
Simon Michael
638a0c2676 ;doc:relnotes: whitespace 2025-09-03 20:03:30 +01:00
Simon Michael
39af7120e4 ;doc:csv:source: edit 2025-09-03 20:03:30 +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
57ac01acde ;tools: bump to lts-24.8 2025-09-01 12:42:27 +01:00
Simon Michael
9d05d5d083 ;dev: note bitrotted error message tests 2025-09-01 08:57:27 +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
c6140c1ef6 ;tools: just functest: hide successes again 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
0d0f2697de ;doc:timeclock: fix legacy anchor 2025-08-31 09:20:30 +01:00
Simon Michael
252f4bf13c ;dev:timeclock: tests cleanup 2025-08-31 09:20:30 +01:00
Stephen Morgan
db6714a120 fix: budget: Respect --summary-only flag. (#2443)
Budget reports will now respect the --summary-only flag.
2025-08-30 20:17:31 +01:00
Simon Michael
605444923e ;bin:simplefincsv: reorder fields, move ids to the end 2025-08-28 21:38:38 +01:00
Simon Michael
f2d2135ed8 ;bin:simplefincsv: clean up excessive spaces 2025-08-28 21:38:38 +01:00
Simon Michael
91b24df4b2 ;doc:csv:source: add data command examples 2025-08-28 21:38:38 +01:00
Simon Michael
a5ec1cb888 ;bin: paypal*, simplefin*: rename, improve UX, update to 1.1 2025-08-28 21:38:38 +01:00
Simon Michael
7de0c0ac7a imp:import: show briefer no txns output, just file names 2025-08-28 21:38:38 +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
cffee7f546 imp:import: avoid extra newline after output 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
c3e85ce9f7 dev: valuation tests cleanup 2025-08-28 17:26:42 +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
Simon Michael
5c6ea2f56e ;doc:valuation: drop mention of old hledger-ui bug 2025-08-28 17:26:42 +01:00
Simon Michael
ac7e2e931f ;doc:ISSUES: typo 2025-08-28 07:00:36 +01:00
Simon Michael
b64f7405dd ;doc:ISSUES: open issues link 2025-08-28 06:57:14 +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
b5cb1d08d0 fix: add, commodities, diff: support the --conf and -n/--no-conf flags [#2446] 2025-08-26 14:01:48 +01:00
Simon Michael
a28c933677 ;doc: REGRESSIONS 2025-08-25 19:29:50 +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
a2a1124680 ;doc: update command docs 2025-08-24 09:02:49 +01:00
Simon Michael
4f4426dc24 ;doc: update embedded manuals 2025-08-24 09:01:04 +01:00
Simon Michael
4c1c44ce36 imp:cli: clearer help for -f, and the add and import commands
From euouae's irc feedback
2025-08-24 08:59:50 +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
a4960649ad ;bin: readme: edits 2025-08-20 19:56:49 +01:00
Simon Michael
709471f164 ;bin: update readme 2025-08-20 19:54:45 +01:00
Simon Michael
54e711936f ;bin: helpers for downloading from simplefin.org, a bank aggregator 2025-08-20 19:48:06 +01:00
Simon Michael
bdf5e7d06e ;doc:import: use windows-compatible quotes in watchexec example 2025-08-15 04:13:15 +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
afdeaccd75 ;doc:csv: source, archive updates 2025-08-14 14:23:53 +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
9766f65ac7 imp:import: show info output on stderr, not stdout 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
a8eb2ff92d
Merge pull request #2440 from lfos/fix-dockerfile
dev: fix Dockerfile
2025-08-14 12:33:42 +01:00
Lukas Fleischer
68f13a9dcb dev: fix Dockerfile
Sync Docker GHC version with Stack configuration, update dependencies,
and replace deprecated Dockerfile syntax.
2025-08-13 15:40:02 -04:00
Simon Michael
61f28b8843 ;doc: Valuation examples: typo 2025-08-10 07:17:49 +01:00
Simon Michael
a713175e96 ;doc:RELEASING 2025-08-10 07:17:41 +01:00
Simon Michael
e8a641e72a ;doc: Valuation examples: fix example [#139] 2025-08-10 06:40:10 +01:00
Simon Michael
9865091130 ;tools:github:issue templates: updates 2025-08-04 10:26:36 +01:00
Simon Michael
02baf36ce6 ;tools:github:issue templates: updates 2025-08-04 10:23:55 +01:00
Simon Michael
174139abca ;tools:github:issue templates: updates 2025-08-04 10:20:13 +01:00
Simon Michael
0443dcd0c2 ;tools:github:issue templates: cleanup 2025-08-04 10:13:35 +01:00
Simon Michael
3bf0b85084 ;tools:github: update issue templates 2025-08-04 09:53:00 +01:00
Simon Michael
ef89b67d7a dev: accounts: more tag: tests 2025-08-03 07:55:53 +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
aabc892277 dev: Accounts: import cleanup 2025-08-03 05:37:56 +01:00
Simon Michael
cace7eb491 ;doc:areg: clarification 2025-07-30 18:17:58 +01:00
Simon Michael
65463456ed ;pkg:stack912: bump to nightly snapshot 2025-07-28 17:03:35 +01:00
Simon Michael
424e072268 ;pkg: bump default build, tools to lts 24.2 / ghc 9.10.2 2025-07-28 17:03:32 +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
6521b8dfdb imp:setup: improve output 2025-07-25 19:08:26 +01:00
Simon Michael
55f12d89e0 ;doc:completions: readme edits 2025-07-24 20:09:41 +01:00
Simon Michael
90d4224d5b ;doc:completions: readme edits 2025-07-24 20:02:18 +01:00
Simon Michael
9c3c6a3a5a ;doc:completions: update README 2025-07-24 20:01:03 +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
94f6f6a9a2 ;tools: just test: also run doctests 2025-07-17 14:13:09 -07:00
Simon Michael
4a11474fff
imp: include: better glob patterns, errors, debug output, docs [#2428]
The `include` directive has had a number of fixes and improvements. It now has

- more detailed documentation
- more thorough error checking, with clearer and more consistent messages, showing the correct problem line
- more debug output, at levels 6 and 7
- more robust and convenient glob patterns:
  - glob patterns always ignore the current file
  - `**` can now be used without a following slash, to also match the filename. So if previously you wrote `**/*.j`, now you can just write `**.j`.
  - glob patterns now always ignore [dot directories](https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory)
    (such as `.git` directories in a source tree).

The last item is a breaking change.
Previously, a pattern like `**/c.j` would find `a/.b/c.j`, even though it shouldn't.
Fixing this required a trade-off: now no glob pattern can find that file, not even a valid one like `*/.b/c.j`.
Only a literal file path with no wildcards (`a/.b/c.j`) will find it.
We assume excluding dot directories is the more common use case.
If this change breaks your existing files, please report it, and either update them or use the `--old-glob` flag for now.
2025-07-17 12:20:09 -07:00
Simon Michael
d5ff7fe454 ;doc: include: mention glob pattern's dot limitation and the --old-glob flag 2025-07-17 08:10:34 -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
0ea239503c dev: rename the hidden --timeclock-old flag to --old-timeclock
--timeclock-old is still supported as well, for now, even though
this flag is not documented yet (it has appeared in
changelogs/release notes and in issue discussion).
2025-07-17 07:49:39 -07:00
Simon Michael
c74d8bf6fb doc: include: update docs 2025-07-16 06:52:19 -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
42b9c8b0fb dev: consolidate/expand include tests 2025-07-14 17:12:24 -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
9418807ddc ;doc: include directive: clarify effect, glob limitations 2025-07-11 10:36:57 -07:00
Simon Michael
b23af9275d imp: simplify bad account type error message 2025-07-09 12:00:13 -07:00
Simon Michael
57b1e18757 imp:demo: show a better error message if asciinema is not installed 2025-07-08 11:35:31 -07:00
Simon Michael
3952d4e611 ;dev:cli: update outdated CLI help 2025-07-08 11:35:31 -07:00
jneubrand
7482f1efc3 fix: use precompiled regexes to handle case insensitivity correctly 2025-07-03 14:25:50 -07:00
Simon Michael
31dc8a090e ;doc: Depth: fix typo 2025-07-03 08:22:53 -07:00
Simon Michael
fc93a4c644 fix:add: show green prompts properly instead of ANSI codes [#2410] 2025-07-01 16:41:05 -07:00
Simon Michael
cd904e80d5 imp:setup: downgrade lack of pager to an info (no pager on windows) 2025-07-01 12:48:28 -07:00
Simon Michael
bc0cfebeb5 imp:setup: ignore shell completions for now 2025-07-01 12:05:56 -07:00
Simon Michael
ce992840fc ;doc:ghrelnotes: edits 2025-07-01 11:58:46 -07:00
Simon Michael
7a4a5ec892 ;doc: note fish LEDGER_FILE setup 2025-07-01 11:53:20 -07:00
Simon Michael
a2c3cedd4d ;doc:ghrelnotes: simplify install commands 2025-07-01 11:52:12 -07:00
Simon Michael
f11ad4b70f imp:setup: output improvements 2025-07-01 05:39:03 -07:00
Simon Michael
5d399c3cec ;doc:REGRESSIONS 2025-06-30 12:24:36 -07:00
Simon Michael
340233ed93 ;doc: SCHEDULE, just schedule 2025-06-30 12:24:12 -07:00
Simon Michael
1efc0486d5 ;doc:add: clarify that add is for journal format only 2025-06-30 06:24:52 -07:00
Simon Michael
7ebd152084 imp: web: don't hide the chart when window is narrow 2025-06-29 11:15:59 -07:00
Simon Michael
de66e266f1 fix:web: dragging in chart now selects date ranges more accurately
Eg, previously you couldn't select a range including transactions
at the rightmost edge of the chart.
2025-06-29 11:05:38 -07:00
Simon Michael
cb0a0fafa5 dev:web: chart.hamlet: reindent, simpler comment syntax 2025-06-28 21:01:24 -07:00
Simon Michael
fd0bf6f90d dev:web: move all chart js into chart.hamlet template 2025-06-28 20:33:49 -07:00
savanto
230998136f imp: areg: do not abbrev other accts in machine-readable output (#1995)
- Do not turn "other accounts" into a comma-delimited string when the
  report is constructed, but pass `AccountName`s up the chain. This
  requires modifying the `AccountTransactionsReportItem` type to contain
  `[AccountName]` rather than `Text`.

- Perform the account name summarization
  (`Hledger.Data.AccountName.accountSummarizedName`) closer to the
  actual rendering of the report, so that different report formats can
  choose summarization strategy.

- Continue to summarize as before for terminal/text output (ie.
  human-readable). Do not summarize any more for machine-readable output
  (csv/html/fods).
2025-06-28 13:38:58 -07:00
Simon Michael
d2692a5518 ;doc: FINANCE: simplify title to Finance 2025-06-27 15:17:54 -07:00
Simon Michael
12c4f101a1 ;doc:RELEASING: simplify, drop fixup releases 2025-06-26 21:18:29 -07:00
Simon Michael
245f38c1a2 ;doc: update a cookbook link 2025-06-26 21:18:12 -07:00
Simon Michael
5d8b30ba37 ;doc:REGRESSIONS: cleanup 2025-06-25 15:35:52 -07:00
Stephen Morgan
79fa806690 fix: csv: Make --summary-only work with csv output (#2411)
Don't display date headers with --summary-only in csv output.
2025-06-24 20:19:29 -07:00
Stephen Morgan
8ab2fb6b77 feat: lib: Allow special string %account in auto-posting rules (#1975)
This allows using the special string `%account` in auto posting rules.
When run, this will be substituted with the account name of the matched
posting.
2025-06-24 10:12:57 -07:00
Simon Michael
b996b7fadc ;doc: smart dates :fix typo 2025-06-23 19:01:07 -07:00
Simon Michael
714b346fdd imp: fully support quarter syntax in smart dates and period expressions 2025-06-23 18:37:08 -07:00
Simon Michael
afd18a10bf fix: show historical balances even if report period is empty [#2403]
This adds a safer version of spanDefaultsFrom that won't create spans
that end before they start, and updates all reports to use it.

The only related change noticed so far is that close now gives an
error instead of a malformed entry, when there's no data to close.
[#2409]
2025-06-15 22:42:58 -10:00
Simon Michael
ca631d9fca dev: rename balance-multiperiods.test 2025-06-15 22:16:50 -10:00
Simon Michael
9c7e5b2467 dev:MultiBalanceReport: consistent debug output labels 2025-06-15 22:16:50 -10:00
Simon Michael
427a5de1f3 dev:MultiBalanceReport: use error' consistently for clean output 2025-06-15 22:06:34 -10:00
Simon Michael
2123f571ac ;doc:options: mention that flag+value can't combine with other flags [#2059] 2025-06-15 15:27:25 -10:00
Simon Michael
c5c05d3499 ;doc:csv:date-format: mention lack of support for local time formats [#1874] 2025-06-15 15:08:22 -10:00
Simon Michael
baf02fc879 ;doc:examples/self-tracking: update 2025-06-15 14:36:33 -10:00
Simon Michael
4312d18ef7 ;doc:scripts: keep a mention of the old -- syntax [#458] 2025-06-15 13:51:44 -10:00
Simon Michael
d504e0a7c0 fix:demo: drop mention of -- ASCIINEMAOPTS, it no longer works 2025-06-15 13:25:04 -10:00
Simon Michael
3ba3d3d676 ;doc: drop -- argument from more docs [#458] 2025-06-15 13:25:04 -10:00
Simon Michael
3d7a1717e1 ;doc:config files: no longer experimental 2025-06-15 13:06:33 -10:00
Simon Michael
9fde1ae380 ;doc:addon commands: edits [#458] 2025-06-15 13:04:32 -10:00
Simon Michael
8da36b4397 ;ci: add a date to cache ids for cache-busting 2025-06-15 12:53:32 -10:00
Simon Michael
012fc416b0 ;ci: try disabling stack update step 2025-06-15 12:50:12 -10:00
Simon Michael
d56bfc4392 ;ci: disable stack paths output 2025-06-15 12:49:26 -10:00
Simon Michael
877ab3e5b0 fix:cli: clearer unknown command & flag error; accept addon flags [#2388] [#458]
When given an unknown command and an unknown flag, we now prioritise
showing the unknown command error. [#2388]

This fix, on top of prior work, also solves a long standing CLI/UX
problem we've had with addon commands: now you can freely mix in
addon-specific options in a hledger command line, and hledger won't
complain. Ie, writing -- before addon flags is no longer needed. \o/
2025-06-15 12:47:59 -10:00
Simon Michael
245a0bec62 ;doc: update embedded manuals 2025-06-15 07:32:40 -10:00
Simon Michael
e473fc9794 ;doc: update command docs 2025-06-15 07:32:40 -10:00
Simon Michael
4a5775da71 imp: commodities/payees/tags: used/declared flags, like accounts
And general cleanup of options and help across
the accounts, commodities, payees, tags commands.
2025-06-15 07:32:40 -10:00
Simon Michael
38aadddf7b dev: Hledger.Query.matchesCommodity: check all query types, not just cur:
And default to False (unlike the other match functions. Ok ?)
2025-06-15 07:32:40 -10:00
Simon Michael
13109ac280 dev: number the payees tests 2025-06-14 17:36:28 -10:00
Simon Michael
b8f12e3908 ;doc: print: improve --location help 2025-06-14 17:36:28 -10:00
Simon Michael
de9c487f58 ;ci: caching note 2025-06-13 22:03:37 -10:00
Simon Michael
3f7a9f97f9 fix:help: -i and -m were always showing help's help [#2399] 2025-06-13 21:47:58 -10:00
Simon Michael
ce0cd344b5 ci: more consistent, platform- and ghc-specific cache keys
These github caches created once and never updated; so it's important
to have keys that are specific enough that it doesn't
(a) waste time restoring cached data that we won't be able to use
(b) fail to cache new data because it thinks the old cache was used.
2025-06-13 21:00:42 -10:00
Simon Michael
ccb0033e31 ci: more consistent ghc version env var 2025-06-13 20:48:53 -10:00
Simon Michael
6cde1a3ff7 ci: more consistent images, image notes 2025-06-13 20:41:43 -10:00
Simon Michael
c730eed3e6 ci:oldest: fix ghc version in cache keys 2025-06-13 20:41:30 -10:00
Simon Michael
2c733538d5 ci: no need to install ripgrep 2025-06-13 18:18:25 -10:00
Simon Michael
9cd633ace6 ;tools:checkembeddedfiles: use standard unix tools
rg isn't in github images
2025-06-13 18:18:25 -10:00
Simon Michael
6b19f24c5f ci: fix ghc version in cache keys 2025-06-13 18:03:54 -10:00
Simon Michael
c3bd6f36b4 ;ci: don't bother tar-ing these binaries 2025-06-13 17:34:11 -10:00
Simon Michael
9c56c29fab doc: RELEASING 2025-06-13 17:19:35 -10:00
Simon Michael
4eadf74408 ;ci: stack paths test: edits 2025-06-13 16:36:43 -10:00
Simon Michael
2edc0e4d20 ;ci: stack paths test: edits 2025-06-13 16:29:37 -10:00
Simon Michael
fc46ddffe3 ;ci: stack paths test: edits 2025-06-13 16:27:57 -10:00
Simon Michael
2abb717f49 ;ci: stack paths test: edits 2025-06-13 16:23:22 -10:00
Simon Michael
1b7fc3fb7d ;ci: stack paths test: edits 2025-06-13 16:11:36 -10:00
Simon Michael
65f01adc3d ;ci: stack paths test: edits 2025-06-13 16:09:59 -10:00
Simon Michael
de84a3e8bc ;ci: stack paths test: edits 2025-06-13 16:05:21 -10:00
Simon Michael
bf5707d131 ;ci: stack paths test: edits 2025-06-13 16:03:23 -10:00
Simon Michael
da6df3702d ;ci: test step showing stack paths 2025-06-13 15:57:40 -10:00
Simon Michael
e9be7ea7f5 ;doc:add: edits 2025-06-13 12:31:56 -10:00
Simon Michael
1e9bd3c2c9 ;doc:add: edits 2025-06-13 12:26:34 -10:00
Simon Michael
e434c0101e ;doc:relnotes: 1.43.2 2025-06-13 12:05:20 -10:00
Simon Michael
d3c86bafdf ;doc: finalise changelogs for 1.43.2 on 2025-06-13 2025-06-13 12:05:20 -10:00
Simon Michael
cc95eca1ce ;doc: update changelogs 2025-06-13 12:05:20 -10:00
Simon Michael
e0fb08ee9b ;doc: REGRESSIONS 2025-06-13 11:31:19 -10:00
Simon Michael
9da947f3f5 ;doc:ghnightly:1.43.2 2025-06-13 11:28:05 -10:00
Simon Michael
3b1bd92cf2 ;doc: add: balance assignments: mention -I [#2406] 2025-06-13 10:29:23 -10:00
Simon Michael
5514c926b9 ;doc:ghnightly: go back to comparing with binaries branch
it's more reliable
2025-06-13 10:23:57 -10:00
Simon Michael
db6488ba95 ;doc:ghnightly: compare with nightly tag, not binaries branch 2025-06-13 10:02:39 -10:00
Simon Michael
e716c3f054 ;doc:dev 2025-06-13 09:35:26 -10:00
Simon Michael
b75a730250 ;tools: nightly-push: edits 2025-06-13 09:19:28 -10:00
Simon Michael
53120e86bc ;doc: update embedded manuals 2025-06-13 09:11:44 -10:00
Simon Michael
a823a719f2 ;tools:just: rename some nightly recipes 2025-06-13 09:10:54 -10:00
Simon Michael
bd2d8728d1 fix: txn balancing: fix logic for the 1.50 message [#2402]
and add more tests.
2025-06-13 09:10:46 -10:00
Simon Michael
3713a1b77b ;fix:doc:add: document balance assertions/assignments behaviour [#2406] 2025-06-13 07:36:45 -10:00
Simon Michael
8a03b2ee89 ;examples:csv:eternl.rules 2025-06-13 07:35:47 -10:00
Simon Michael
219f7a7ec3 ;doc: ghnightlynotes 2025-06-12 20:39:00 -10:00
Simon Michael
62e3b57564 ;dev:tests: add missing file 2025-06-12 19:41:10 -10:00
Simon Michael
986a55218b ;doc: update embedded manuals 2025-06-12 19:06:40 -10:00
Simon Michael
16fd84166a ;dev: cleanup 2025-06-12 18:48:48 -10:00
Simon Michael
57031b0e78 dev: rename exitOnError -> handleExit, improve doc 2025-06-12 18:48:10 -10:00
Simon Michael
0750a27d00 dev: ignore SIGPIPE errors from truncated output in a more robust way [#2405] 2025-06-12 18:36:41 -10:00
Simon Michael
c335f93bcb dev:tests: costs can affect display precision via implicit amounts 2025-06-12 18:17:03 -10:00
Simon Michael
005fe0557c dev: fix query-expr.test, broken by fix for #2407
I bypassed the CI tests that would have caught this.
2025-06-12 18:13:48 -10:00
Simon Michael
cda62d9a59 ;dev: change "1.44" to "1.50" in docs and error messages 2025-06-12 17:55:13 -10:00
Simon Michael
0d388a6f93 ;imp: show a more helpful error for transactions unbalanced by upgrade [#2402]
(and drop the last sentence from the single-commodity unbalanced
transaction error)
2025-06-12 17:55:13 -10:00
Simon Michael
868d535f3f ;doc: transaction balancing: doc rewrite [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
de4d637def dev: transaction balancing: cleanup [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
0252367de4 ;doc: Transaction balancing: update, mention migration workarounds
Also, for release notes:

Notably, the old behaviour could allow small remainders to accumulate over time, in accounts that (a) often have an inexact posting amount or cost amount and (b) are never reconciled (typically equity, revenues, and expenses).
You can check for this more easily now, eg with a command like

hledger bal cur:\\$ -c '$1.000000000000' | rg '\...0*[1-9]'

(Show account balances, limited to the $ currency, overriding $'s display style to show 12 decimal places, and filter that to just the lines with a non-zero decimal digit in the 3rd place or beyond.)
2025-06-12 17:55:13 -10:00
Simon Michael
bf90b20f2c imp: --txn-balancing flag to select transaction balancing precision [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
442bd24bc5 ;dev: commodityStyleFromRawOpts: cleanup 2025-06-12 17:55:13 -10:00
Simon Michael
21d403d45d ;dev: test showing formerly accepted inexact entry now rejected [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
9f93055782 ;dev: tests showing P and inferred amounts affecting display precision 2025-06-12 17:55:13 -10:00
Simon Michael
a9408b8cd5 imp:journal: balance transactions with local precisions [#2402] 2025-06-12 17:55:13 -10:00
Simon Michael
82ba831822 dev: move commodityStylesFromAmounts to Hledger.Data.Amount
Also drop canonicalStyleFrom, seems unused.
2025-06-12 17:55:13 -10:00
Simon Michael
157de7c34c ;doc:REGRESSIONS 2025-06-12 17:55:13 -10:00
Simon Michael
eb6b48dded fix:cli: don't raise an error if output is truncated in a pipe [#2405]
This broke in 1.43.

Now we ignore any IOException whose message contains "broken pipe".
Hopefully this matches pre-1.43 behaviour and doesn't hide real errors.
2025-06-12 17:55:13 -10:00
Simon Michael
001a0b9572 fix:areg: round all amounts to display precision again [#2407]
This broke in 1.32.
2025-06-12 17:55:13 -10:00
Simon Michael
8bda89c4ef ;doc:relnotes: fix issue link [#73] 2025-06-12 07:34:00 -10:00
Simon Michael
ad0c10cae1 ;doc:hledger: changelog, relnotes: mention improved decoding errors [#73] 2025-06-12 07:27:07 -10:00
Simon Michael
a21bafe87f ;doc: REGRESSIONS 2025-06-10 14:56:08 -10:00
Simon Michael
f12d3a473f ;doc: REGRESSIONS 2025-06-10 14:23:53 -10:00
Simon Michael
9cd8e632db ;doc: REGRESSIONS 2025-06-09 15:00:39 -10:00
Simon Michael
41e62885c4 dev: avoid a strange vscode/Haskell highlighting bug 2025-06-07 15:28:41 -10:00
Simon Michael
f49f9c35cd ;examples: vat.journal 2025-06-05 07:46:58 -10:00
Stephen Morgan
80cf1d1995 !dev: lib: Allow Account to store date-indexed balances.
This upgrades Account to enable it to store a multiperiod balance, with
a separate balance for each date period. This enables it do the hard
work in MultiBalanceReport.

Some new types are created to enable convenient operation of accounts.
- `BalanceData` is a type which stores an exclusive balance, inclusive
  balance, and number of postings. This was previously directly stored
  in Account, but is now factored into a separate data type.
- `PeriodData` is a container which stores date-indexed data, as well as
  pre-period data. In post cases, this represents the report spans,
  along with the historical data.
- Account becomes polymorphic, allowing customisation of the type of
  data it stores. This will usually be `BalanceData`, but in
  `BudgetReport` it can use `These BalanceData BalanceData` to store
  both actuals and budgets in the same structure. The data structure
  changes to contain a `PeriodData`, allowing multiperiod accounts.

Some minor changes are made to behaviour for consistency:
- --declared treats parent accounts consistently.
- --flat --empty ensures that implied accounts with no postings are not displayed, but
  accounts with zero balance and actual postings are.
2025-06-04 23:10:00 -10:00
Simon Michael
6f08c52f7f ;doc: COMMANDS: mention general options
I was trying to insert a mention/link next to each command's specific
flags, but it's too disruptive given the complex ways we reuse and
generate these docs.
2025-06-04 17:13:42 -10:00
Simon Michael
6fd60dde3d ;doc: fix mishighlighting in vscode 2025-06-04 17:13:09 -10:00
Simon Michael
9754abfe49 ;doc: update embedded manuals 2025-06-04 16:51:48 -10:00
Simon Michael
fcb1b4ed1c imp:cli: simplify flag group titles 2025-06-04 15:25:27 -10:00
Simon Michael
f1c4fed1a7 ;doc:ISSUES: update links 2025-06-04 14:33:39 -10:00
Simon Michael
2f564cd1df ;tools: add/improve relver, nightlytag, devtag 2025-06-04 12:42:05 -10:00
Simon Michael
4240d6b017 ;doc: ghnightly description 2025-06-04 12:17:26 -10:00
Simon Michael
f8d50fcb53 ;doc: ghnightly description 2025-06-04 12:01:15 -10:00
Simon Michael
2475163338 ;doc:REGRESSIONS 2025-06-04 12:01:09 -10:00
Simon Michael
7fbeea60b1 ;doc:REGRESSIONS: parentheses 2025-06-04 09:38:13 -10:00
Simon Michael
98371fbd30 ;doc:REGRESSIONS: simplify heading 2025-06-04 09:28:57 -10:00
Simon Michael
e7efadd96e ;doc:REGRESSIONS: add Fixed versions 2025-06-04 09:25:18 -10:00
Simon Michael
eb2fc5d715 ;doc:changelogs/relnotes: add some missing issue numbers 2025-06-04 09:24:55 -10:00
Simon Michael
125975cc3d ;doc:REGRESSIONS 2025-06-04 08:32:36 -10:00
Simon Michael
a473e137ce ;doc:REGRESSIONS 2025-06-04 08:30:35 -10:00
Simon Michael
8498894a96 ;doc: update command docs 2025-06-04 07:54:03 -10:00
Simon Michael
2899b46c59 ;doc: update embedded manuals 2025-06-04 07:31:18 -10:00
Simon Michael
af9822a60a ;cabal: update cabal files 2025-06-04 07:31:13 -10:00
Simon Michael
a0a539cb66 ;pkg: set version to 1.43.99 2025-06-04 07:31:12 -10:00
Simon Michael
2f6166142a ;doc:REGRESSIONS 2025-06-03 19:21:49 -10:00
Simon Michael
05c982aefd ;doc: relnotes 2025-06-03 18:44:40 -10:00
Simon Michael
847567095d ;doc: finalise changelogs for 1.43.1 on 2025-06-03 2025-06-03 18:44:40 -10:00
Simon Michael
871eee9549 ;pkg:ui: allow brick 2.9 2025-06-03 18:44:40 -10:00
Simon Michael
c2972b3d5d ;pkg: update tested-with 2025-06-03 18:44:40 -10:00
Simon Michael
b67379c3d8 fix: cur: in posting-based reports filters multicommodity amounts again [#2396] 2025-06-03 18:44:08 -10:00
Simon Michael
6daba4edb8 dev: refactor journalValueAndFilterPostingsWith a bit [#2396] 2025-06-03 18:44:08 -10:00
Simon Michael
bdd2018663 lib:Hledger.Query: queryIsAmtOrSym 2025-06-03 18:44:08 -10:00
Simon Michael
5bbf31096d ;lib: note an issue with filterQuery 2025-06-03 18:44:08 -10:00
Simon Michael
3410052934 ;dev: query-expr.test: a simpler test [#2371] 2025-06-03 18:44:08 -10:00
Simon Michael
a591d26ecb ;dev:web: fix compilation warning in MiscR.hs 2025-06-03 18:43:31 -10:00
Simon Michael
53b15ebd4a ;dev:web: use embedFileRelative, like others 2025-06-03 11:22:05 -10:00
Simon Michael
1c63d20c6f ;tools: checkembeddedfiles: detect more embedFile* calls 2025-06-03 11:21:12 -10:00
Simon Michael
fdb0caa9c1 fix:web: declare embedded file, fix compilation failure [#2397] 2025-06-03 11:14:50 -10:00
Simon Michael
ffa84d7a8d ;doc:Query types: clarify amt: [#2396] 2025-06-03 10:10:04 -10:00
Simon Michael
959be5f51d fix:lib:Hledger.Query: parseQueryTerm: don't call error for a bad amt: argument 2025-06-03 10:10:04 -10:00
Simon Michael
2a4718d40a fix: make a few more error messages consistent, hiding call stack [#2367] 2025-06-03 10:10:04 -10:00
Simon Michael
0799f19271 ;doc:REGRESSIONS 2025-06-03 08:03:13 -10:00
Simon Michael
bcde959105 ;dev: tests for amt:/cur: with balance commands [#2396] 2025-06-03 07:48:38 -10:00
Simon Michael
455db07495 ;tools: Shake changelogs: fix missing blank lines around old heading 2025-06-03 07:34:52 -10:00
Simon Michael
aa0f4a74c9 ;fix:doc: more text encoding corrections/cleanups, 4 [#2394] 2025-06-03 00:14:30 -10:00
Simon Michael
2ad6f7f744 ;fix:doc: more text encoding corrections/cleanups [#2394] 2025-06-02 23:49:36 -10:00
Simon Michael
925b85a65e ;doc: relnotes edits 2025-06-02 17:16:43 -10:00
Simon Michael
de86b3c3ef ;doc: changelog edits 2025-06-02 17:16:43 -10:00
Simon Michael
80c09f24ee ;doc: RELEASING 2025-06-02 08:41:16 -10:00
Simon Michael
84d9afed90 ;tools: ghcruns-download: make tmp dir 2025-06-01 13:39:41 -10:00
Simon Michael
a6637b3256 ;doc: announcements 2025-06-01 12:31:24 -10:00
Simon Michael
0c75328015 ;doc: relnotes 1.43 2025-06-01 12:31:24 -10:00
Simon Michael
a39a278e4e ;doc: mailmap 2025-06-01 12:31:24 -10:00
Simon Michael
41c567528d ;pkg: hledger-install: bump for 1.43 2025-06-01 12:31:24 -10:00
Simon Michael
59387cbf6b ;doc: finalise changelogs for 1.43 on 2025-06-01 2025-06-01 12:31:24 -10:00
Simon Michael
d9c512deee ;doc: changelogs 2025-06-01 12:31:24 -10:00
Simon Michael
631e1e4265 ;dev:add.test: uniquify temp files, fixing intermittent results [#2356] 2025-06-01 12:30:09 -10:00
Simon Michael
fe451208fe ;dev: add.test: add a space before non-hledger commands [#2356]
This prevents `shelltest -w HLEDGERBIN` from disturbing those commands.
2025-06-01 12:06:36 -10:00
Simon Michael
c3cc1d846b ;dev: add.test: fix wrong $ quoting [#2356] 2025-06-01 12:06:34 -10:00
Simon Michael
687356005c ;dev: add.test: adjust test comments for emacs folding 2025-06-01 12:06:12 -10:00
Simon Michael
10b0f18f0c ;ci:binaries-linux-*: add missing gmp-static lib
These got bumped accidentally to alpine:latest, which now has a
separate gmp-static lib it seems.
2025-06-01 12:05:59 -10:00
Simon Michael
48ef186091 ;ci:binaries-linux-x64: fix missing gmp lib ?
This got removed, maybe it's to blame.
2025-06-01 11:36:45 -10:00
Simon Michael
39726bfe8d ;doc: update links to install#text-encoding 2025-06-01 10:14:41 -10:00
Michael Rees
0c3e7bc395 Always check added transaction, even if no immediate assertion 2025-05-31 23:19:47 -10:00
Michael Rees
db4d7d0dbe ;doc: Update manual to describe assertion checking in hledger add 2025-05-31 23:19:47 -10:00
Michael Rees
19a2a70f2d Handle partial dates in added transactions 2025-05-31 23:19:47 -10:00
Michael Rees
b042115692 Ignore assertions during add with -I 2025-05-31 23:19:47 -10:00
Michael Rees
636860363f Add test for assertion combined with posting date 2025-05-31 23:19:47 -10:00
Michael Rees
5a4aa87df8 Clarify some code after review 2025-05-31 23:19:47 -10:00
Michael Rees
17f914e571 imp: add: Verify balance assertions on each posting (#2355) 2025-05-31 23:19:47 -10:00
Simon Michael
8e151cf37b ;fix:doc: more text encoding corrections, 2 (#2394) 2025-05-30 12:13:27 -10:00
Simon Michael
b7dbe3ed4f ;fix:doc: more text encoding corrections (#2394) 2025-05-30 12:11:15 -10:00
Simon Michael
d679098cfe ;fix:doc:Text encoding: rewrite, corrections (#2394) 2025-05-30 11:40:09 -10:00
Simon Michael
f1f1ad5c94 ;dev: clarify 2025-05-30 10:48:24 -10:00
Simon Michael
713773cfc3 imp: simplify the unicode decode error message; refactor 2025-05-30 09:43:30 -10:00
Simon Michael
296814fd49 ;fix:doc: text encoding: we don't require UTF-8 (#2394) 2025-05-29 13:39:37 -10:00
Simon Michael
c63d85c81f ;ci:binaries: cleanups, notes 2025-05-29 13:39:13 -10:00
Simon Michael
4587eccdf4 ;fix: recognise another case of text decoding failure 2025-05-29 12:25:06 -10:00
Simon Michael
39f178f710 ;tools: remove user from .mailmap as requested 2025-05-29 09:30:26 -10:00
Simon Michael
39b2688bc7 ;doc:PULLREQUESTS: edits 2025-05-29 08:18:13 -10:00
Simon Michael
fdd4d17d27 ;doc:PULLREQUESTS: edits 2025-05-29 08:14:29 -10:00
Simon Michael
71673d42eb ;ci: fix step names breaking yaml 2025-05-29 08:12:36 -10:00
Simon Michael
40d69a8b14 ;doc: PULLREQUESTS: guidance on PR titles 2025-05-29 08:07:55 -10:00
Simon Michael
26991b86e9 ;pkg:stack: cleanups 2025-05-28 17:31:29 -10:00
Simon Michael
c1ab42fbba ;ci: simplify cache step names 2025-05-28 17:31:29 -10:00
Simon Michael
30630b9cc1 ;ci: binaries: simplify, cleanup 2025-05-28 17:31:25 -10:00
Simon Michael
e259fe75f6 ;ci:binaries-windows-arm64: note limitation, disable for now 2025-05-28 14:20:09 -10:00
Simon Michael
0c27cded98 ;ci:windows: cleanup; use preinstalled stack 2025-05-28 13:58:37 -10:00
Simon Michael
4612ee22c9 ;ci:linux: note the use of a container 2025-05-28 11:23:19 -10:00
Simon Michael
78a7ce1292 ;ci:binaries-linux-x64: install ghcup only if not cached; fix cache 2025-05-28 11:23:19 -10:00
Simon Michael
df85b56824 ;ci:windows: add binaries-windows-arm64 2025-05-28 11:23:19 -10:00
Simon Michael
60bbae7ef0 ;ci:linux: rename non-working workflows 2025-05-28 05:24:11 -10:00
Simon Michael
077ef76055 ;ci:linux: add binaries-linux-arm64-stack, best effort 2025-05-27 19:31:40 -10:00
Simon Michael
c8ab9e8bf6 ;ci:linux: add binaries-linux-arm64, best effort 2025-05-27 19:31:39 -10:00
Simon Michael
76c869ab06 ;ci:binaries-linux-x64: cleanup, use ghcup-setup action 2025-05-27 18:16:50 -10:00
Simon Michael
4c7765e8dd ;doc:csv:description field: fix link [hledger_site#133] 2025-05-27 14:46:07 -10:00
Simon Michael
b209c60019 ;ci:docker: trigger manually [#2002] 2025-05-27 05:49:30 -10:00
Doug Goldstein
e0b24eff87 dev: fix Dockerfile installing of dependencies
Avoid the build failing due to an interactive prompt.
2025-05-27 05:42:00 -10:00
Doug Goldstein
fddc01a3a2 dev: ci: build Docker images
Uses the existing in-tree Dockerfile to build Docker images when
a release is made and everytime there is a merge to master.
Publishes the images to the GitHub Container Registry as well.
Heavily based on https://docs.docker.com/build/ci/github-actions/examples/
2025-05-27 05:42:00 -10:00
Simon Michael
0641224e81 ;doc: updates 2025-05-26 20:40:00 -10:00
Dmitry Astapov
f38bc34d35 lib: roi: fix a bug with PnL attributed to the wrong period (fixes #2391) 2025-05-26 19:54:21 -10:00
Ben Sima
8b027a48e8 imp: web: further document the api endpoints 2025-05-23 15:21:22 -10:00
Ben Sima
4e9aa5825d feat: web: serve openapi.json
Serving the OpenAPI JSON schema means that clients can auto-discover how
to use the API. I am particularly interested in this because open-webui
can use OpenAPI to add context to LLM responses.
2025-05-23 15:21:22 -10:00
Simon Michael
e360e50497 imp:csv: more --debug=2 output for if rules
Also, in debug output show records more like what matchers are seeing,
ie with quotes removed.
2025-05-22 17:05:45 -10:00
Simon Michael
9474d808dc ;imp:lib:Hledger.Utils.Debug: more cleanups, docs
This and/or the previous related change also changed a few cases which
always traced or always logged; now all debug output is consistently
either traced or logged.
2025-05-22 17:03:50 -10:00
Simon Michael
0d014577c2 ;imp:lib:Hledger.Utils.Debug: more cleanup 2025-05-21 23:07:14 -10:00
Simon Michael
820a44eb07 imp:lib:Hledger.Utils.Debug: simpler, more consistent dbg* names 2025-05-21 22:54:00 -10:00
Simon Michael
a0204404c9 ;doc:journal:cheatsheet:edit 2025-05-19 13:22:57 -10:00
Simon Michael
0a3146c48d ;doc:ISSUES 2025-05-17 14:09:20 -10:00
Simon Michael
ab526468df ;doc:dev: cleanup 2025-05-17 12:18:15 -10:00
Simon Michael
aa9e33e72b ;doc:dev: cleanup 2025-05-17 12:08:25 -10:00
Simon Michael
236cf8a4e7 ;doc:dev,ISSUES,PULLREQUESTS: cleanup 2025-05-17 12:06:21 -10:00
Simon Michael
a40d27397f ;doc:FINANCE: bounties 2025-05-17 11:19:52 -10:00
Simon Michael
8e2b42d06e ;doc:dev: cleanup 2025-05-17 11:19:46 -10:00
Simon Michael
475e09b391 ;doc:dev: assignedprs, unassignedprs redirects 2025-05-17 10:54:49 -10:00
Simon Michael
297cf30e60 ;dev: journalValueAndFilterPostingsWith notes [#2371], [#2385] 2025-05-17 02:09:27 -10:00
Simon Michael
67e656e4c0 ;dev: tests for boolean queries involving amt:/cur: [#2371] 2025-05-17 00:04:41 -10:00
Simon Michael
512f147c2b ;dev: simplify pre-valuation query tests [#2371] [#2385] [#2387] 2025-05-17 00:04:41 -10:00
Stephen Morgan
447a681645 fix: Ensure valuation happens after filtration (#2385) 2025-05-17 00:00:33 -10:00
Simon Michael
dbf583829a ;doc: relnotes: fix issue number 2025-05-16 14:52:11 -10:00
Simon Michael
2d28604c74 ;doc: RELEASING 2025-05-16 14:20:43 -10:00
Simon Michael
bd449dfc55 ;doc: REGRESSIONS 2025-05-16 14:14:15 -10:00
Simon Michael
4cb1913d2b ;tools: just hackageupload: fix cabal files check 2025-05-16 13:40:29 -10:00
Simon Michael
7deff8a319 ;workflows:binaries: show all hledger --version outputs in the log 2025-05-16 13:18:56 -10:00
Simon Michael
99b7682430 ;pkg: hledger-install: bump versions 2025-05-16 13:18:54 -10:00
Simon Michael
eb4f6ba33f ;doc:relnotes: 1.42.2 2025-05-16 13:18:52 -10:00
Simon Michael
d3468812bf ;doc: finalise changelogs for 1.42.2 on 2025-05-16 2025-05-16 13:18:18 -10:00
Simon Michael
425540e8ca ;doc: update changelogs 2025-05-16 13:18:13 -10:00
Simon Michael
5b99442b19 ;tools: just changelogs: fix date order in headings 2025-05-16 12:27:48 -10:00
Simon Michael
4999411bb0 ;doc: changelogs: fix 1.42.1 headings 2025-05-16 11:43:23 -10:00
Simon Michael
f7aa1fadd1 fix:test: fix and improve pass-through of arguments to tasty [#2386] 2025-05-16 10:46:50 -10:00
Simon Michael
8f6a7c8a66 fix: web: don't hang when saving a large file [#2319] 2025-05-16 09:44:26 -10:00
Simon Michael
151b36a6f2 ;dev: haddock edits 2025-05-16 09:42:55 -10:00
Simon Michael
d8627cb863 ;web: help: edits 2025-05-16 00:20:07 -10:00
Simon Michael
afb4313c9b ;doc: Queries: edits 2025-05-16 00:16:06 -10:00
Simon Michael
21f75ebff4 ;web: help: edits 2025-05-16 00:15:58 -10:00
Simon Michael
e30d8a5ad3 ;web: help: edits 2025-05-16 00:05:29 -10:00
Simon Michael
1f2c4e4fe7 ;web: help: edits 2025-05-15 23:38:15 -10:00
Simon Michael
8667e09536 ;web: help: edits 2025-05-15 23:36:33 -10:00
Simon Michael
b4c6897956 ;doc:web:PERMISSIONS: edits 2025-05-15 23:19:09 -10:00
Simon Michael
14932fd06c ;doc: web: fix outdated PERMISSIONS doc 2025-05-15 22:41:28 -10:00
Simon Michael
efe27b883d web: improve search help; show version 2025-05-15 22:40:48 -10:00
Simon Michael
87167a7667 ;bin:bashrc: avoid clash with comm 2025-05-14 07:49:00 -10:00
Simon Michael
1d150549b2 ;dev: tests: be more robust when testing a "hledger-VER" executable 2025-05-13 10:48:16 -10:00
Simon Michael
87c7f61670 ;doc: Queries: discuss transaction vs posting queries; cleanups 2025-05-12 12:18:15 -10:00
Simon Michael
ee87ba7f5f ;doc: Commands: mention a few command names 2025-05-12 12:17:12 -10:00
Pranesh Prakash
00442a6440 Update nps.csv.sh 2025-05-11 05:31:22 -10:00
Simon Michael
59ff2a9542 ;doc: fix broken "Commodity display style" links [hledger_site/#132]
Followup to jbrains' fix in https://github.com/simonmichael/hledger_site/pull/132.
2025-05-10 10:43:28 -10:00
Simon Michael
9365084b06 ;dev: setup: notes 2025-05-09 15:39:06 -10:00
Simon Michael
39b04ba1cc ;doc: relnotes: fix hackage changelog links 2025-05-08 12:39:20 -10:00
Simon Michael
51fb6a97b7 ;dev: hie-stack.yaml: more HLS notes 2025-05-07 08:09:51 -10:00
Simon Michael
101cc126d3 ;bin: more consistent/memorable aliases 2025-05-05 17:51:41 -10:00
Simon Michael
ad14930116 ;dev: gitignore 2025-05-05 17:51:41 -10:00
Stephen Morgan
eda4c8dd62 dev: lib: Add NFData instances for Journal and subcomponents. 2025-05-02 08:30:38 -10:00
Stephen Morgan
468a3da1b7 dev: lib: Use strict data in Hledger.Data.Types.
This reduces memory usage and results in speedups in some commands.
2025-05-02 08:30:17 -10:00
Simon Michael
c24355e31f ;dev: assertions tests cleanup 2025-04-27 09:09:58 -10:00
Simon Michael
274751f48a ;doc: balance assertions and multiple files: clarify again, add tests 2025-04-27 09:05:25 -10:00
Simon Michael
330f3fccaa ;dev: rename assertions.test 2025-04-27 08:30:18 -10:00
Simon Michael
2371f677e5 imp:journal: include directive now allows a same-line comment 2025-04-27 08:30:18 -10:00
Simon Michael
dbf54facc2 ;examples: quickstart journal 2025-04-26 21:21:26 -10:00
samahri
4f9473240f cli: "balanced" check is enabled only with "check" command 2025-04-26 20:05:00 -10:00
Simon Michael
2e6bc32820 ;doc: account types: edits 2025-04-26 10:10:04 -10:00
Simon Michael
c46c448ff7 ;doc: Config files -> Config file 2025-04-26 09:49:24 -10:00
Simon Michael
b7466ed282 ;doc: account types: rewrite 2025-04-26 09:26:06 -10:00
Simon Michael
9a8c0b30b3 ;doc: clarify 2025-04-26 02:22:43 -10:00
Simon Michael
dca05e2542 ;doc: assertions and multiple files: edits 2025-04-25 18:25:12 -10:00
Simon Michael
3b4ab7d659 ;doc: balance assertions and multiple files: clarify 2025-04-25 18:20:40 -10:00
Simon Michael
9c6a0c0492 ;doc: ghnightly: use the --pre-release flag 2025-04-25 16:14:09 -10:00
Simon Michael
0298918be2 ;doc: setup 2025-04-25 16:14:03 -10:00
Simon Michael
bca4b39c58 lib: defaultJournalSafely: don't strip newline 2025-04-25 15:42:47 -10:00
Simon Michael
144489a418 imp: setup: improve output 2025-04-25 15:21:59 -10:00
Simon Michael
f0f048326e lib: defaultJournalSafely wasn't very safe; now catches error calls 2025-04-25 15:21:11 -10:00
Simon Michael
bf40d28c8b imp: config files (and maybe timedot files) no longer require a final newline 2025-04-25 13:59:18 -10:00
Simon Michael
8f46eca6ec imp:setup: improve output and logic; show strictness config 2025-04-25 13:58:36 -10:00
Simon Michael
45e449e97a imp:setup: show more green for ideal setups 2025-04-25 12:04:06 -10:00
Simon Michael
4a5b0d46b5 imp: setup v2, simpler implementation and shorter output
This one tests only with the currently running hledger, and requires being installed in PATH to show full info.
2025-04-25 11:53:57 -10:00
Simon Michael
78baaee6c5 lib: more version helpers, rename to HledgerBinaryInfo, silence warnings 2025-04-25 09:36:38 -10:00
Simon Michael
b0959cb23d lib:Hledger.Utils.IO: document some file reading utilities 2025-04-25 09:21:11 -10:00
Simon Michael
45d5fd7963 imp: show a clearer error message on unicode en/decoding failures [#73]
A very long-awaited improvement: for unicode exceptions, and I/O
exceptions which look like they were caused by a unicode error
(usually text decoding failure), our error message now includes
an explanation and advice on what to do.

Currently this uses the GHC.IO.Encoding API, which is not ideal:
"The API of this module is unstable and not meant to be consumed by
the general public. If you absolutely must depend on it, make sure to
use a tight upper bound, e.g., base < 4.X rather than base < 5,
because the interface can change rapidly without much warning."

Also it relies on scanning for patterns in GHC's various
unicode-related error messages, which may not be complete and could
change in future. To do: try the encoding package's IO helpers,
perhaps they give more specific exceptions.
2025-04-25 08:57:07 -10:00
Simon Michael
06cd0f9472 lib: exitOnExceptions -> exitOnError 2025-04-25 08:32:47 -10:00
Simon Michael
d1e4d00b8d lib: Cli,UI,WebOptions: export binaryinfo 2025-04-25 08:26:14 -10:00
Simon Michael
d3af9f0217 ;doc:check: edits 2025-04-24 11:27:28 -10:00
Simon Michael
d37000726d ;doc:check: edits 2025-04-24 11:13:29 -10:00
Simon Michael
650901901f ;doc:check: edits 2025-04-24 10:53:44 -10:00
Simon Michael
fea127fcb5 ;doc: note check-related bug in rawOptsToInputOpts [#2377] 2025-04-24 10:44:34 -10:00
Simon Michael
0d6023b812 ;doc:balance: edits 2025-04-24 09:59:27 -10:00
Simon Michael
78dfe72a92 ;tools: just nightlybin: force push 2025-04-23 22:50:34 -10:00
Simon Michael
8705b935de imp:setup: output tweaks 2025-04-23 22:50:19 -10:00
Simon Michael
b295cce796 ;doc: cleanup 2025-04-23 21:43:45 -10:00
Simon Michael
eec803f19b imp:setup: more setup tests; improve logic, output 2025-04-23 21:43:30 -10:00
Simon Michael
03589e294b lib: make getConf total; add getConf' 2025-04-23 21:43:30 -10:00
Simon Michael
036be45c50 lib: make parseYN(A) total; export findPager 2025-04-23 21:43:30 -10:00
Simon Michael
4788bd9e41 lib: journalCommoditiesUsed 2025-04-23 21:43:30 -10:00
Simon Michael
6cf40a76d1 lib: parseHledgerVersion: also save the package version as text 2025-04-23 11:00:49 -10:00
Simon Michael
cd6288a8eb imp:setup: output tweaks 2025-04-22 19:12:16 -10:00
Simon Michael
b0b081f20d imp:setup: check account type declarations
Begin analysing account type declarations (finally).
Setting up account types when getting started is just a bit too complicated
to be easily understood or easily documented.
Making that easy is one of the goals for the setup command.
2025-04-22 19:02:05 -10:00
Simon Michael
255e79c550 lib: Hledger.Read: more ways to read the default journal
defaultJournalWith, defaultJournalSafely, defaultJournalSafelyWith
2025-04-22 18:50:42 -10:00
Simon Michael
f39b34184e lib: and setup: robust parsing of hledger --version output 2025-04-22 17:02:44 -10:00
Simon Michael
a13b7d2a82 lib: Hledger.Data.Dates.parsedate: also accept YYYYMMDD format; document
- Added support for unseparated dates, for convenience in ghci and for parseHledgerVersion
- Noted two user-facing uses: --value's argument, and import's .latest files.
  YYYYMMDD dates will now also work there. Left this undocumented.
- Noted this is now more permissive, parsing many integers successfully; not expecting problems.
2025-04-22 16:59:57 -10:00
Simon Michael
98b40b2b0e ;dev: fix a warning 2025-04-22 12:26:55 -10:00
Simon Michael
32f2ef9b15 ;doc:queries: fix the explanation of boolean queries and space-separated terms 2025-04-22 12:15:03 -10:00
Simon Michael
b7509030c5 lib: Hledger.Data.Dates: parsedateM -> parsedate
M makes me think of monad and is awkward to type for this common helper; Maybe is expected for a parser.
2025-04-22 10:40:41 -10:00
Simon Michael
2288f5193d fix:setup: refactor, fix a case not returning installed version 2025-04-22 09:06:27 -10:00
Simon Michael
6b5be96d27 imp:setup: improve config file tests, run only when supported 2025-04-22 08:53:43 -10:00
Simon Michael
3e8f3a4506 ;doc:cli:changelog: consistent release headings
just rels now shows more release dates
2025-04-21 18:16:08 -10:00
Simon Michael
4529a8c4a1 imp: setup: smarter logic, more robustness
- Test the hledger in PATH, not the one running
- Handle old hledger versions as well as recent ones
- Handle errors, remove early terminations
2025-04-21 15:31:23 -10:00
Simon Michael
5334e7924b lib: Hledger.Cli.Version: rename PackageVersionString, more helpers 2025-04-21 15:14:12 -10:00
Simon Michael
50a85fc5ca dev: setup: cleanup 2025-04-20 16:13:28 -10:00
Simon Michael
8edef3345e feat: setup command, checks hledger installation (Merge branch 'sm-setup')
Not yet finished, but it's useful and usable so far.
2025-04-20 10:54:26 -10:00
Simon Michael
f0ff2aa34e imp: setup: show full --version output 2025-04-20 10:52:50 -10:00
Simon Michael
c3c91448a7 imp: setup: output tweaks 2025-04-20 10:52:50 -10:00
Simon Michael
a18a4c612d imp: setup: get version from hledger.org, hackage is down 2025-04-20 10:52:50 -10:00
Simon Michael
580bc0a8f8 dev: setup: refactor output helpers 2025-04-20 10:52:50 -10:00
Simon Michael
8b48fc41bc imp: setup: version check: improve error output when unknown 2025-04-20 10:52:50 -10:00
Simon Michael
97e2e8572f imp: setup: version check: add a timeout, improve error output 2025-04-20 10:52:50 -10:00
Simon Michael
15173eeeb0 imp: setup: test default file setup 2025-04-20 10:52:50 -10:00
Simon Michael
f37a4a7dcb lib: refactor, export getHomeSafe 2025-04-20 10:52:50 -10:00
Simon Michael
4881a0deaa ;doc:setup 2025-04-20 10:52:50 -10:00
Simon Michael
75cd521ed7 imp:setup: drop unused options 2025-04-20 10:52:50 -10:00
Simon Michael
2ef7434f47 imp:setup: check files setup (WIP) 2025-04-20 10:52:50 -10:00
Simon Michael
d408f00b42 imp:setup: use HEAD instead of GET to check current version 2025-04-20 10:52:50 -10:00
Simon Michael
98da9709fc imp:setup: config file tests; tidier more portable color-aware output 2025-04-20 10:52:50 -10:00
Simon Michael
bb7510194e imp: setup: setup ignores the config file itself, for robustness 2025-04-20 10:52:50 -10:00
Simon Michael
daf550bbb0 imp: Hledger.Cli.Conf: refactor, expose more info about config files 2025-04-20 10:52:50 -10:00
Simon Michael
320d197735 imp:setup: more hledger setup tests 2025-04-20 10:52:50 -10:00
Simon Michael
525b30b76f pkg: add req, http-client, http-types dependencies; begin HTTP support
hledger can now make HTTP requests over the network.
For now, it makes just one (in following commits):
checking Hackage for the current hledger release version.
2025-04-20 10:52:36 -10:00
Simon Michael
69232cae7a feat: setup: first setup check: is hledger in PATH ? 2025-04-20 10:49:16 -10:00
Simon Michael
cff831c3c0 feat:setup: command skeleton 2025-04-20 10:49:16 -10:00
Simon Michael
c2592ea730 ;doc:csv: fix link 2025-04-20 09:31:01 -10:00
Simon Michael
72f1a14bbd ;doc:csv: clarify CSV means DSV, and link to that instead 2025-04-20 09:26:06 -10:00
Simon Michael
29bca306ee ;doc: print: simplify [#2368] 2025-04-18 18:50:41 -10:00
samahri
6bf9369cda imp: add --location tag to print command [#2368]
;fix: delete hledger-print-location, move doc to Print.hs>"print,other features"
2025-04-18 18:49:34 -10:00
samahri
588cab14f3 imp: add --location tag to print command [#2368] 2025-04-18 18:49:34 -10:00
Simon Michael
f54677f5c0 ;doc: boolean queries: edits 2025-04-18 15:27:00 -10:00
Simon Michael
9dd9a696d4 ;doc: boolean queries: edits 2025-04-18 15:24:47 -10:00
Simon Michael
81238e5f27 feat: any:, all: queries allow more powerful transaction matching 2025-04-18 14:06:45 -10:00
Simon Michael
d13b334fb2 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 16:43:57 -10:00
Simon Michael
b54766c77a ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 16:41:07 -10:00
Simon Michael
5c3197dd42 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 16:29:53 -10:00
Simon Michael
15218a3d56 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 16:25:26 -10:00
Simon Michael
404edc3afd ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 16:05:51 -10:00
Simon Michael
ee3bd28711 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 10:32:50 -10:00
Simon Michael
bcc8471966 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 10:29:28 -10:00
Simon Michael
6aa072e1a4 ;doc:csv: How CSV rules are evaluated: clarify 2025-04-16 10:16:28 -10:00
Simon Michael
df5d14628a ;doc:cli: adjust source to avoid disrupting markdown-mode outline 2025-04-16 08:40:58 -10:00
Simon Michael
d7a98d4c15 ;examples: a copy of the quickstart journal from the home page 2025-04-12 22:27:15 -10:00
Simon Michael
da32e4f9a9 ;examples:i18n: add no, se 2025-04-12 22:26:53 -10:00
Simon Michael
c8706d376c ;examples:i18n: readme 2025-04-12 21:43:27 -10:00
Simon Michael
84c4975271 ;examples:i18n: new translations of the top level account declarations
Files named by language code, add comments, add equity:conversion
account, new translations by google gemini 2.5 pro, add arabic,
german, spanish.
2025-04-12 21:32:54 -10:00
Simon Michael
57b13dab73 ;doc:cli: fix hledger-iadd link 2025-04-12 14:33:15 -10:00
Simon Michael
95c99be616 ;doc:dev: move github topic links here 2025-04-12 10:55:47 -10:00
Simon Michael
936739340a ;doc: bin: hledger-sankeymatic 2025-04-11 09:07:24 -10:00
Simon Michael
9340b73aae imp: improve/format errors for various failures [#2367]
These now call error' and show errors in the standard style:

- reading a nonexistent data file
- reading an unsafe dotted file name on windows
- web: using --socket on windows
- demo: demo not found
- demo: error while running asciinema
- diff: bad arguments
- print --match: no match found
- register --match: no match found
- roi: no investment transactions found
2025-04-11 08:06:47 -10:00
Simon Michael
454c669fe4 fix:cli,ui,web: consistent console error output independent of GHC version [#2367]
Hledger.Utils.IO helpers have been updated and new ones have been
added (exitOnExceptions, exitWithError) to allow consistent display of
program errors whether compiled with GHC <9.10, GHC 9.10, or GHC >9.10.
The trailing newlines added by GHC 9.10 are gone,
and so is the "uncaught exception" output added by GHC 9.12.
2025-04-11 08:06:47 -10:00
Simon Michael
21ad2a41a7 ;tools:Justfile: simplify STACK defs 2025-04-09 18:16:53 -10:00
Simon Michael
50e0405031 ;tools: silence ghci warning if user has defined :rmain 2025-04-09 18:16:24 -10:00
Simon Michael
9b6d3da677 ;cabal: update cabal files 2025-04-09 10:58:54 -10:00
Simon Michael
ee3b6c29ce ;pkg: allow ghc 9.12 2025-04-09 10:58:52 -10:00
Simon Michael
f8f9892840 ;pkg: update stack yaml deps 2025-04-09 10:58:52 -10:00
Simon Michael
01c1f3c8a5 ;pkg: simplify stack yaml file names 2025-04-09 10:58:52 -10:00
Simon Michael
bc16552e5d ;doc:csv:encoding: add hledger version info 2025-04-08 19:30:59 -10:00
Simon Michael
e57764f676 ;doc: beancount output: edits 2025-04-05 03:43:29 -10:00
Simon Michael
8b771e87d2 ;examples: forecast-budget* -> goal-budget* 2025-04-04 10:00:47 -10:00
Simon Michael
ed12a057c0 ;doc:FILES: link fixes 2025-04-04 07:54:03 -10:00
Simon Michael
70f2f77f04 ;doc:FILES: simplify a little 2025-04-04 07:48:16 -10:00
Simon Michael
8bd2b8159b ;doc:FINANCE: expand financial reports link 2025-04-04 07:48:16 -10:00
Michael Rees
62071bc4c2 feat: timeclock: Add support for multiple clocked in sessions (#2141)
We now support having multiple sessions clocked in. These are paired by
account name if given on the out entry, and otherwise an out closes the
most recent in entry.

Note that this breaks some backwards compatibility, in that we
previously ignored the description on the clock out entry. To mitigate
this, a new hidden flag --timeclock-old has been added, which reverts to
the old behavior.
2025-04-03 11:19:18 -10:00
Simon Michael
3c9edcdd34 ;doc:ISSUES: simplify user pain score again 2025-04-02 15:08:36 -10:00
Simon Michael
e03f4ca076 ;doc:ui: edits 2025-04-02 14:54:53 -10:00
Simon Michael
761b66b00c ;doc:ui: edits 2025-04-02 14:48:41 -10:00
Simon Michael
cbdbaf114d ;doc:ISSUES: edits 2025-04-02 14:39:48 -10:00
Simon Michael
49c9444148 ;doc:manuals: simplify bug reporting boilerplate 2025-04-02 14:35:17 -10:00
Simon Michael
359307ed4b ;doc:ui: another --watch tip 2025-04-02 14:33:55 -10:00
Simon Michael
d57f7e67c4 ;doc:ISSUES: links 2025-04-02 14:26:39 -10:00
Simon Michael
1ed3635836 ;doc:ui: update --watch bug notes 2025-04-02 14:09:28 -10:00
Simon Michael
cf03f7e428 fix:ui: require fsnotify-0.4.2.0+, detecting events more reliably on mac
This requires hfsevents-0.1.8 which fixes some events being ignored on
mac (https://github.com/luite/hfsevents/pull/19), possibly making
hledger-ui --watch more reliable in that regard.
2025-04-02 13:22:19 -10:00
Simon Michael
666abefba9 ;pkg:stack: bump all to 2025-04-01 snapshot
This also bumps to fsnotify-0.4.2.0 and hfsevents-0.1.8, fixing some
events being ignored on mac (https://github.com/luite/hfsevents/pull/19),
which could make hledger-ui --watch more reliable (though I haven't
noticed that problem).
2025-04-02 13:20:03 -10:00
Simon Michael
512893701c ;doc:ISSUES: links 2025-04-02 10:42:15 -10:00
Simon Michael
3ed03a94b3 ;doc:ISSUES: notes 2025-04-02 10:31:37 -10:00
Simon Michael
b8f250bf7d ;doc:ISSUES: notes 2025-04-02 10:15:51 -10:00
Simon Michael
683c35b8de ;doc:ISSUES: cleanup 2025-04-02 09:38:33 -10:00
Simon Michael
642bf00ddc ;doc:ISSUES: edits 2025-04-01 18:51:23 -10:00
Simon Michael
cb91bf2043 ;doc:ISSUES: links 2025-04-01 18:27:04 -10:00
Simon Michael
9642f1ab54 ;doc:ISSUES: links 2025-04-01 18:23:37 -10:00
Simon Michael
1b33250f78 ;doc:ISSUES: links 2025-04-01 18:09:41 -10:00
Simon Michael
e034bf2b92 ;doc:ISSUES: links 2025-04-01 18:07:59 -10:00
Simon Michael
1ecb377d47 ;doc:ISSUES: severity* labels -> annoyance* 2025-04-01 16:17:52 -10:00
Simon Michael
a3d1859c7b ;doc:ISSUES: impact* labels -> affects*; update label descriptions 2025-04-01 15:53:49 -10:00
Simon Michael
14bd195f5d ;doc:ISSUES: link updates 2025-04-01 15:29:36 -10:00
Simon Michael
f698b87690 ;doc:ISSUES: cleanup 2025-04-01 14:55:10 -10:00
Simon Michael
b2c70e262a ;doc:ISSUES: more links 2025-04-01 14:53:24 -10:00
Simon Michael
93853819e2 ;doc:ISSUES: more links 2025-04-01 14:49:57 -10:00
Simon Michael
d081c8de92 ;doc:ISSUES: update links 2025-04-01 14:18:09 -10:00
Simon Michael
1cdc3298bc ;doc:ISSUES: update links 2025-04-01 14:16:40 -10:00
Simon Michael
2ff2fd1594 ;pkg: simplify LICENSE (try to fix github license detection) 2025-03-31 19:12:38 -10:00
Simon Michael
fb584e7e8b ;pkg: simplify LICENSE, add AUTHORS.md (try to fix github license detection) 2025-03-31 19:05:19 -10:00
Simon Michael
0dfd3e59b6 ;pkg: drop possibly github-confusing license file 2025-03-31 19:04:14 -10:00
Simon Michael
4535796d94 ;pkg: drop unused 2012 ledger parsing code
and possibly github-confusing license file
2025-03-31 19:04:14 -10:00
Simon Michael
18bad4ff8d ;doc: FUNDING.yml: hide patreon for now 2025-03-31 18:26:12 -10:00
Simon Michael
20226283b8 ;pkg: tweak LICENSE files, try to get github to recognise 2025-03-31 18:18:10 -10:00
Simon Michael
47bb40f838 ;pkg: clean up LICENSE files, main module licensing headers 2025-03-31 18:10:19 -10:00
Simon Michael
8d1a8d3799 ;cabal: update cabal files 2025-03-31 17:40:30 -10:00
Simon Michael
ed6cef5c00 ;pkg: clean up package.yaml files
Consistent layout.
Group metadata at the top in similar order to `cabal format`.
2025-03-31 17:25:41 -10:00
Simon Michael
775507c2d4 ;pkg:cabal: specify GPLv3+ exactly; require cabal 2.2+ [#2359]
Previously our cabal files used cabal-version 1.12, and were in theory
buildable with any ancient version of cabal.  Now at least cabal 2.2
(or a version of stack built with with similar Cabal version) is
required to build hledger.
2025-03-31 16:55:36 -10:00
Simon Michael
b6ec245647 ;cabal: update cabal files 2025-03-31 16:33:50 -10:00
Simon Michael
cb6a9b2f97 ;pkg:cabal: update tested-with in all package.yamls 2025-03-31 16:27:40 -10:00
Thomas Miedema
bc42f79c77 ;dev: remove base-compat from stack*.yaml 2025-03-31 16:21:38 -10:00
Thomas Miedema
e7cc2f1066 ;dev: lib: drop base-compat dependency 2025-03-31 16:21:38 -10:00
Thomas Miedema
c565dbc4f6 ;dev: web: drop base-compat dependency 2025-03-31 16:21:38 -10:00
Thomas Miedema
4d5ff3fe4e ;dev: make doctest happy on ghc-8.10.7 2025-03-31 16:18:09 -10:00
Thomas Miedema
c41588c5cd ;dev: fixup hledger-ui.cabal 2025-03-31 16:18:09 -10:00
Thomas Miedema
bf3d1b6b49 ;dev: extra >= 1.7.11 is required
Commit ff28aa32 introduced usage of Data.List.Extra.groupOnKey, which
first came with extra-1.7.11.

Fixes stack8.10.yaml build hopefully.
2025-03-31 16:18:09 -10:00
Simon Michael
fa4dbf45af ;doc:csv:encoding: edits [#2354] 2025-03-30 10:09:45 -10:00
Simon Michael
b75f0ebd00 ;fix:doc:csv:encoding: list accurate canonical encoding names [#2354]
see also https://github.com/dmwit/encoding/issues/28
2025-03-30 10:02:59 -10:00
Simon Michael
5a541420ad ;doc: REGRESSIONS 2025-03-26 10:24:35 -10:00
Simon Michael
6122366af1 ;doc:Commands: fix commands link in TOC 2025-03-13 11:52:32 -10:00
Simon Michael
9521fead17 ;doc:Commands: add run, repl, commands to TOC 2025-03-13 11:47:26 -10:00
Simon Michael
2a45cfa27b ;doc: fix update csv tutorial link 2025-03-13 11:16:39 -10:00
Simon Michael
81061af552 ;doc: updates 2025-03-13 10:48:24 -10:00
Simon Michael
177c26cdc6 ;doc:ui: drop obsolete Windows non-support info 2025-03-13 10:47:33 -10:00
Simon Michael
ff21992f74 ;pkg:sandstorm: note icon todo; fix capitalisation 2025-03-13 08:25:12 -10:00
Simon Michael
72f505f8ea ;doc:RELEASING 2025-03-12 22:21:33 -10:00
Simon Michael
8768038ff3 ;pkg: hledger-install: update 2025-03-12 21:35:24 -10:00
Simon Michael
d49d825fc0 ;doc:relnotes: 1.42.1; 1.42 fixes 2025-03-12 21:35:24 -10:00
Simon Michael
efff1cfdb5 ;doc: finalise changelogs for 1.42.1 on 2025-03-12 2025-03-12 21:35:24 -10:00
Simon Michael
be1e921dca ;doc: update changelogs 2025-03-12 21:35:24 -10:00
Stephen Morgan
8474c811c5 imp run: More successful cache hits with forecast
If forecast start and end dates are explicitly requested with
--forecast=, those parts of the reportspan_ can be replaced with the
forecast dates, meaning more successful cache hits.
2025-03-12 20:47:17 -10:00
Simon Michael
133560aa93 ;dev: csv: no need to test for unsupported feature [#2352] 2025-03-12 20:40:36 -10:00
Thomas Miedema
a8a0d3ee30 fix: csv: fix regression in parsing rules containing & (#2352) 2025-03-12 20:35:59 -10:00
Simon Michael
5d4631bfda ;doc: REGRESSIONS 2025-03-11 10:15:09 -10:00
Simon Michael
f461962a84 ;doc: REGRESSIONS 2025-03-11 10:12:27 -10:00
Simon Michael
3a460419bf ;doc: REGRESSIONS 2025-03-11 10:09:51 -10:00
Simon Michael
9c880a5d73 ;pkg:ui: allow vty 6.4 2025-03-09 08:17:02 -10:00
Simon Michael
6f17d133dd ;imp:cli: improve help for --pretty 2025-03-09 08:16:38 -10:00
Simon Michael
6d47530ebc ;imp:cli: improve help for mutually exclusive valuation flags 2025-03-09 08:16:38 -10:00
Simon Michael
3d920ce749 ;doc:ghnightly: fix changes link 2025-03-08 14:12:45 -10:00
Simon Michael
dbb85e3a9f ;doc:balance: "types" -> "modes" 2025-03-08 13:09:02 -10:00
Simon Michael
dcd5221489 ;doc: update embedded manuals 2025-03-08 12:46:13 -10:00
Simon Michael
b31091195b ;doc: update command docs 2025-03-08 12:44:57 -10:00
Simon Michael
02ef6e45e7 imp:cli: make mutually exclusive flags clearer in --help 2025-03-08 12:42:16 -10:00
Simon Michael
7aae0d9595 imp:web: add an explicit --serve-browse flag, for consistency 2025-03-08 12:41:03 -10:00
Simon Michael
2f0cb50997 imp!:web: deprecate and hide the --server flag, recommend --serve 2025-03-08 11:57:01 -10:00
Simon Michael
a0afda4a2b ;doc:options: mention mutually exclusive flags 2025-03-08 11:20:21 -10:00
Simon Michael
58a8586cea ;tools: add nightlybin, ghnightly-bin; rename some related recipes
The "nightly" tag now moves when new nightly binaries are built.
2025-03-08 10:37:42 -10:00
Dmitry Astapov
8b9644be96 script:balance-as-budget-multi.hs
Like balance-as-budged, but many times
2025-03-08 09:57:38 -10:00
Simon Michael
da5fb7b110 ;tools: ghrel, ghnightly, ghrun, ghruns to browse those things 2025-03-08 09:56:34 -10:00
Dmitry Astapov
9963a01a15 run: do not pre-load journal(s) at the start of "run" [#2345]
wait for the first command to do this. Same for "repl"
2025-03-08 09:55:59 -10:00
Dmitry Astapov
c0b3c932ea ;run: --forecast with changed reporting interval fix (+test) [#2345] 2025-03-08 09:55:59 -10:00
Simon Michael
542d1802ee ;doc:ghrelnotes: mention eget 2025-03-08 09:40:44 -10:00
Simon Michael
57bbf87d4e ;tools: ghnightlynotes-push: updates description of "nightly" prerelease 2025-03-08 09:39:55 -10:00
Simon Michael
966748b2e0 ;tools: binaries, nightly, nightlytag 2025-03-08 09:14:35 -10:00
Simon Michael
307c679d23 ;workflows:nightly: upload to the prerelease with "nightly" tag 2025-03-08 08:50:27 -10:00
Simon Michael
7c78fec64e ;tools: ghruns-download, ghrelease-upload: improvements 2025-03-08 08:09:49 -10:00
Simon Michael
49341de786 ;tools:ghrelease-upload: fix 2025-03-08 07:12:24 -10:00
Simon Michael
bcb3bf5837 ;workflows: nightly: start a manual workflow for updating the prerelease 2025-03-08 07:11:43 -10:00
Simon Michael
918826fc76 ;doc:ghrelnotes: tweaks 2025-03-08 06:43:27 -10:00
Simon Michael
52d99ee1eb ;doc: update embedded manuals 2025-03-07 22:03:32 -10:00
Simon Michael
054e9561e4 ;doc: update command docs 2025-03-07 22:03:09 -10:00
Simon Michael
44a4b79fa4 ;doc:run, repl: more edits 2025-03-07 22:02:14 -10:00
Simon Michael
e53191049f ;doc: update embedded manuals 2025-03-07 21:38:14 -10:00
Simon Michael
f153d7f707 ;doc: update command docs 2025-03-07 21:38:10 -10:00
Pranesh Prakash
2369f1338a ;doc:repl: updates
Corrected one small mistake, and changed a few other things for clarity.

Applied changes to the right file (Repl.md) this time.
2025-03-07 21:35:44 -10:00
Simon Michael
2274ea6ad6 ;doc:changelogs, relnotes: fix 2025-03-07 21:32:08 -10:00
Simon Michael
b776eddff7 ;doc:relnotes: cleanups 2025-03-07 21:27:01 -10:00
Simon Michael
f7aec96db1 ;doc:changelogs: cleanups 2025-03-07 21:22:19 -10:00
Simon Michael
e0abb766dc ;doc:RELEASING: cleanup 2025-03-07 21:22:12 -10:00
Simon Michael
25d4fc6636 ;tools: just devtag-push 2025-03-07 20:44:07 -10:00
Simon Michael
b19807571d ;doc: doc-update diagram: updates 2025-03-07 20:37:51 -10:00
Simon Michael
ff966d37fb ;doc:RELEASING: cleanup 2025-03-07 20:37:32 -10:00
Simon Michael
a7c7e6a290 ;doc:RELEASING: process updates 2025-03-07 19:09:51 -10:00
Simon Michael
b9cd9981f7 ;doc: update embedded manuals 2025-03-07 18:49:13 -10:00
Simon Michael
4e5506da1e ;cabal: update cabal files 2025-03-07 18:49:08 -10:00
Simon Michael
10c523c057 ;pkg: set version to 1.42.99 2025-03-07 18:49:07 -10:00
Simon Michael
f57b317a17 ;dev: gitignore 2025-03-07 18:46:24 -10:00
Simon Michael
dd614c0a16 ;doc: start new doc process diagrams 2025-03-07 18:45:18 -10:00
Simon Michael
39505f4e38 ;doc:relnotes: fix run/repl wording 2025-03-07 18:30:30 -10:00
Simon Michael
554b50f5b2 ;doc:changelog: fix run/repl wording 2025-03-07 18:27:21 -10:00
Simon Michael
d06d1f5ba0 ;bin:bashrc: more command aliases 2025-03-07 18:26:59 -10:00
Simon Michael
f634616e20 ;tools: ghrelnotes-push: don't set the release to draft mode
Note, this might also create a non-draft release on first run.
2025-03-07 18:19:23 -10:00
Simon Michael
8632b05ac1 ;doc:ghrelnotes: fix/update binary install instructions for unix tarballs
From release 1.42, the unix binaries come as tar.gz files.
2025-03-07 18:14:45 -10:00
Simon Michael
2e5e625105 ;tools: ghrelnotes-push, ghrun-id, ghrun-open, ghruns-open, ghruns-download, ghrelease-upload 2025-03-07 17:44:23 -10:00
Simon Michael
21de051ca5 ;doc: announcement: update 2025-03-07 17:44:23 -10:00
Pranesh Prakash
402494afe0 ;docs:README.md
Corrected a typo.
2025-03-07 13:40:22 -10:00
Pranesh Prakash
fc2aabaab3 ;doc:repl: updates
Corrected one small mistake, and changed a few other things for clarity.
2025-03-07 13:35:26 -10:00
Simon Michael
5109a9682f ;tools: fix cabalfilestest; test cabal files before any hackage upload 2025-03-07 07:55:02 -10:00
Simon Michael
41e5a538b1 ;pkg: clean up other cabal files, separating unrelated ghc options 2025-03-07 07:54:57 -10:00
Simon Michael
a953120fbf fix:web: fix a cabal file ghc-options issue that hackage now rejects 2025-03-07 07:54:00 -10:00
Simon Michael
96fea6cf5e ;doc: announcements: 1.42 2025-03-07 06:37:29 -10:00
Simon Michael
5a7abeabe0 ;pkg:hledger-install: bump to 1.42 2025-03-07 06:37:21 -10:00
Simon Michael
e19ef2de42 ;pkg: bump stack snapshots 2025-03-07 06:37:15 -10:00
Simon Michael
d024ff9d89 ;doc:relnotes 2025-03-07 06:37:11 -10:00
Simon Michael
fd0bcdfede ;doc: finalise changelogs for 1.42 on 2025-03-06 2025-03-07 06:36:53 -10:00
Simon Michael
8184d20b9f ;doc: update changelogs 2025-03-07 06:36:15 -10:00
Simon Michael
7a3f69c5a1 ;doc:repl: updates 2025-03-06 19:45:55 -10:00
Dmitry Astapov
a3d2c7bb58 ;run: test that demonstrates caching 2025-03-06 16:43:39 -10:00
Simon Michael
a0cf410a80 ;doc:run, repl: updates 2025-03-06 16:36:54 -10:00
Simon Michael
d65cdbef27 ;doc: update embedded manuals 2025-03-06 16:15:22 -10:00
Simon Michael
3d1994ea76 ;doc: add commands, repl, run to Commands section 2025-03-06 16:15:22 -10:00
Simon Michael
e25cd526b7 ;doc: update embedded manuals 2025-03-06 16:05:55 -10:00
Simon Michael
0cd86d959e ;doc: update command docs 2025-03-06 16:05:25 -10:00
Simon Michael
cdbbe40e5b ;doc:run, repl: updates and edits 2025-03-06 16:03:55 -10:00
Simon Michael
e9f1e7dbd4 ;doc:demo: mark experimental 2025-03-06 16:03:29 -10:00
Simon Michael
12000baf19 ;dev: number run tests 2025-03-06 14:09:38 -10:00
Simon Michael
ebf8d25a49 imp:cli: commands list tweaks 2025-03-06 13:58:24 -10:00
Simon Michael
cf81b042be imp:run,repl: allow running addon commands 2025-03-06 13:56:43 -10:00
Simon Michael
a1a6aad873 fix:repl: also catch IO errors like run nosuchfile
And print exceptions consistently, with a single newline.
2025-03-06 13:05:45 -10:00
Simon Michael
9ecc3a56d0 fix:repl: make the run command work in the REPL again
The now-required -- argument was being lost during REPL parsing.
I think this is right, though it's hard to understand.
2025-03-06 13:03:57 -10:00
Simon Michael
fd906bec95 ;dev:cli: debug output tweaks; moveFlagsAfterCommand doc edit 2025-03-06 11:56:21 -10:00
Dmitry Astapov
758335daf0 run: support --man, --info, --tldr 2025-03-06 11:54:00 -10:00
Dmitry Astapov
7fdb2f7fe6 ;run: use leading -- to decide whether to read from files or not 2025-03-06 11:54:00 -10:00
Dmitry Astapov
4dbeac284c ;run: refuse to read commands from stdin if one of the input files was - 2025-03-06 11:54:00 -10:00
Dmitry Astapov
9c63b36d88 ;run: require -- before first command (+test for that) 2025-03-06 11:54:00 -10:00
Dmitry Astapov
b031144961 run: added run.test 2025-03-06 11:54:00 -10:00
Dmitry Astapov
6766498f42 run: can re-read stdin, if needed 2025-03-06 11:54:00 -10:00
Dmitry Astapov
df0cd78b26 ;run: more robust terminal check 2025-03-06 11:54:00 -10:00
Dmitry Astapov
e4cfd31544 ;run: add leading -- to short cmdline help 2025-03-06 11:54:00 -10:00
Dmitry Astapov
c354e6e9f7 ;run: don't exit repl when subcommand exits 2025-03-06 11:54:00 -10:00
Dmitry Astapov
4aa79cdc53 ;run: added Repl.txt to package.yaml 2025-03-06 11:54:00 -10:00
Dmitry Astapov
22155e2bae run: make sure that reporting interval does not affect caching 2025-03-06 11:54:00 -10:00
Dmitry Astapov
cffceb0d06 ;run: fix stale comments 2025-03-06 11:54:00 -10:00
Dmitry Astapov
1fc7006919 run: cache input files by (iopts, name), allows commands with different iopts 2025-03-06 11:54:00 -10:00
Dmitry Astapov
d3d3e02f9e ;run: another typo fixed 2025-03-06 11:54:00 -10:00
Dmitry Astapov
4ad3d00864 ;doc: run & repl: typos fixed, you can pipe into run 2025-03-06 11:54:00 -10:00
Dmitry Astapov
4a08f975f6 ;run,repl: dont print unrecognized text, error out 2025-03-06 11:54:00 -10:00
Dmitry Astapov
ef6b6ecc1b ;run: accept commands on stdin, repl hides prompt when non-interactive 2025-03-06 11:54:00 -10:00
Dmitry Astapov
2f348f787b ;repl: dont stop on exceptions 2025-03-06 11:54:00 -10:00
Dmitry Astapov
2ba12d6ec5 ;repl: fixed layout in command list 2025-03-06 11:54:00 -10:00
Dmitry Astapov
d615865d4d ;run: reword the quoting passage in docs 2025-03-06 11:54:00 -10:00
Dmitry Astapov
4f9fff9e81 ;repl: added to the list in Commands.hs 2025-03-06 11:54:00 -10:00
Dmitry Astapov
61faca16e4 run: split run and repl, fix journal passed to nested "run"s 2025-03-06 11:54:00 -10:00
Dmitry Astapov
a7116a8b0f ;run: missed a spot for replaceNumericFlags 2025-03-06 11:54:00 -10:00
Dmitry Astapov
e67bef1b0c ;run: expand docs (nested run, more examples) 2025-03-06 11:54:00 -10:00
Dmitry Astapov
b5f5c39d48 run: properly retrieve cached files when there are nested "run"s 2025-03-06 11:54:00 -10:00
Dmitry Astapov
e665bf124d ;run: handle reader prefixes properly 2025-03-06 11:54:00 -10:00
Dmitry Astapov
a76d23957f ;run: fix typo in the REPL help message 2025-03-06 11:54:00 -10:00
Dmitry Astapov
cf05ccb8e4 ;run: comments 2025-03-06 11:54:00 -10:00
Dmitry Astapov
8431cbe95b run: do not try to cache "top-level" journal more than once 2025-03-06 11:54:00 -10:00
Dmitry Astapov
5bd9be2189 run: allow "run" to invoke "run" (fixes #2331) 2025-03-06 11:54:00 -10:00
Dmitry Astapov
88a4b0abae run: support @ARGFILEs (fixes #2330) 2025-03-06 11:54:00 -10:00
Dmitry Astapov
6569714d37 run: cache individual files rather than file groups 2025-03-06 11:54:00 -10:00
Dmitry Astapov
32f286cc35 run: cache all journal files, allow commands to use -f 2025-03-06 11:54:00 -10:00
Simon Michael
aee85df17b ;dev:cli: to help run's command line parsing, double the first -- [#2328]
So that when cmdargs eats it, another remains.
2025-03-06 09:56:25 -10:00
Simon Michael
0b20e11857 ;dev:moveFlagsAfterCommand: doc edits 2025-03-06 07:53:05 -10:00
Simon Michael
e6bf705de0 fix:moveFlagsAfterCommand: don't rearrange things after -- [#2328]
Helps the run command.
2025-03-06 07:25:48 -10:00
Simon Michael
40b40fc2c8 ;dev:moveFlagsAfterCommand: note a problem [#2328] 2025-03-06 06:56:34 -10:00
Simon Michael
d47107ab7a ;dev:readJournal: doc 2025-03-06 05:39:23 -10:00
Simon Michael
874771d47c dev:readJournal: assume default file name "-" rather than "(string)" [#2328]
"-" implies data from standard input so "string" is perhaps more
correct, but I think this is a harmless simplification and it
makes `files` output consistent when run by `run`.
2025-03-06 05:13:37 -10:00
Simon Michael
3bfaa56dfb ;ci: binaries-linux-x64-stack: try to fix build; upgrade to latest stack 2025-03-05 18:52:59 -10:00
Simon Michael
5394b70dff ;ci: binaries-linux-x64-stack: fix 2025-03-05 18:28:43 -10:00
Simon Michael
20c612d0b2 ;fix:ci: add the man pages and info manuals to the unix bindists [#2309] 2025-03-05 18:21:31 -10:00
Simon Michael
45374cbfd4 ;ci: cleanups 2025-03-05 17:54:04 -10:00
Simon Michael
58c277123e ;ci: cleanups 2025-03-05 17:36:43 -10:00
Simon Michael
d883a74fe0 ;tools:just: showrelnotes 2025-03-05 16:59:14 -10:00
Simon Michael
f1c5772204 ;dev: gitignore cleanup 2025-03-05 16:59:14 -10:00
Simon Michael
a1de9148f2 ;examples: 2025-03-05 16:19:29 -10:00
Simon Michael
f97954a796 dev:commands: don't require a journal file 2025-03-05 11:37:25 -10:00
Simon Michael
4eb98a761a ;doc: update command docs 2025-03-05 11:10:49 -10:00
Simon Michael
34ba84ff9c feat: commands, an explicit command to show the commands list; refactor 2025-03-05 11:10:42 -10:00
Simon Michael
25edf03495 ;cabal: update cabal files 2025-03-04 17:06:53 -10:00
Simon Michael
cb373447db fix:cli:paging: support older less, don't pass --use-color [#2335]
Older less versions (eg 551) require --use-colour, and break if --use-color is passed. So we no longer attempt to enable colour in less by default.
2025-03-04 16:38:25 -10:00
gesh
f450379229 ;cln: Remove unused widthFromOpts (see 5c289ac)
As noted in 5c289ac, it is unused elsewhere, and registerWidthsFromOpts
is right next to it and implements nearly the exact same logic
2025-03-04 16:26:15 -10:00
gesh
a1bcdcd157 ;cln: Remove unused debugArgs
A variant of it is present as a local definition in getHledgerCliOpts'
2025-03-04 16:26:15 -10:00
Simon Michael
11ff329a8e ;pkg:ui: allow vty 6.3 2025-03-01 14:40:30 -10:00
Simon Michael
e43156ddf3 ;examples: update report scripts ahead of planned change 2025-03-01 11:23:21 -10:00
Simon Michael
6a90d503bc ;doc: csv: tiny fix [#2333] 2025-03-01 11:22:38 -10:00
Thomas Miedema
2faceb8e1b feat: csv: allow multiple matchers on the same line
`If blocks` and `If tables` now allow multiple matchers on the same line
separated by `&&` (AND) or `&& !` (AND NOT).

Example `if block` with two matchers on the same line:

	if %description amazon && %date 2025-02-22
	    account2 expenses:books

Example `if table` with two matchers on the same line:

	if,account2
	%description amazon && %date 2025-02-22, expenses:books
2025-03-01 11:21:00 -10:00
Simon Michael
0d98dd1351 ;bin:hledger-jj: updates 2025-02-27 22:26:07 -10:00
Simon Michael
d8e190e576 ;bin:hledger-jj: updates 2025-02-27 21:56:11 -10:00
Simon Michael
ebc6f06eef ;bin:readme: edits 2025-02-27 21:45:17 -10:00
Simon Michael
76114385e7 ;bin: edits 2025-02-27 21:40:17 -10:00
Simon Michael
f34a0d6248 ;feat:bin: hledger-jj, another VCS CLI using newer tech (jj, ysh) 2025-02-27 21:27:58 -10:00
Simon Michael
a65900c62d imp:cli: recognise .ysh, .osh file extensions as addons 2025-02-27 21:26:57 -10:00
Simon Michael
97f831f741 ;bin:hledger-git: run pass-through commands in the right repo 2025-02-27 17:10:44 -10:00
Simon Michael
956a2f6565 ;doc: manuals: update command options 2025-02-27 15:26:17 -10:00
Simon Michael
b629c31f9a ;doc: manuals: remove obsolete mentions of COLUMNS [#2340] 2025-02-27 15:26:17 -10:00
Simon Michael
d346e56b79 dev: fix warnings, update yaml file, edit [#2340] 2025-02-27 13:41:48 -10:00
gesh
3fa39c17b3 dev: Remove usage of partial NE.fromList
At this point, we're just giving a default for unpacking a Maybe
2025-02-27 13:41:48 -10:00
gesh
cde77eace0 fix: Remove references to $COLUMNS
As noted in Hledger.Utils.IO, COLUMNS is a bashism that isn't
particularly usable for our purposes (for one thing, it isn't updated
when the terminal is resized)
2025-02-27 13:41:48 -10:00
gesh
a24c39f13f fix: Use POSIX API to compute tty width (#2332)
On some systems, TERM is set to a value that doesn't have a valid
terminfo entry. Rather than hackily fall back on a value for TERM that
appears to work in most contexts (TERM=dumb) but which isn't guaranteed
anywhere to be valid, use proper POSIX ioctls to get the tty width.

This has the added bonus of also working on Windows.

In fact, we already settled on computing the terminal size in this way
in hledger-lib, so this commit centralizes the choice of the logic
there.

Also added a note for alternative methods and their tradeoffs, in case
this turns out to be fragile on some systems.
2025-02-27 13:41:48 -10:00
Thomas Miedema
1ca90065db ;dev: fix hledger/bench/bench.hs
In commit 603b2e9f09, the signature of `readJournalFile` changed. Ever
since, `bench/bench.hs` did not compile. Fix it by using the "easy"
function `readJournalFile'` instead, which assumes default options and
returns in the IO monad.
2025-02-27 07:32:44 -10:00
Thomas Miedema
3392176993 ;dev: update bench*.sh files
Since commit 4c7abc3d2f, `just samplejournals` creates sample journals
in the examples/ directory with a different naming scheme (e.g.
`1ktxns-1kaccts.journal` instead of `1000x1000x10.journal`). Reflect
this change in the bench*.sh files. Also fix `just bench-throughput`.
2025-02-27 07:32:44 -10:00
Thomas Miedema
5129a94bd7
;cln: unittest.hs: remove bothersome PackageImports (#2337)
When running `cd hledger-lib && ghci test/unittest.hs`, ghci complains
with:

```
  test/unittest.hs:7:1: error:
      Could not find module ‘Hledger’
      It is not a module in the current program, or in any known package.
    |
  7 | import "hledger-lib" Hledger (tests_Hledger)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Failed, no modules loaded.
```

This commit removes the "hledger-lib" package-qualified import, such
that above ghci command works as expected.

However, there is a comment in hledger-lib/test/unittest.hs that says:

> package-qualified import to avoid cabal missing-home-modules warning
> (and double-building ?)

The missing-home-modules warning and the double building can indeed be
reproduced by running (after removing the "hledger-lib"
package-qualified import): `cd hledger-lib && cabal build unittest`. It
will first build `hledger-lib`, then show a warning about
missing-home-modules, and then build `hledger-lib` again.

After comparing the unittest sections of hledger.cabal and
hledger-lib.cabal, the solution turned out to be to remove `./` from
hs-source-dirs for unittest. Don't ask me why though!

Overall it's a nice cleanup.
2025-02-26 11:54:59 -10:00
Simon Michael
f288a7d801 ;dev: ignores 2025-02-25 10:59:12 -10:00
Simon Michael
d807d7bd0c ;imp:bal: improve --layout option description 2025-02-23 12:25:48 -10:00
Simon Michael
d4884def4b ;doc:shell completions: mention zsh; cleanups 2025-02-21 17:16:40 -10:00
Simon Michael
afd6540b63 ;tools:just: generate module, package diagrams 2025-02-18 13:12:54 -10:00
Simon Michael
7ef96d4bd1 fix:bal --budget: don't let costs prevent showing a percentage [#2327] 2025-02-18 12:17:47 -10:00
Simon Michael
a882268dd8 ;doc:dev: updates, cleanups 2025-02-18 00:10:02 -10:00
Simon Michael
ce1c399ef1 ;doc:dev: star history 2025-02-17 23:43:06 -10:00
Simon Michael
f3a23e406d ;doc: ACHIEVEMENTS 2025-02-17 23:40:56 -10:00
Simon Michael
40461910c4 ;doc:dev: update stars rank 2025-02-17 23:17:30 -10:00
Simon Michael
daf8301ade ;pkg:stack: drop obsolete systemencoding flag [#2319] 2025-02-16 07:19:09 -10:00
Simon Michael
75c0197c08 pkg:stack: use latest snapshots 2025-02-15 15:22:33 -10:00
Simon Michael
cf198652f9 pkg:ui: allow brick 2.8 2025-02-15 15:22:33 -10:00
Simon Michael
35df9576ec doc:text encoding, csv encoding: cleanups [#2319] 2025-02-15 14:49:00 -10:00
Simon Michael
cdf6ce072d ;examples: test files for CSV encoding [#2319] 2025-02-15 14:48:30 -10:00
Joschua Kesper
5114962b2a feat:csv: add an encoding rule, allowing non-UTF8 CSV to be read [#2319]
Previously, hledger could read CSV files containing non-ascii
characters only if they are UTF8-encoded.  Now there is a new CSV
rule, encoding ENCODING, which allows reading CSV files with other
encodings.

This adds a dependency on the encoding library, which supports fewer
encodings than text-icu but does not require a third-party C library.
To avoid build issues on various platforms, we require version 0.10+.

This adds some use of the ImplicitParams language extension, required
by encoding's API, but only in a small code region.

This also changes the type of Reader's rReadFn; it now takes
a `Handle` rather than a `Text`, allowing more flexibility.
2025-02-15 14:48:30 -10:00
Simon Michael
d68a832d1c ;examples: some sample hledger run scripts 2025-02-13 16:21:14 -10:00
Dmitry Astapov
d84050ec05
feat:run: run multiple commands efficiently, as a script or at a REPL (Dmitry Astapov, #2323) 2025-02-13 16:13:07 -10:00
Dmitry Astapov
9597210556 script: balance-as-budget properly applies commodity styles now 2025-02-11 11:04:51 -10:00
Simon Michael
b12d7cb05b ;dev: fix Shake.hs typo 2025-02-11 08:26:53 -10:00
Simon Michael
fbbe897133 ;doc:hledger:cost/lot notations: cleanups 2025-02-06 12:16:10 -10:00
Simon Michael
0194ce3b42 ;doc:MOCKUPS: cleanup, move lot notes to Lot tracking page 2025-02-06 11:27:25 -10:00
Simon Michael
d435cf2ab4 ;doc:value reporting: edits 2025-02-05 10:38:13 -10:00
Simon Michael
3f1b6e6c8b ;doc:value reporting: edits 2025-02-05 10:35:23 -10:00
Simon Michael
27e51edbf4 ;doc:cost, value reporting: edits 2025-02-05 10:26:05 -10:00
Simon Michael
57efcfb79a ;bin: script-example: cleanup 2025-02-01 13:55:03 -10:00
Simon Michael
39f3b2c7ba ;dev: doc 2025-01-31 02:04:40 -10:00
Simon Michael
fdbf1b920f ;examples:csv: pooltool-rewards.csv.rule cleanup 2025-01-30 21:12:34 -10:00
Simon Michael
63b939a201 imp:print: --invert now also negates balance assertion/assignment amounts [#2314] 2025-01-29 09:47:29 -10:00
Simon Michael
bbb06209e7 lib: +postingNegate 2025-01-29 09:42:15 -10:00
Simon Michael
0dca0911f3 lib: negatePostingAmount -> postingNegateMainAmount 2025-01-29 09:41:51 -10:00
Simon Michael
3e838e4d0f imp:print: support --invert [#2314] 2025-01-27 05:21:36 -10:00
Simon Michael
aef59f8edd ;doc:FINANCE: funded projects 2025-01-27 05:20:03 -10:00
Simon Michael
d282d0b72b ;doc:FINANCE: better reports link 2025-01-25 23:58:38 -10:00
Simon Michael
1d32f0160c ;doc:FINANCE: edits 2025-01-25 23:53:40 -10:00
Simon Michael
f2df5ad72f ;doc:FINANCE: Funded projects 2025-01-25 23:35:03 -10:00
Simon Michael
dfc9c27c06 ;doc: finance cleanups 2025-01-25 22:11:45 -10:00
Simon Michael
2ee1cacf0a ;doc:FINANCE, REGRESSIONS: cleanup 2025-01-25 22:00:48 -10:00
Simon Michael
b3e50f5e59 fix:bal:html output: also suppress total heading when -H is active 2025-01-25 20:38:09 -10:00
Simon Michael
fdfd16387c ;tools: just time 2025-01-25 11:54:19 -10:00
Simon Michael
29885d15fa dev: refactor Hledger.Write.Html etc, reducing Lucid references
Clarify the HTML lib situation a bit, and clean up some imports.

Related: #2244
2025-01-25 11:53:51 -10:00
Simon Michael
14dd2c6200 dev: rename printHtml -> styledTableHtml 2025-01-25 11:53:51 -10:00
Dmitry Astapov
9d4db48510 ;roi: optimize "one period per report interval" case a bit 2025-01-21 23:42:36 -10:00
Simon Michael
a359d6b828 ;doc: Directive effects: fix account types link [#126] 2025-01-21 23:39:15 -10:00
Simon Michael
31370bb65d ;doc: update command docs 2025-01-21 23:22:34 -10:00
Simon Michael
4614300d6a ;fix:print: --help was indicating wrong --round default [#2318] 2025-01-21 23:15:15 -10:00
Simon Michael
5f3c3f3854 fix:ui:a key: don't pass cli query args to add [#2313] 2025-01-21 22:02:34 -10:00
Simon Michael
adef1a8416 lib: add dropRawOpt, cliOptsDropArgs 2025-01-21 22:02:05 -10:00
Simon Michael
54e7a178b3 ;doc:commodity styles: fix typo [hledger_site#123] 2025-01-21 21:36:25 -10:00
Simon Michael
58431b0cec ;imp:ui: allow brick 2.7 2025-01-21 21:36:25 -10:00
Simon Michael
91529191cd ;doc:cost/lot notations: clarify 2025-01-21 21:36:25 -10:00
Lars Kellogg-Stedman
d447d708f6 ;bin: git: make ensure_git more robust
Instead of manually checking for a .git directory, ask git to check whether
or not we are in a work tree using 'git rev-parse --is-inside-work-tree'.
This takes care of things like being in a subdirectory of a work tree, or
someone having GIT_DIR pointing somewhere other than .git, etc.
2025-01-21 21:29:33 -10:00
Simon Michael
51e7ebae3d ;doc:cost/lot notations: clarify 2025-01-21 15:57:00 -10:00
Simon Michael
06abca7304 ;doc:cost/lot notations: clarify 2025-01-21 15:54:04 -10:00
Simon Michael
8d886ef3f4 ;doc:cost/lot notations: clarify 2025-01-21 15:40:27 -10:00
Simon Michael
b7deaea12e ;doc:cost/lot notations: clarify 2025-01-21 15:32:47 -10:00
Simon Michael
0635fb91fa ;doc: bin, Scripts page: edits 2025-01-20 12:17:14 -10:00
Simon Michael
31c3c32872 ;doc: commodity directive: clarify slightly 2025-01-20 12:11:10 -10:00
Simon Michael
7ca1d1ac47 ;doc: bin, Scripts page: hledger-interest notes 2025-01-20 12:10:57 -10:00
Simon Michael
edfcd3554f lib: showAmountCost(B): drop leading whitespace 2025-01-15 16:28:43 -10:00
Simon Michael
e98af39e27 imp:pivot: support pivoting on amount (quantity) or cost 2025-01-15 13:47:04 -10:00
Simon Michael
e7e0b5c868 lib: Hledger.Data.Amount: showAmountCost 2025-01-15 13:22:03 -10:00
Simon Michael
90415875f5 imp:pivot: support pivoting on commodity symbol; doc improvements 2025-01-15 12:46:09 -10:00
Simon Michael
0602b241d1 ;dev:print: comment 2025-01-11 07:15:18 -10:00
Simon Michael
f3151e3880 ;doc:close: mention the balance assertions 2025-01-10 01:19:56 -10:00
Simon Michael
87cc3e1393 imp:close: omit file extension from tag value 2025-01-09 21:26:53 -10:00
Simon Michael
bde97b8f28 ;doc: update command docs 2025-01-09 21:19:44 -10:00
Simon Michael
6868ab06a4 imp:close: --migrate -> --clopen; more doc rewrites 2025-01-09 21:19:44 -10:00
Simon Michael
2588e31466 imp:close: change the start: tag to clopen:, and change --assign's tag to assign:
And some doc edits.
2025-01-09 15:32:25 -10:00
Simon Michael
88379684c0 ;bin: hledger-move: doc edits 2024-12-28 20:24:05 -10:00
Simon Michael
4c46502349 ;tools: just functest: fail if there are warnings
(Does not force recompilation of already compiled modules, but should
help catch more warnings before pushing them to CI.)
2024-12-27 12:50:36 -10:00
Simon Michael
5db62b37e1 fix:close: --infer-costs no longer implies -x/--explicit [#1826] 2024-12-27 12:50:26 -10:00
Simon Michael
5644dc2493 ;doc: pager: mention --pager=no 2024-12-27 12:08:44 -10:00
Simon Michael
d4d9caf328 ;doc:Aliases and account types: better troubleshooting command 2024-12-22 09:44:51 -10:00
Simon Michael
eb9bb16faa fix:add: account names provided on command line were being ignored [#2305]
Fix suggested by Raphael (lowercasename)
2024-12-20 15:51:15 -10:00
Simon Michael
efa101091c fix:web: -threaded is needed in test suite now also 2024-12-20 11:40:28 -10:00
Simon Michael
c23087f124 fix: show a week period beginning in the previous year correctly [#2304]
Eg the week beginning 2024-12-30 (which is week 1 of 2025 because the
thursday falls in 2025) was previously shown as 2024-W01, now 2025-W01.
2024-12-20 10:41:47 -10:00
Simon Michael
e71e8a8711 fix:bs/bse/cf/is: drop unsupported --budget option from help [#2302] 2024-12-20 10:41:47 -10:00
Simon Michael
c2ae02adb6 ;doc: update embedded manuals 2024-12-20 10:41:47 -10:00
Simon Michael
9de9fe7656 ;doc: update command docs 2024-12-20 10:41:47 -10:00
Simon Michael
0a14b3a08c fix:areg: drop inconsistent newline in options help 2024-12-20 10:41:46 -10:00
Simon Michael
0a484df676 ;tools: bump tools & bin to recent stackage / ghc 9.10 2024-12-20 10:41:46 -10:00
Simon Michael
38c2b5938d ;doc:REGRESSIONS: update 2024-12-20 10:41:46 -10:00
Simon Michael
512fa8cc8c ;doc:hledger: list rendering fix 2024-12-20 10:41:46 -10:00
Simon Michael
1a5353b988 dev: disable doctest testing error output, color breaks it 2024-12-20 08:51:38 -10:00
Simon Michael
aefa4e8f20 imp:cli: show first line of error messages in red
error' and usageError now redden and bolden the first line of error
messages, when ANSI codes are supported and permitted.
And warn goldens and boldens the first line of warning messages.
2024-12-20 08:51:38 -10:00
Simon Michael
69d7469556 ;pkg: stack: start ghc 9.12 stack.yaml 2024-12-20 08:46:19 -10:00
Simon Michael
5b89f89ed0 ;doc:beancount output: mention limitations: P and balance assignments 2024-12-20 08:46:19 -10:00
Simon Michael
a92f880a20 ;pkg: stack: use latest nightly, simpllify stack.yaml 2024-12-18 18:06:05 -10:00
Simon Michael
02ffc5ab75 ;doc: RELEASING: clear checklist 2024-12-18 08:01:41 -10:00
Simon Michael
38a2d2e153 ;doc: RELEASING: line breaks 2024-12-18 08:01:41 -10:00
Dmitry Astapov
dde5a59049 roi: simplify/speed up (no longer checks every day with P directive) 2024-12-18 07:42:13 -10:00
Simon Michael
c6f84b31c0 ;doc: REGRESSIONS: simplify headings 2024-12-17 10:23:57 -10:00
Simon Michael
496431c854 ;doc: REGRESSIONS: edit 2024-12-17 10:16:12 -10:00
Simon Michael
bcc1cd60f6 ;doc: REGRESSIONS: clearer docs, linkable headings 2024-12-17 10:06:42 -10:00
Simon Michael
a91735838a ;doc: REGRESSIONS update 2024-12-17 09:21:29 -10:00
Simon Michael
37ac52aa7e ;bin: hledger-script-example: add a short low boilerplace version 2024-12-16 15:29:18 -10:00
Simon Michael
d20d2571f8 ;bin: hledger-script-example.hs: improvements, cleanups 2024-12-16 15:28:54 -10:00
Simon Michael
46c58a45dc ;tools: just: log-save, log-headtail, log-push 2024-12-16 15:26:42 -10:00
Simon Michael
d011da6e40 ;tools: just: help edits 2024-12-16 15:26:42 -10:00
Simon Michael
5803aa2905 ;doc:RELEASING: add post-publish install testing 2024-12-12 17:36:10 -10:00
Simon Michael
c9128c6b97 ;pkg:hledger-install: try third party packages again without bounds
This makes hledger-iadd and hledger-interest more likely to install
successfully, even if their bounds have not yet been updated for a new
hledger release.
2024-12-12 17:23:40 -10:00
Simon Michael
57bc54b2a4 ;pkg:hledger-install: "up to date" message for main tools like the others 2024-12-12 16:55:45 -10:00
Simon Michael
2acb57039b ;doc: ghrelnotes: cleanups; leave platforms expanded for now 2024-12-12 16:30:39 -10:00
Simon Michael
b61cd5b11c ;tools: just ghrelnotes-publish: update release notes on github
Requires Github's `gh` CLI tool.
2024-12-12 16:30:39 -10:00
Simon Michael
311ee115c6 ;doc: ghrelnotes: collapse release notes by default again
Release notes can be very long. Now both they and the platform binary
install docs are collapsed by default, allowing the sequence of
dates and releases to be seen easily by default. Github automatically
expands the assets of the latest release, so those too will be
visible by default.

For a full text search of all release notes, the release notes page
on hledger.org is still available.
2024-12-12 14:25:09 -10:00
Simon Michael
f8f7e73da7 ;doc: RELEASING: updates 2024-12-12 10:52:51 -10:00
Simon Michael
f5ee926187 ;tools: just: document watchexec workaround; drop --timings 2024-12-12 10:03:42 -10:00
Simon Michael
2168382058 ;tools: Shake: comment unused orgfiles script 2024-12-12 10:03:42 -10:00
Simon Michael
27329f7de8 ;tools: just site-watch: also watch changes in site/src/* 2024-12-12 10:03:42 -10:00
Simon Michael
eb042ea22c ;doc:ghrelnotes: fix linux, mac install commands [#2299] 2024-12-11 22:50:02 -10:00
Simon Michael
745b48e3fa ;doc: RELEASING: new release checklist; process notes cleanup 2024-12-10 10:40:44 -10:00
Simon Michael
da165bf121 ;doc: CREDITS: edit 2024-12-10 09:13:25 -10:00
Simon Michael
05e7f7cf0c ;doc: CREDITS: edit 2024-12-10 09:10:35 -10:00
Simon Michael
41704290d0 ;doc: changelogs: fix 2241 link more 2024-12-09 19:08:52 -10:00
Simon Michael
cbd5f42f8d ;doc: hledger: drop outdated change note [#1846] 2024-12-09 19:02:34 -10:00
Simon Michael
eb8db39ed0 ;doc: hledger changelog/relnotes: fix 2241 link 2024-12-09 18:54:34 -10:00
Simon Michael
3a47888534 ;doc: Balance report output: drop outdated note about --tree and HTML [#1846] 2024-12-09 18:54:08 -10:00
Simon Michael
ffc3440313 ;doc: update embedded manuals 2024-12-09 17:58:30 -10:00
Simon Michael
f2cb3cd023 ;cabal: update cabal files 2024-12-09 17:58:25 -10:00
Simon Michael
20f1f51a9d ;pkg: set version to 1.41.99 2024-12-09 17:58:24 -10:00
Simon Michael
16958b205c ;tools: just: mastertag -> devtag; improve 2024-12-09 17:58:04 -10:00
Simon Michael
284bb7e2e8 ;tools: Shake setversion: do hledger-install separately 2024-12-09 17:52:25 -10:00
Simon Michael
58d461d5ee ;doc: changelogs: fix heading 2024-12-09 16:03:40 -10:00
Simon Michael
7b16b0853c ;doc: relnotes: summary edit 2024-12-09 16:00:39 -10:00
Simon Michael
77a25b6423 ;doc: merge 1.41 changelogs 2024-12-09 15:46:35 -10:00
Simon Michael
a7a15cc889 ;tools: just: updates 2024-12-09 15:37:53 -10:00
Simon Michael
18604222df ;tools: just reltag -> reltags, reltags-push 2024-12-09 15:37:53 -10:00
Simon Michael
0dfa135c33 ;doc: relnotes: last minute bugfix 2024-12-09 15:37:53 -10:00
Simon Michael
baf1138523 ;tools: just ghrelnotes-copy 2024-12-09 15:37:53 -10:00
Simon Michael
b663822b88 fix: print: ignore --depth entirely
Until now, a depth limit caused print to show only transactions referencing accounts as deep or deeper than that.
2024-12-09 15:37:30 -10:00
Simon Michael
207ff43d6b ;tools: just tags 2024-12-09 15:37:30 -10:00
Simon Michael
248ef903ee ;tools: just reltag: fix tags 2024-12-09 15:37:30 -10:00
Simon Michael
e3b09aeee8 ;doc: announcements 2024-12-09 15:37:30 -10:00
Simon Michael
2d1d3ac006 ;tools: just changelogs-finalise, changelogs-catchup 2024-12-09 15:37:24 -10:00
Simon Michael
b572d6b1ca ;pkg: stack98: use lts-23 2024-12-09 15:37:20 -10:00
Simon Michael
eaeb9222c5 ;tools: Shake setversion: also update hledger-install.sh 2024-12-09 15:36:11 -10:00
Simon Michael
8b425868da ;tools: relnotes: todos 2024-12-09 15:36:10 -10:00
Simon Michael
297ca50294 ;doc: relnotes 1.41 2024-12-09 15:36:07 -10:00
Simon Michael
07d6fc4d3e ;tools: just changelogs-reset, changelogs-finalise, reltag, mastertag, relnotes 2024-12-09 15:34:54 -10:00
Simon Michael
6bbd3c8de2 ;tools:relnotes: make it a more robust stack script 2024-12-09 15:34:54 -10:00
Simon Michael
cf40eade6e ;tools: changelogEdit: rename old tool 2024-12-09 15:34:54 -10:00
Simon Michael
28cfc0cfdc ;tools: just site-manuals-snapshot 2024-12-09 15:34:49 -10:00
Simon Michael
0cb009a503 ;tools: Shake changelogs: simplify, don't duplicate heading 2024-12-09 15:34:46 -10:00
Simon Michael
fc3b21b81b ;tools: just tldr-diff 2024-12-09 15:34:44 -10:00
Simon Michael
5c17a7e069 ;doc:tldr:hledger: sync with upstream 2024-12-09 15:34:41 -10:00
Simon Michael
232d533f6c ;doc: tldr/README updates 2024-12-09 15:34:35 -10:00
Simon Michael
9081232b10 ;tools: just, Shake cleanups 2024-12-09 15:34:25 -10:00
Simon Michael
bab557b3b5 ;tools: just relprep -> relbranch 2024-12-09 15:31:48 -10:00
Simon Michael
1be0afe2ff ;tools: just relprep: simplify 2024-12-09 15:31:48 -10:00
Simon Michael
a9b1c8b009 ;pkg: hledger-install: bump versions 2024-12-09 14:57:04 -10:00
Simon Michael
26d4d72d7a ;tools: Shake cmddocs: clarify 2024-12-07 13:30:31 -10:00
Simon Michael
57bcce020c ;tools:Shake: cleanups 2024-12-07 11:06:21 -10:00
Simon Michael
b10c0f256c ;doc: common.m4: clean up, update generaloptions macro 2024-12-07 09:22:32 -10:00
Simon Michael
895a52b745 ;bin: remove obsolete _FLAGS marker from help 2024-12-07 08:51:44 -10:00
Simon Michael
43dd0cfc5d ;dev: cleanups 2024-12-07 08:50:34 -10:00
Simon Michael
917f03b828 ;doc: changelogs 2024-12-06 18:05:28 -10:00
Simon Michael
972a2a066b ;doc:beancount output: edits 2024-12-06 08:11:30 -10:00
Simon Michael
32182a05fc ;doc:beancount output: edits 2024-12-06 07:54:45 -10:00
Simon Michael
82fde8d2dc ;doc:query types: edits 2024-12-06 07:14:29 -10:00
Simon Michael
f148eec5fb ;doc:query types: edits 2024-12-06 07:13:03 -10:00
Simon Michael
85428d5cac ;doc:query types: updates, add headings, mention tag:'s infix matching 2024-12-06 07:04:05 -10:00
Simon Michael
1af6e9c51c ;tools: just: work around watchexec bug on mac 2024-12-06 07:03:45 -10:00
Simon Michael
f648903b37 imp:print:beancount: don't add account tags to postings
When print is generating beancount output, turn off the usual
inheritance of account tags by postings; it would generate excessive
metadata in the journal. Beancount can do or not do that kind of
inheritance itself.
2024-12-06 05:55:42 -10:00
Simon Michael
ff28aa329a imp:print:beancount: convert tags to BC metadata
Transaction and posting tags (and posting tags inherited from accounts)
are now converted safely to Beancount-compatible transaction and posting
metadata lines.
2024-12-06 05:55:42 -10:00
Simon Michael
17332c75f9 imp:print:beancount: generate operating_currency directives from cost currencies 2024-12-06 05:55:42 -10:00
Simon Michael
f5e97e2f92 ;doc:output:beancount: updates 2024-12-06 05:55:42 -10:00
Simon Michael
b4f4374dfa imp:print:beancount: remove redundant conversion postings automatically 2024-12-06 05:55:42 -10:00
Simon Michael
d925c8a042 imp:print:beancount: add a second account name part if needed
Beancount requires account names to have at least two parts.
2024-12-06 05:55:42 -10:00
Simon Michael
6e3dfd6703 imp:print:beancount: remove virtual postings automatically 2024-12-06 05:55:42 -10:00
Simon Michael
b68ebc221b ;tools: just branches/v 2024-12-06 05:55:42 -10:00
Simon Michael
1048791810 imp:csv: ignore whitespace, show error position when reading .latest files 2024-12-05 16:35:18 -10:00
Simon Michael
d3ce054789 ;tools: just branches: show recent branches/commits with jj 2024-12-05 09:04:09 -10:00
Simon Michael
29349458b3 imp:csv:if: go back to accepting unknown csv field names [#2289]
It makes life easier when reusing common rules with different CSVs.
2024-12-04 17:45:28 -10:00
Simon Michael
99fc4cd61f imp:csv:if: show the problematic field name when warning 2024-12-04 16:47:01 -10:00
Simon Michael
9696677c5d ;doc: depth: note version 2024-12-04 10:33:23 -10:00
Simon Michael
8c72d5e14e ;doc:RELEASING: fix link 2024-12-04 07:49:27 -10:00
Simon Michael
595243ea18 ;doc: LEDGER_FILE on Windows: copy improvements from hledger_site#119 2024-12-04 07:47:06 -10:00
Simon Michael
00beef6052 imp:csv:if: edits 2024-12-03 17:32:39 -10:00
Simon Michael
054a204aa0 imp:csv:if: support & ! (AND NOT) 2024-12-03 17:25:43 -10:00
Simon Michael
f73888d3b6 ;doc:csv:if: edits 2024-12-03 16:41:54 -10:00
Simon Michael
4708065fb4 pkg:stack: prefer ghc-9.10.1's lib versions, minimise build issues 2024-12-03 16:07:57 -10:00
Simon Michael
3d55f260b3 imp:csv:if: warn on invalid csv field names; improve doc [#2289] 2024-12-03 16:07:57 -10:00
Simon Michael
05ae105b42 dev: Hledger.Utils.IO: warn 2024-12-03 16:07:54 -10:00
Simon Michael
a47dce073d dev:csv: refactor/document isBlockActive, matcherMatches 2024-12-03 13:51:32 -10:00
Simon Michael
1010e3dee6 imp:csv: improve debug=7 output from isBlockActive 2024-12-03 10:45:16 -10:00
Simon Michael
786f5dd72a ;pkg:ui: allow brick 2.5, 2.6 2024-12-03 09:29:15 -10:00
Simon Michael
81d20ecaf8 ;tools: revert to ghc 9.8.2 for now
running these with ghc 9.10 is awkward
2024-12-03 09:13:14 -10:00
Simon Michael
2b07301a4f tools: just help: improvements 2024-12-03 09:00:27 -10:00
Simon Michael
fd9c64a4ad pkg: allow megaparsec 9.7 [stackage#7585] 2024-12-03 08:46:29 -10:00
Simon Michael
e44a2207d8 ;pkg:stack: note unix issue 2024-12-03 08:33:44 -10:00
Stephen Morgan
73fd60b2b0 ;imp: doc: Document new regular expression limited depth. 2024-12-03 08:33:21 -10:00
Stephen Morgan
7168f7efc4 imp: ui: Use new DepthSpec in hledger-ui.
The regular expression depths are ignored, and only the flat depths are
used.
2024-12-03 08:33:21 -10:00
Stephen Morgan
74f0f37fb3 imp: queries: Allow regular expression depth queries
Previously depth-limiting was universal across all accounts, e.g. all
accounts are clipped to depth 2. However, sometimes you want certain
accounts clipped to a different depth than others, e.g. all expenses to
depth 3, while all assets to depth 2. This commit enables depth-limiting
to optionally include a regular expression, which limits the accounts it
applies to.

More than one depth limit can be passed, and they are applied to each
account name by the following rules:
- If one or more regular-expression depth limit applies, use the
  most specific one
- If no regular-expression depth limits apply, and a flat depth limit is
  supplied, use that
- Otherwise, do not do any depth limiting

For example, this will clip all accounts matching "assets" to depth 3,
all accounts matching "expenses" to depth 2, and all other accounts to
depth 1.
--depth assets=3 --depth expenses=2 --depth 1
2024-12-03 08:33:21 -10:00
Simon Michael
436b2ab3fb pkg:stack: try to avoid a doctest>unix link failure
("multiple definition of __hsunix_get_environ")
2024-12-02 23:40:34 -10:00
Simon Michael
735beb96a7 imp:valuation: more compact and informative --debug=2 output [#2287]
Market prices are now shown using one line each,
the known prices are listed (forward / forward+reverse),
and the status of --infer-market-prices is shown.
2024-12-02 23:00:00 -10:00
Simon Michael
e80debe4c9 ;ci:linux: work around yesod-core/wai-extra bound issue
https://github.com/commercialhaskell/stackage/issues/7570
2024-12-02 21:07:34 -10:00
Simon Michael
784a95de29 ;ci: mac, windows: fix time dep 2024-12-02 20:41:25 -10:00
Simon Michael
84254ca2b8 ;ci: windows: explicit time dep required 2024-12-02 17:40:29 -10:00
Simon Michael
f17ed111b6 ;ci: linux, mac: ghc 9.8.2 -> 9.8.4 2024-12-02 17:18:58 -10:00
Simon Michael
645da4a74f ;pkg: bump to latest stackage snapshot 2024-12-02 17:13:28 -10:00
Simon Michael
b9100f3471 ;tools: just relbin: assume "origin" remote name 2024-12-02 16:45:26 -10:00
Simon Michael
909a903137 ;doc:ui: mention that period navigation uses standard periods [#2293] 2024-12-01 15:08:45 -10:00
Simon Michael
f345c6c8d9 ;doc:import: more edits 2024-12-01 11:22:10 -10:00
Simon Michael
d16efeb26a ;doc:import: edit 2024-11-30 09:25:02 -08:00
Simon Michael
f414c37195 ;doc:import: first import tips 2024-11-30 06:57:13 -08:00
Simon Michael
812a7e28d7 ;doc:import: updates 2024-11-29 16:18:58 -08:00
Simon Michael
ff649114a7 ;doc:import: updates 2024-11-29 16:03:08 -08:00
Simon Michael
3d0aec7e8b ;doc:import: rewrite; date skipping -> overlap detection 2024-11-29 15:45:19 -08:00
Simon Michael
a38c09be98 ;doc: assertions: mention their behaviour with posting status 2024-11-21 07:57:26 -10:00
Simon Michael
e1d5339643 ;doc: REGRESSIONS: update 2024-11-20 19:23:16 -10:00
Gal Lakovnik Gorenec
255dc015eb fix:ui: Fixed #2284 -- valuation and cost flags now reset each other on toggle. 2024-11-18 09:30:07 -10:00
Simon Michael
21d8044bcf ;doc:journal: rewrite the Tags section 2024-11-16 14:40:03 -10:00
Simon Michael
1ad9fbb4a8 imp:print: clean up special tags; show them more often with --verbose-tags
- These special hidden tags, used internally, have been renamed:
  - `_modified`           -> `_modified-transaction`
  - `_cost-matched`       -> `_cost-posting`
  - `_conversion-matched` -> `_conversion-posting`

- All special hidden tags now have a similarly-named visible tag,
  and `--verbose-tags` now shows those more often, which is useful
  when troubleshooting `--infer-equity`, `--infer-costs`,
  or the matching of redundant costs and conversion postings.

- The `generated-posting:` tag added by `--infer-equity` is now valueless.

- The `modified-transaction:` tag added by `--auto` now appears on its own line.
2024-11-16 14:40:03 -10:00
Simon Michael
9bf28b1b0e dev:posting*AsLines: fix some docs 2024-11-16 14:40:03 -10:00
Simon Michael
9e5d2a7759 ;doc:REGRESSIONS: update 2024-11-15 20:26:13 -10:00
Simon Michael
23210aa6c9 ;doc:REGRESSIONS: updates; clarify valid periods 2024-11-10 12:05:24 -10:00
Simon Michael
f57cd638da imp:print:beancount output: more robust account/commodity encoding
Unsupported chars are now hex-encoded, not just converted to dashes.
This helps keep account and commodity names unique, especially with
the equity conversion account names generated by --infer-equity when
using currency symbols.
(Those could also be converted to ISO 4217 codes, in theory, but
for now we just hex encode them, which is easier to make robust.)

Also, Beancount commodity symbols are no longer enclosed in
hledger-style double quotes.
2024-11-07 01:28:31 -10:00
Simon Michael
cbdbe0a855 dev: AmountFormat: add displayQuotes property to control enclosing quotes 2024-11-07 01:24:21 -10:00
Simon Michael
4b1b97a6aa ;tools: just: add ghci-echo, ghcitui 2024-11-07 01:24:21 -10:00
Simon Michael
1078c176bf ;doc: pager: link to less FAQ
Signed-off-by: Simon Michael <simon@joyful.com>
2024-11-07 01:24:21 -10:00
Dmitry Astapov
c006959b05 lib: fix division by zero in roi when all assets are sold (fixes #2281) 2024-11-06 17:56:36 -10:00
Henning Thielemann
d176215f03 cli: Commands.Aregister: --header -> --heading 2024-11-06 16:38:38 -10:00
Simon Michael
6adda683dc dev:Journal: cleanup 2024-11-02 18:29:15 -10:00
Simon Michael
660bbbb1f4 dev: update errors/README 2024-11-02 18:11:08 -10:00
Simon Michael
326acbf93b imp: check recentassertions: try to make the error message clearer 2024-11-02 18:10:53 -10:00
Simon Michael
090f001eee imp:commodities: also list commodities mentioned in P directives [#2280] 2024-11-02 16:48:08 -10:00
Simon Michael
a58948c7a8 dev:Journal: cleanup, improve docs 2024-11-02 16:47:24 -10:00
Simon Michael
445e80fd41 dev:clarify: rename jcommodities to jdeclaredcommodities 2024-11-02 15:52:17 -10:00
Simon Michael
80fa7e2db6 dev:clarify: rename jinferredcommodities to jinferredcommoditystyles 2024-11-02 15:52:07 -10:00
Simon Michael
5e0a35b1da fix:journal:P directives: require a space after the symbol [#2280]
This prevents surprising parses, like
`P 2024-10-31 a0 1` parsed as `P 2024-10-31 a 01`.
2024-11-02 15:24:25 -10:00
Simon Michael
d6080c5ff1 imp: check commodities: also check commodities used in P directives [#2280] 2024-11-02 15:03:57 -10:00
Simon Michael
c66e901d8b dev: save the parse positions of PriceDirectives 2024-11-02 15:00:47 -10:00
Simon Michael
4d38c63ec8 dev: move/rename nullsourcepos 2024-11-02 14:59:43 -10:00
Simon Michael
5d2259d942 dev: Hledger.Utils.IO: cleanup 2024-11-02 12:59:44 -10:00
Simon Michael
1dabccfb46 dev: Hledger.Utils.IO: more cleanup 2024-11-02 12:51:53 -10:00
Simon Michael
4351304f06 dev: Hledger.Utils.IO: cleanup 2024-11-02 12:04:19 -10:00
Simon Michael
9c81bb2a06 dev: Hledger.Utils.IO colour helpers: cleanup 2024-11-02 11:54:28 -10:00
Simon Michael
75ff6c8218 ;cabal: update cabal files 2024-11-02 08:42:10 -10:00
Simon Michael
657fc1551f !fix: respect --color=yes in a few places that didn't; drop text-ansi dep
Hledger.Utils.IO's ansi style/color helpers now respect --color=yes,
so that eg `hledger --color=yes | less -R` shows bold headings as
you'd expect.

Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
2024-11-01 10:40:25 -10:00
Simon Michael
66953ae0be ;doc: pager: note that help -p TOPIC uses less 2024-11-01 08:15:09 -10:00
Simon Michael
234b4879c2 imp: less pager will use HLEDGER_LESS instead, if defined
When using `less` as pager, if HLEDGER_LESS is defined, it will
provide the options (instead of LESS + hledger's extra options).
You can set your own preferred options here, or you can set it
equal to LESS to use exactly those options.

[#2272]-related
2024-11-01 08:02:03 -10:00
Simon Michael
5bab9600e4 imp: simplify pager setup: just customise LESS, not MORE
[#2272]-related
2024-11-01 08:01:44 -10:00
Simon Michael
1011029356 imp: pager set extra LESS options for a nice experience when using less
Currently this sets a rather ambitious set of options,
and overrides the existing LESS:

  --chop-long-lines
  --hilite-unread
  --ignore-case
  --mouse
  --no-init
  --QUIT-AT-EOF
  --quit-if-one-screen
  --RAW-CONTROL-CHARS
  --squeeze-blank-lines
  --use-backslash
  --use-color
2024-10-31 19:13:39 -10:00
Simon Michael
30086ae249 imp: run pager more robustly; drop pager lib [#2272]
This fixes the error displayed when quitting the pager with long output.
It also replaces the pager lib with more robust homegrown pager utilities,
which should prevent a number of failure modes.
2024-10-31 18:55:09 -10:00
Simon Michael
659e493b30 ;doc: update changelogs 2024-10-30 19:01:49 -10:00
Simon Michael
a9a4fd2906 ;tools: push: github remote was renamed to origin (for jj) 2024-10-24 11:10:25 -10:00
Simon Michael
50bf401ea6 dev: split debug/ghcdebug flags, comment out the latter for now
Compilation with ghc-debug is failing, and it has not yet been used
for anything. Separate the flag and leave it in place but commented for now.
2024-10-24 10:44:28 -10:00
Simon Michael
4b4cc54a6a dev:ui: cleanup 2024-10-24 10:44:28 -10:00
Simon Michael
7c31ddfba2 ;tools: note gtree issue 2024-10-24 10:44:28 -10:00
Simon Michael
f96df24a00 ;doc: regular expressions: note possible RTL/bidi limitation 2024-10-24 10:44:28 -10:00
Simon Michael
717e86ff28 ;examples:csv: a YNAB 4 example, with workaround for RTL currency symbol 2024-10-24 10:44:28 -10:00
Simon Michael
de9095792e ;stack: 9.0-9.8: add base-compat-0.14, needed since 1c45496 2024-09-30
I think base-compat-batteries is unnecessary.
I have not tested all these build plans.
2024-10-24 10:44:28 -10:00
Simon Michael
31469ba6cc ;stack: base-compat-batteries seems not needed 2024-10-24 10:44:28 -10:00
Simon Michael
835b8fd0e8 ;ci: ci, oldest: cache ids aren't correctly including ghc version 2024-10-24 10:44:28 -10:00
Henning Thielemann
e43168533f cli: Commands.Aregister: replace option --no-header by --header=YN 2024-10-23 21:55:24 -10:00
Henning Thielemann
1a9bfcf5be cli: Commands.Aregister: implement --invert option 2024-10-23 21:55:24 -10:00
Henning Thielemann
fa3676df7d doc: Commands.Aregister: motivate --no-header option 2024-10-22 12:05:42 -10:00
Henning Thielemann
93d32a934b doc: Commands.Aregister: mention --cumulative option 2024-10-22 12:05:42 -10:00
Henning Thielemann
8a56c4944c cli: Commands.Aregister: new option --no-header 2024-10-22 12:05:42 -10:00
Henning Thielemann
3714ac0593 lib: Write.Ods.printFods: change type of number of fixed rows/columns from (Maybe Int) to Int
0 is a perfect value for no fixed row or column.
2024-10-22 12:05:42 -10:00
Henning Thielemann
b2aad52168 cli: Commands.Aregister: support option --cumulative 2024-10-22 12:05:42 -10:00
Simon Michael
95ef5fad9a ;doc: update manuals 2024-10-20 09:26:32 -10:00
Simon Michael
0f7242182e ;doc: update help 2024-10-20 09:26:08 -10:00
Simon Michael
fc9b6dffbd ;doc: add latest color/pager flags to general options m4 macro 2024-10-20 09:25:02 -10:00
Simon Michael
d985e89bad imp: default V accounts become just E when a new V account is declared
The equity:conversion account, and its variations equity:trade(s) and equity:trading,
normally detected as V/Conversion type, now become ordinary E/Equity accounts
if some other account is declared as V/Conversion type.

This is motivated by the next commit, in which `check accounts` will
stop warning about conversion accounts and their subaccounts,
which means all of the above names and their subaccounts would remain
always exempt from strict account checking.

Now, if the user declares their own conversion account, those default
accounts will become controllable by account checking again.
Which at least reduces the allowlist a bit.

Hopefully this won't cause hassles.
2024-10-20 09:13:58 -10:00
Simon Michael
da11d74ae6 dev: refactor: clarify journalAccountTypes 2024-10-20 09:13:58 -10:00
Simon Michael
e44cbbf1a4 dev: refactor, clarify detection of cost/conversion postings 2024-10-20 09:13:58 -10:00
Simon Michael
2d90550e25 dev: cleanups 2024-10-20 09:13:58 -10:00
Henning Thielemann
f1ded22c97 cli: Commands.Register: rename parameter base -> baseUrl 2024-10-20 08:49:36 -10:00
Henning Thielemann
84a6e167fb doc: hledger.m4: add FODS to aregister in output format matrix 2024-10-20 08:49:36 -10:00
Henning Thielemann
067c5e4db6 cli: Commands.Aregister.htmlRow: replace by call to generic accountTransactionsReportItemAsRecord 2024-10-20 08:49:36 -10:00
Henning Thielemann
4c189dde32 lib: Write.Spreadsheet.integerCell: for transaction indices 2024-10-20 08:49:36 -10:00
Henning Thielemann
7dc3715865 cli: Commands.Aregister: add export to FODS
use common Spreadsheet framework for CSV export, too
2024-10-20 08:49:36 -10:00
Simon Michael
7ad71ba2d5 ;doc: paging, box-drawing characters: updates 2024-10-20 08:46:11 -10:00
Simon Michael
f348bb642c ;cli:help: make --pager's help more accurate
--pager's "yes" doesn't unconditionally force it on; it behaves more
like --color's "auto". But yes/no is easier to read and understand,
so keep that and just tweak the wording.
2024-10-20 08:18:41 -10:00
Simon Michael
f8cc9cdb4d ;dev: document runPager's behaviour precisely 2024-10-20 08:10:07 -10:00
Simon Michael
5bf48d721a cabal: update cabal files 2024-10-19 18:50:40 -10:00
Simon Michael
7325b75d5b imp: rename ghcdebug build flag to debug, and enable stack traces with it
Builds made with ghc 9.10+ and the 'debug' build flag, will show
(some kind of, partial) stack traces when the program ends with an
error. (And also will have ghc-debug support enabled.)

The stack traces will probably improve in due course.
2024-10-19 18:47:03 -10:00
Simon Michael
b6a5687a38 imp: cli, web: disable ghc 9.10+'s stack traces here too
Starting to see them also from hledger now.
2024-10-19 18:33:58 -10:00
Simon Michael
62e1c020cf ;examples: hledger.conf.sample: updates 2024-10-19 18:00:51 -10:00
Simon Michael
fd4fa512e6 ;doc: update manuals 2024-10-19 17:06:10 -10:00
Simon Michael
d2344c119d ;doc: update help 2024-10-19 17:06:06 -10:00
Simon Michael
6893f342af imp: cli,ui,web: begin controlling GHC 9.10+'s stack traces 2024-10-19 16:56:14 -10:00
Simon Michael
a925e73b53 imp:cli: handle -NUM in config file properly 2024-10-19 16:56:14 -10:00
Simon Michael
576417655c dev: fix stray empty strings in builtinCommandNames 2024-10-19 16:56:14 -10:00
Simon Michael
f5b10b2d40 dev: cleanups 2024-10-19 16:56:14 -10:00
Henning Thielemann
3306abfd43 doc: hledger.m4: add HTML+FODS to print in output format matrix 2024-10-19 16:52:54 -10:00
Henning Thielemann
cc58ac7bf5 cli: Commands.Print.transactionToSpreadsheet: vertically merge common index, date, description and other cells 2024-10-19 16:52:54 -10:00
Henning Thielemann
8b391e2a07 cli: Commands.Print: add export to FODS and HTML
use common Spreadsheet framework for CSV export, too
2024-10-19 16:52:54 -10:00
Henning Thielemann
6773bf0974 cli: Commands.Register: add HTML and FODS to outputFormatFlag 2024-10-19 16:49:24 -10:00
Henning Thielemann
e144ad4ccd cli: Cli.Commands.Balance: give table names according to report type 2024-10-19 16:49:24 -10:00
Henning Thielemann
0c536da5ff doc: hledger.m4.md: FODS output - describe the advantages over CSV 2024-10-19 16:49:24 -10:00
Henning Thielemann
4fe51cb911 doc: hledger.m4.md: add FODS to all CompoundBalance commands in output format matrix 2024-10-19 16:49:24 -10:00
Simon Michael
b940254025 imp:cli: detect --color more safely in most cases
--color now also works in a config file, like --pager, except for two
cases: it does not affect colouring of debug output, or the colouring
helpers used in the check recentassertions error message.
2024-10-19 16:28:36 -10:00
Simon Michael
711d921774 imp:cli: --no-pager -> --pager, make this and --color safe options 2024-10-19 16:28:36 -10:00
Simon Michael
7fee69d7ab imp:cli: deprecate always/never --color values (though still support) 2024-10-19 16:28:36 -10:00
Simon Michael
9317354f20 doc: note issues with --color, --debug in config files 2024-10-19 16:28:36 -10:00
Simon Michael
66df5ed40f imp: expose config file args to getArgs; make --no-pager work there 2024-10-19 16:28:36 -10:00
Simon Michael
3e48451c3f imp: note unsafe args / config file limitation; make --no-pager safe 2024-10-19 16:28:36 -10:00
Simon Michael
18dceef1ce imp:cli: move --no-pager/--color to the help flags, available everywhere 2024-10-19 16:28:36 -10:00
Simon Michael
ba786752d1 imp📟 add a --no-pager general flag 2024-10-19 16:28:36 -10:00
Simon Michael
db748465a8 fix📟 when the $PAGER is not in PATH, print instead of failing 2024-10-19 16:28:36 -10:00
Simon Michael
4441680d7b fix:lib:Hledger.Utils.IO.pager: avoid a crash; avoid an extra newline 2024-10-19 16:28:36 -10:00
Simon Michael
3b7420b97c feat: use a pager for all large terminal output, not just for help 2024-10-19 16:28:36 -10:00
Henning Thielemann
a758eb0b5a doc: hledger.m4: add HTML+FODS to register in output format matrix 2024-10-18 00:07:11 -10:00
Henning Thielemann
86c3d7d656 cli: Commands.Register: support hyperlinks to hledger-web in HTML and FODS output
new option --base-url as in `balance` et.al.

Cli.Anchor: new module initialized with functions from Commands.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
96e0500ea7 cli: Commands.Register.postingsReportItemAsRecord: format transaction index as integer
lib: Write.Spreadsheet.Type: new TypeInteger
2024-10-18 00:07:11 -10:00
Henning Thielemann
b23753f5ae cli: Commands.Register.postingsReportItemAsRecord: export amounts as number plus commodity
lib: Write.Spreadsheet.cellFromMixedAmount, cellsFromMixedAmount: taken from Cli.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
d7b713f958 lib: Write.Ods.styleNames: common generation of ODS style names for both formatCell and cellConfig 2024-10-18 00:07:11 -10:00
Henning Thielemann
fe53b9b6ee lib: Write.Ods: disambiguate style names for DataMixedAmount and DataString (bugfix) 2024-10-18 00:07:11 -10:00
Henning Thielemann
991c56caef cli: Commands.Register.postingsReportAsSpreadsheet: generalize CSV output to HTML and FODS 2024-10-18 00:07:11 -10:00
Simon Michael
121b648bdb ;doc: output: edits 2024-10-17 20:18:02 -10:00
Simon Michael
4cf064e526 ;doc: text output: fix formatting, 2 2024-10-17 19:50:35 -10:00
Simon Michael
12cc571441 ;doc: text output: fix formatting 2024-10-17 19:47:14 -10:00
Simon Michael
7cbe75c523 ;doc: output format: updates, consolidate terminal topics 2024-10-17 19:30:02 -10:00
Simon Michael
733fec604b ;doc: text output: expand 2024-10-17 18:25:10 -10:00
Simon Michael
0f7aaa9600 imp: check accounts: simplify confusing suggestion in error message, 2 2024-10-16 21:19:51 -10:00
Simon Michael
d82c860f0d ;doc: special characters: edit 2024-10-16 18:39:06 -10:00
Simon Michael
7793ffe17d ;doc: special characters: edit 2024-10-16 18:14:16 -10:00
Simon Michael
e91be9e799 ;doc: special characters: more edits, more precision 2024-10-16 18:12:24 -10:00
Simon Michael
8683d5feb2 ;doc: special characters: edits 2024-10-16 16:23:45 -10:00
Simon Michael
0dbcafdebb ;doc: special characters: updates 2024-10-16 16:03:20 -10:00
Simon Michael
391bd6fac9 ;doc: special characters: clarify windows differences 2024-10-16 15:01:57 -10:00
Simon Michael
1fa8b79640 ;doc: update manuals 2024-10-15 16:36:54 -10:00
Simon Michael
b1677e8b2c ;doc: update help 2024-10-15 16:36:54 -10:00
Simon Michael
6bd5012b9b ;doc: changelogs 2024-10-15 16:36:54 -10:00
Simon Michael
d6d93e33ac ;doc: REGRESSIONS: update 2024-10-15 16:36:54 -10:00
Simon Michael
36d1093b84 imp: check accounts: simplify confusing suggestion in error message 2024-10-15 16:36:54 -10:00
Henning Thielemann
49f1af04ef cli: CompoundBalance.compoundBalanceReportAsSpreadsheet: somehow support layout tidy
However, it is not quite correct since it contains totals and net values.
2024-10-15 14:13:53 -10:00
Henning Thielemann
270360a103 cli: Commands.Balance: hide total rows for all output formats for layout=tidy 2024-10-15 14:13:53 -10:00
Henning Thielemann
fa58dc11f4 cli: Commands.Balance: remove lambda on ropts1 for balanceReport*
This is consistent with the calls to multiBalanceReport* and budgetReport*.
2024-10-15 14:13:53 -10:00
amano.kenji
f6c98ec1d6 feat(hledger-ui): add helix as a supported editor 2024-10-15 08:03:12 -10:00
Henning Thielemann
9d1ba5c588 cli: CompoundBalanceCommand.compoundBalanceReportAsSpreadsheet: common function for CSV, HTML, FODS export 2024-10-14 20:59:51 -10:00
Simon Michael
71a7879213 fix:check tags: _price-matched -> _cost-matched, and whitelisted [#2247] 2024-10-14 14:49:18 -10:00
Henning Thielemann
b8497c830e lib: Write.Spreadsheet.headerCell, addRowSpanHeader, rawTableContent: taken from Commands.Balance 2024-10-14 11:35:12 -10:00
Henning Thielemann
b8570c2aa0 cli: Commands.Balance.headerCell: do not automatically add a bottom border anymore
addHeaderBorders: do it explicitly
2024-10-14 11:35:12 -10:00
Henning Thielemann
dce24ea08f cli: Commands.Balance: remove some trailing spaces and unnecessary parentheses 2024-10-14 11:35:12 -10:00
Henning Thielemann
4d88b47aa7 cli: CompoundBalanceCommand: use List.foldl' with qualification
no need for import guarded by CPP
2024-10-14 11:35:12 -10:00
Henning Thielemann
746c927cee cli: Cli.CompoundBalanceCommand.compoundBalanceReportAsHtml.headerrow: collect all column headers
colspanattr: count those headers
This way, we can assert that colspanattr covers all columns.
2024-10-14 11:35:12 -10:00
Henning Thielemann
2122444c4b cli: Cli.Commands.Balance.multiBalanceReportAsSpreadsheetParts: parameter ishtml::Bool -> fmt::AmountFormat
arguments machineFmt, oneLineNoCostFmt are more descriptive than False, True
2024-10-14 11:35:12 -10:00
Henning Thielemann
2fd2110f3d cli: Cli.Commands.Balance.multiBalanceReportHtmlRows: removed
export multiBalanceReportAsSpreadsheetParts for use in compoundBalanceReportAsHtml
2024-10-14 11:35:12 -10:00
Simon Michael
2a374668e4 dev: Write.Beancount: isUpperCase -> isUpper to support ghc < 9.6 2024-10-14 11:02:21 -10:00
Simon Michael
7ac154e0b8 dev: cli: fix recent command parsing breakage; more tests 2024-10-14 09:12:59 -10:00
Simon Michael
b71634a4ee dev: notes, debug output tweaks 2024-10-14 09:12:59 -10:00
Simon Michael
c6bc020609 fix:cli: don't ignore first cli arg when there's a conf command arg 2024-10-12 21:33:06 -10:00
Simon Michael
b04a0e4e79 ;doc: config files: edit 2024-10-12 14:38:56 -10:00
Simon Michael
1228444d3e ;doc: config files: rewrite, clearer warning 2024-10-12 14:21:36 -10:00
Simon Michael
d2feaf6f97 imp: cli: a little less flag-moving debug output 2024-10-12 13:35:15 -10:00
Simon Michael
e2599e85a4 fix:cli: order of last flag could be lost, disrupting --no-conf eg
Move pre-command flags more carefully, including the last one,
so that the relative order of options is preserved.
(This caused --conf foo --no-conf to sometimes ignore the --no-conf.)
Debug output has also been improved.
2024-10-12 13:23:49 -10:00
Simon Michael
21e27a0283 imp: avoid ugly GHC 9.10.1 stack trace with nonexistent --conf file 2024-10-12 12:14:21 -10:00
Simon Michael
2db4b8ed56 imp: cli: improve debug output for finding config file 2024-10-12 11:28:13 -10:00
Simon Michael
46897cd30b imp: cli: config files can now provide the command name
If the first thing in a config file's general section is a non-flag
argument, that will be used as the command name argument,
taking precedence over any command line arguments.
2024-10-12 10:38:35 -10:00
Simon Michael
a928ed994b dev: cli: command line processing clarifications 2024-10-12 08:03:07 -10:00
Simon Michael
490ea3ccf1 ;doc:output:beancount: mention operating_currency 2024-10-11 16:30:05 -10:00
Simon Michael
aff3cd0591 imp:print:beancount: more robust conversion of commodity names 2024-10-11 14:56:03 -10:00
Simon Michael
4eff3ed8a0 ;cabal: update cabal files 2024-10-11 14:56:03 -10:00
Simon Michael
6dd9c92d32 lib: add Hledger.Data.Currency, currencySymbolToCode, currencyCodeToSymbol 2024-10-11 14:56:03 -10:00
Simon Michael
ceeea69264 ;examples: hledger2beancount.conf: fix unsupported quoting, add stuff 2024-10-11 14:56:03 -10:00
Simon Michael
13030b2826 ;tools: just doctest: pass through doctest arg(s) 2024-10-11 14:56:03 -10:00
Dmitry Astapov
1fefbe9159 ;bin: fix build errors in all scripts 2024-10-11 14:55:35 -10:00
Dmitry Astapov
92f022dee4 ;lib: export budgetReportAs* functions (to use in scripts) 2024-10-11 14:55:35 -10:00
Simon Michael
5f92fbd99a ;cabal: update cabal files 2024-10-10 23:25:07 -10:00
Simon Michael
66fce53c0b dev: extract beancount output helpers to Hledger.Write.Beancount 2024-10-10 23:25:07 -10:00
Simon Michael
a6a1b2c28e dev:bal: multiperiod balance now has two hledger.css links, fix 2024-10-10 22:00:27 -10:00
Simon Michael
efe9bd9f04 ;doc: REGRESSIONS: update 2024-10-10 09:54:32 -10:00
Simon Michael
7a88130922 ;examples: csv: add an example python converter script 2024-10-10 09:54:01 -10:00
Simon Michael
a6542e67db ;doc: REGRESSIONS: simplify, drop dates 2024-10-10 09:17:09 -10:00
Simon Michael
13f5361ecc ;doc: REGRESSIONS: edits 2024-10-10 08:30:15 -10:00
Simon Michael
bfad0ab2c4 ;doc: REGRESSIONS: drop colons, shrink 2024-10-10 08:24:30 -10:00
Simon Michael
16651c237d ;doc: REGRESSIONS: cleanup 2024-10-10 08:18:48 -10:00
Simon Michael
47277a1cd4 ;doc: REGRESSIONS: updates 2024-10-10 07:26:25 -10:00
Simon Michael
889de75839 ;doc: REGRESSIONS: update 2024-10-10 06:54:18 -10:00
Simon Michael
0cbb90cbaf ;tools: gtree: -u shows untracked files, -I adds ignored files 2024-10-10 06:51:30 -10:00
Simon Michael
ffe86d3541 doc: REGRESSIONS: update 2024-10-09 08:52:58 -10:00
Henning Thielemann
6b5a158935 cli: CompoundBalanceCommand: row_total_ -> multiBalanceHasTotalsColumn (bugfix)
This way, total column header is not shown in balancesheet.
This is consistent with table data and with compoundBalanceReportAsText.
2024-10-09 08:52:28 -10:00
Simon Michael
c969e66049 doc: REGRESSIONS: update 2024-10-08 23:21:33 -10:00
Simon Michael
4285efc013 ;doc: beancount output: edits 2024-10-08 23:11:57 -10:00
Simon Michael
21a84fb336 fix: calculate value correctly when P amounts have few decimal digits [#2254]
Valuation in another commoditay could sometimes be inaccurate if the P
price amounts did not have enough decimal places.
2024-10-08 23:11:57 -10:00
Simon Michael
4e6f6611a6 dev: fix DisplayName's off-by-one indent value, noted in #2246
Now displayIndent (and prrIndent) 0 means no indent, 1 means one
indent step, etc.
2024-10-08 23:11:57 -10:00
Simon Michael
05fd8e1d69 dev: refactor 2024-10-08 23:11:57 -10:00
Simon Michael
6ce5e85e99 dev: clarify: rename displayDepth/prrDepth to displayIndent/prrIndent
These are about indentation for rendering, not account depth;
these are not always directly related, eg when boring parents are elided.
2024-10-08 23:11:57 -10:00
Henning Thielemann
75ad734edf test: balance: adapt to newly implemented tree mode 2024-10-08 23:07:07 -10:00
Henning Thielemann
ccc605a6a0 cli: Cli.Commands.Balance.renderBalanceAcct: respect that depth is zero-based here (bugfix)
The depth in BalanceReportItem is zero-based,
whereas prrDepth in PeriodicReportRow DisplayName is one-based.
2024-10-08 23:07:07 -10:00
Henning Thielemann
6b0cca4fa8 cli: Cli.Commands.Balance.budgetReportAsSpreadsheet: support for tree mode
use renderPeriodicAcct
2024-10-08 23:07:07 -10:00
Henning Thielemann
e21a8e6d76 cli: Cli.Commands.Balance: use normal space for indentation in text output format 2024-10-08 23:07:07 -10:00
Henning Thielemann
3e2685fe95 cli: Cli.Commands.Balance: support tree mode for HTML, CSV and FODS output
indentation using non-breakable space character
2024-10-08 23:07:07 -10:00
Bas van Dijk
f8daba5e98 dev: remove the dead link: hledger/embeddedfiles/hledger-journal.md 2024-10-05 15:08:02 -10:00
Simon Michael
27c7b7489d ;doc: beancount output: discuss commodity names 2024-10-04 12:46:47 -10:00
Simon Michael
a248cc5bc8 ;doc: beancount output doc/conf file updates 2024-10-03 23:35:36 -10:00
Simon Michael
8c71d071d7 imp:print:beancount:convert account names more robustly; better errors 2024-10-03 23:19:32 -10:00
Simon Michael
cd101882f5 ;examples: hledger2beancount.conf 2024-10-03 23:19:32 -10:00
Simon Michael
79bc5852eb ;doc: output formats: expand, document beancount export and FODS 2024-10-03 22:57:59 -10:00
Simon Michael
b9426616f7 ;doc: bal: improve --layout doc 2024-10-03 22:57:59 -10:00
Simon Michael
e2e1afd8e6 ;examples: hledger.conf.sample: mention --infer-equity and account checking 2024-10-03 05:51:13 -10:00
Simon Michael
c50de03fd0 ;doc: note --infer-equity requires account declarations for check accounts
As reported on mail list.
2024-10-03 05:39:14 -10:00
Simon Michael
f54805a034 ;doc: update changelogs 2024-10-03 04:47:50 -10:00
Henning Thielemann
eeb070195c cli: Cli.Commands.Balance.multiBalanceReportAsHtml: now uses multiBalanceReportAsSpreadsheet
instead of multiBalanceReportHtmlRows.

This way, HTML output automatically supports transposition.
2024-10-02 17:32:57 -10:00
Henning Thielemann
afc320f1ba cli: Cli.Commands.Balance.multiBalanceReportAsSpreadsheetHelper -> multiBalanceReportAsSpreadsheetParts 2024-10-02 17:32:57 -10:00
Henning Thielemann
bb5e64c75f cli: Cli.Commands.Balance.budgetReportAsSpreadsheet: vertically merge duplicate account name cells
This is consistent with simple balance and multi-period balance reports.
2024-10-02 17:30:39 -10:00
Henning Thielemann
41397d0ca4 cli: compoundBalanceReportAsHtml - add class=account to Net row header 2024-10-02 17:29:05 -10:00
Simon Michael
5591be7724 dev: stack: silence wizards bounds warning, hopefully 2024-09-30 17:21:26 -10:00
Simon Michael
167303deb6 ;ci: windows, mac, linux-x64-stack: list dep versions before building hledger
For troubleshooting. stack doesn't do this itself, unlike cabal.
2024-09-30 17:21:26 -10:00
Simon Michael
f4bc6308ae ;ci: add trigger summaries as well 2024-09-30 17:21:26 -10:00
Simon Michael
4dc4dbc917 ;ci: windows, linux-x64-stack: add unit testing to these 2024-09-30 17:21:26 -10:00
Simon Michael
d8d236385d ;ci: linux: expect linux builds to be warning free like the rest 2024-09-30 17:21:23 -10:00
Simon Michael
bba77abcf6 ;ci: add consistent greppable summaries for all workflows 2024-09-30 17:21:02 -10:00
Simon Michael
1b643eb3e9 ;ci: mac: cleanup 2024-09-30 17:21:02 -10:00
Simon Michael
fd930ff567 dev: make func tests compatible with ghc 9.10
Work around ghc 9.10's extra newline in error output.
https://gitlab.haskell.org/ghc/ghc/-/issues/25116
2024-09-30 17:20:53 -10:00
Simon Michael
1c45496f1c dev: web: fix build with ghc <9.2 2024-09-30 17:20:13 -10:00
Simon Michael
10465ffbe5 ;ci: update all stack/cabal versions installed by ghcup to latest 2024-09-30 17:20:13 -10:00
Simon Michael
e157bb4a6b dev: Hledger.Write.Ods: fix build with ghc <9.6 2024-09-30 17:20:13 -10:00
Simon Michael
6773e92361 dev: Hledger.Write.Ods: follow global-then-local-imports convention 2024-09-30 17:20:13 -10:00
Simon Michael
daa3010c3e ;ci: binaries-linux-x64: fix addition of manuals to bindist 2024-09-30 17:20:13 -10:00
Simon Michael
bb551bf0dc ;doc: update changelogs 2024-09-30 17:20:13 -10:00
Simon Michael
8fdbcdda5d ;dev: stack: additional extra deps required on windows 2024-09-30 17:20:13 -10:00
Simon Michael
1a0b1034b6 dev: make ghc 9.10 the default for dev builds and some github actions 2024-09-30 17:20:13 -10:00
Simon Michael
ebd8a87177 dev: rename stack.yaml to 9.8 2024-09-30 17:20:13 -10:00
Simon Michael
c92b601028 dev: fix warnings with ghc 9.10 / base 4.20
Older ghc versions should also still build cleanly (tested with 9.8 so far).

I don't like enabling CPP in so many modules but it's easier that
figuring out how to do it with base-compat; hopefully no noticeable
compilation impact.
2024-09-30 17:20:13 -10:00
Simon Michael
1b60ebb61f ;cabal: update cabal files 2024-09-30 17:20:13 -10:00
Simon Michael
6225ac8a22 imp!: support ghc 9.10 / base 4.20
When built with ghc 9.10.1, hledger error messages are displayed
with an extra newline following them.
https://gitlab.haskell.org/ghc/ghc/-/issues/25116
2024-09-30 17:15:59 -10:00
Simon Michael
12481804cd ;doc: bal: tree mode html limitation, edit [#1846] 2024-09-29 22:20:33 -10:00
Simon Michael
944e27b342 ;doc: update manuals 2024-09-29 22:13:31 -10:00
Simon Michael
b17f6730d8 imp: areg: html output uses a hledger.css file if any, like balcmds 2024-09-29 22:12:57 -10:00
Simon Michael
4ef1db3725 ;doc: bal: note that tree mode doesn't work in html output [#1846] 2024-09-29 22:00:28 -10:00
Simon Michael
2d55a0e6aa ;doc: bal: also mention hledger.css and text encoding in balance doc 2024-09-29 21:47:13 -10:00
Simon Michael
c2800afeeb ;doc: html: note safari text encoding issue, 2 2024-09-29 21:30:52 -10:00
Simon Michael
e905a8de9e ;doc: html: note safari text encoding issue 2024-09-29 21:27:26 -10:00
Simon Michael
cc7ba473ec imp: bal: html output will use a hledger.css file, like bs/cf/is 2024-09-29 21:22:38 -10:00
Henning Thielemann
5565f11c73 cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: vertically merge cells showing account names and Total
lib: Write.Spreadsheet: add support for cell spans
2024-09-29 19:25:05 -10:00
Simon Michael
d12ec3b015 ;dev: stack: drop no longer needed brick override 2024-09-29 13:28:46 -10:00
Simon Michael
2cbea889f5 dev: lib: fix package.yaml, regen .cabal [#2244] 2024-09-29 13:27:51 -10:00
Henning Thielemann
2f9a8031b0 lib: Write.Html -> Write.Html.Lucid
Write.Html: keep common definitions for both HTML backends
2024-09-29 13:27:51 -10:00
Henning Thielemann
cc7e034d64 lib: Write.Html.Blaze: alternative to Lucid based export
for compatibility with hledger-web/yesod
2024-09-29 13:27:51 -10:00
Henning Thielemann
d8fc30f7c5 lib: Write.Html.Attribute.tableStyle: style definitions taken from Commands.Balance.multiBalanceReportAsHtml
avoid duplicate with Write.Html.printHtml

Write.Html.Attribute: remove dependency on Lucid
2024-09-29 13:27:51 -10:00
Simon Michael
a494e15d55 ;doc: update manuals 2024-09-29 12:13:50 -10:00
Simon Michael
d88e30ff43 ;doc: update help 2024-09-29 12:13:30 -10:00
Simon Michael
52402cd084 imp: bal: tweak --related, --transpose help 2024-09-29 12:12:15 -10:00
Simon Michael
e9a3f99553 imp: balcmds: support --count on all of them, why not 2024-09-29 12:12:15 -10:00
Simon Michael
40b8d2b517 imp: balcmds: tweak --base-url help [#2226] 2024-09-29 12:12:15 -10:00
Simon Michael
c8710958a6 imp: cli: more consistent options order between bal cmds 2024-09-29 11:39:23 -10:00
Simon Michael
5a4e5dc099 ;doc: bal: simplify hyperlinks doc a little [#2226]
I think this will be enough.
2024-09-29 11:31:04 -10:00
Henning Thielemann
e116b6af41 cli: Commands.Balance.composeAnchor: construct an anchor from Maybe base-url and query
Optionally add a missing trailing slash to the base URL.
2024-09-29 11:12:17 -10:00
Simon Michael
2a25bfdebc dev: fix typo in bal --base-url help [#2226] 2024-09-28 22:21:58 -10:00
Henning Thielemann
9cdd21bf6d cli: Commands.Balance.registerQueryUrl: correctly escape URL using modern-uri package 2024-09-28 22:12:51 -10:00
Henning Thielemann
3cd6e95746 doc: Commands/Balance.md: document hyperlinks and --base-url 2024-09-28 22:12:51 -10:00
Henning Thielemann
6e7324a36e cli: Command.Balance: pass command-line query to HTML and FODS hyperlinks 2024-09-28 22:12:51 -10:00
Henning Thielemann
cc86cd1f0e cli: Commands.Balance.multiBalanceReportAsSpreadsheet: add date query anchors to period headers 2024-09-28 22:12:51 -10:00
Henning Thielemann
499c626e48 lib: Write.Spreadsheet: support for anchors in HTML and FODS export
cli: Commands.Balance: new option --base-url
It adds hledger-web-compatible hyperlinks to account names.
2024-09-28 22:12:51 -10:00
Henning Thielemann
8744a0687c cli: CompoundBalanceCommand: use Html.Attribute.alignleft 2024-09-28 22:07:39 -10:00
Simon Michael
823be7c565 fix: csv: tags on following lines, and posting dates, also work now [#2241]
Follow-on work from #2214.
2024-09-28 18:54:43 -10:00
Simon Michael
b28468e651 dev: clarify some confusing comment parsers a bit [#2241] 2024-09-28 18:53:46 -10:00
Simon Michael
45b862f84f ;dev: bump to latest stackage nightly 2024-09-28 08:39:06 -10:00
Simon Michael
a637e08cdd ;doc: RELEASING: link to past releases 2024-09-27 10:28:52 -10:00
Simon Michael
eb9e4aa9b6 ;doc: demo: link asciinema 2024-09-27 01:30:53 -10:00
Simon Michael
c641cddbdc ;doc: dev: moved from 36 to 35 2024-09-27 01:27:59 -10:00
Simon Michael
15e3733d55 ;doc: commands: tweak wording 2024-09-27 01:27:48 -10:00
Simon Michael
03d7e46db3 ;doc: REGRESSIONS: updates 2024-09-26 06:22:53 -10:00
Simon Michael
bf6440095f ;doc: REGRESSIONS: updates, cleanups 2024-09-25 17:05:53 -10:00
Simon Michael
c1a269da6a ;doc: REGRESSIONS: more hyphens indicating heading rows 2024-09-24 23:51:48 -10:00
Simon Michael
19391a82a3 ;doc: REGRESSIONS: layout 2024-09-24 23:46:24 -10:00
Simon Michael
5232a1a19d ;doc: REGRESSIONS: heading tweak 2024-09-24 23:42:23 -10:00
Henning Thielemann
6ce6c72fd4 lib: Write.Html.Attributes: extracted HTML output helpers from Cli.Commands.Balance 2024-09-24 22:51:30 -10:00
Simon Michael
4960d5f533 ;doc: REGRESSIONS: more updates, and fix details for #2115 2024-09-24 22:36:17 -10:00
Simon Michael
c73744938e ;doc: timedot: mention the common journal+timedot file setup [#2238] 2024-09-24 21:32:26 -10:00
Simon Michael
e6f988406f ;doc: REGRESSIONS 2024-09-24 20:54:30 -10:00
Henning Thielemann
441f46fc06 lib: Tabular.AsciiWide.renderRs: simplify using flattenHeader 2024-09-24 20:50:54 -10:00
Henning Thielemann
b74815287d web: RegisterR.getRegisterR.addCommas: do not drop last account
Bug was introduced in commit 2a99b3d456
in an effort to get rid of partial List.tail,
because GHC-9.8 started to warn about it.

Problem is that the rewritten code with tailDef always removes the last account,
whereas the original intention was to replace all accounts by a comma except the last one.
addCommas should prepare a comma separated list like List.intercalate.
2024-09-24 20:42:32 -10:00
Simon Michael
07b3cc495b fix: web: enable autocomplete in newly created account fields [#2215] 2024-09-24 09:35:35 -10:00
Simon Michael
896a20ad98 dev: web: cleanup: more explicit globals; and match inputs more carefully [#2215]
(Don't match the hidden duplicate inputs created by typeahead.js)
2024-09-24 09:35:35 -10:00
Simon Michael
e77f733b30 ;doc: REGRESSIONS: updates 2024-09-22 07:20:55 -10:00
Simon Michael
8521ef6d6b ;doc: REGRESSIONS: layout 2024-09-20 08:07:09 -10:00
Simon Michael
73538af8f9 ;doc: REGRESSIONS: updates 2024-09-20 08:04:51 -10:00
Simon Michael
c718336f57 ;doc: REGRESSIONS: layout 2024-09-18 12:35:38 -07:00
Simon Michael
fadec41131 ;doc: REGRESSIONS: layout 2024-09-18 12:34:03 -07:00
Simon Michael
7851180cf0 ;doc: REGRESSIONS: updates 2024-09-18 12:30:34 -07:00
Simon Michael
e8068781df ;doc: REGRESSIONS: new table format; updates 2024-09-18 12:23:23 -07:00
Henning Thielemann
144098e407 cli: CompoundBalanceCommand.compoundBalanceReportAsHtml: create according TH cells only if row-total or average is requested
fixed bug #2225
2024-09-18 12:17:00 -07:00
Bas van Dijk
fb47073c91 fix: amount formatting of the Net row in the balancesheet HTML output
The "Net" row in the HTML output of balancesheet formatted amounts using machineFmt which is inconsistent with all the other amounts in the balance sheet. This fixes that by formatting Net amounts using oneLineNoCostFmt.
2024-09-18 10:08:19 -07:00
Simon Michael
5ea99c1a26 ;doc: shell-completion/README: start documenting packaging status [#986] 2024-09-17 11:30:10 -07:00
Simon Michael
f76307bcdb ;doc: shell-completion/README: packager notes [#986] 2024-09-17 11:25:52 -07:00
Simon Michael
2a054a3cc8 ;doc: shell-completion/README: update [#986] 2024-09-17 10:54:57 -07:00
Simon Michael
9589941bb4 ;doc: update changelogs 2024-09-17 07:20:27 -07:00
Simon Michael
ff0fe62fac ;doc: cli, ui, web: mention/link to shell completions 2024-09-17 06:39:23 -07:00
Simon Michael
69da3c0a17 ;pkg: include man pages and info manuals in the release bindists 2024-09-17 06:27:19 -07:00
Simon Michael
68f1395b0d ;ci: binaries-linux-arm32v7: notes, disable wrong completions addition [#2223] 2024-09-16 19:19:34 -07:00
Simon Michael
022c35697c ;doc: RELEASING 2024-09-16 15:10:25 -07:00
Simon Michael
f0b97ecfb7 ;ci: release: notes 2024-09-16 15:09:27 -07:00
gesh
f7f0a817fe Add bash completion to bindist 2024-09-16 15:00:09 -07:00
Simon Michael
e2a824eff2 fix: shell-completion: update these for hledger 1.40 2024-09-14 17:30:29 -07:00
Simon Michael
2b80910a59 ;dev: shell-completion: fix/update commands list parsing 2024-09-14 17:30:29 -07:00
Simon Michael
e330ec9424 ;dev: cli: doc cleanups 2024-09-13 12:33:16 -07:00
Simon Michael
6f10818544 ;doc: config files: shebang line examples 2024-09-13 12:29:59 -07:00
Simon Michael
a0303824ae ;doc: config files: mention command argument limitation [#2231] 2024-09-13 12:21:44 -07:00
Simon Michael
e1c91e8ed4 ;doc: simplify new bug template 2024-09-13 11:51:35 -07:00
Simon Michael
2907b3bb42 ;doc: simplify new bug template 2024-09-13 11:49:26 -07:00
Simon Michael
c2303fe522 ;install: fix installation of hledger-ui, 2 2024-09-12 02:51:55 -07:00
Simon Michael
b5b62ebd97 ;install: fix installation of hledger-ui 2024-09-12 02:49:40 -07:00
Simon Michael
d2793dfd3a ;dev: cleanup: fix Balance.hs typo 2024-09-11 14:01:53 -07:00
Simon Michael
0b95ff0aa5 ;dev: cleanup: drop obscure todo comment [#2222] 2024-09-11 14:00:28 -07:00
Simon Michael
b81690522d ;doc: CODE: notes on the use of haddock [#2222] 2024-09-11 13:58:08 -07:00
Henning Thielemann
fdc3e674a5 cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: return header separately 2024-09-11 13:51:09 -07:00
Henning Thielemann
5a7d0687d5 cli: Commands.Balance.multiBalanceRowAsTextBuilders, multiBalanceReportAsCsvHelper: helper functions removed 2024-09-11 13:51:09 -07:00
Henning Thielemann
ff397f79cc lib: Write.Spreadsheet.Cell: add cellClass field for HTML style class
cmd: Commands.Balance.multiBalanceRowAsCellBuilders: add HTML style class attributes here
This way we do not need to dissect table rows in
multiBalanceReportHtmlHeadRow, multiBalanceReportHtmlBodyRow, multiBalanceReportHtmlFootRow
Eventually removed these three functions.
2024-09-11 13:51:09 -07:00
Henning Thielemann
2fcf793221 cli: Commands.Cli.Balance.rawTableContent: helper function for extracting CSV from Spreadsheet cells 2024-09-11 13:51:09 -07:00
Henning Thielemann
df9531a6b7 cli: Commands.Balance.balanceReportAsSpreadsheet, multiBalanceReportAsSpreadsheet: support for transposition 2024-09-11 13:51:09 -07:00
Henning Thielemann
55c1246598 cli: Commands.Balance.budgetReportAsSpreadsheet: also transpose border 2024-09-11 13:51:09 -07:00
Henning Thielemann
2ed13afed4 lib: Write.Spreadsheet: support for borders like in existing HTML export
cli: Commands.Balance: use for FODS export and balance and budget export to HTML
2024-09-11 13:51:09 -07:00
Simon Michael
9ff1ee9127 ;doc: relnotes: expand FODS description 2024-09-10 11:54:11 -07:00
Simon Michael
fe7b69fc7c ;doc: relnotes: simplify highlights 2024-09-10 11:49:04 -07:00
Simon Michael
63a83926da ;doc: ROADMAP 2024-09-09 15:54:06 -07:00
Simon Michael
add7028f75 ;tools: ghrelnotes: edit 2024-09-09 15:27:27 -07:00
Simon Michael
2513c0205b ;ci: release: notes 2024-09-09 15:27:18 -07:00
Simon Michael
e1a8b9c62f ;doc: cli changelog: cleanup 2024-09-09 15:07:18 -07:00
Simon Michael
30aeb662f2 doc: update manuals 2024-09-09 14:09:28 -07:00
Simon Michael
91db5ef5d1 ;doc: update help 2024-09-09 14:07:07 -07:00
Simon Michael
27e6eb0024 ;cabal: update cabal files 2024-09-09 14:06:06 -07:00
Simon Michael
c079725836 ;pkg: bump version to 1.40.99 2024-09-09 14:06:06 -07:00
Simon Michael
e494c98f9d ;install: bump date 2024-09-09 14:04:55 -07:00
Simon Michael
7d908818d7 ;tools: shake manuals -c: also commit COMMAND.md files 2024-09-09 14:04:50 -07:00
Simon Michael
a505ffd3bf ;doc: update help 2024-09-09 14:04:43 -07:00
Simon Michael
a5fb7d639e ;tools: shake cmddocs -c: also commit COMMAND.md files 2024-09-09 14:04:43 -07:00
Simon Michael
2c7c2c6d05 ;tools: shake: cleanup, note dependency issues 2024-09-09 14:04:43 -07:00
Simon Michael
e79f45a737 ;tools: shake build: fix with no arguments 2024-09-09 14:04:43 -07:00
Simon Michael
33d9b6f35d ;doc: announce: 1.40 2024-09-09 14:04:43 -07:00
Simon Michael
59d0ed1cd8 ;doc: relnotes: 1.40
And add 1.34 highlights.
2024-09-09 14:04:43 -07:00
Simon Michael
5cbbdb4670 imp: reg --sort: show supported keys in help and error message [#2211] 2024-09-09 14:04:43 -07:00
Simon Michael
3b73360584 ;doc: update changelogs 2024-09-09 14:04:43 -07:00
Simon Michael
483350c8cb ;tools: relnotes: more output, robustness 2024-09-09 14:04:43 -07:00
Simon Michael
dda3855ba2 ;cabal: update cabal files 2024-09-09 14:04:43 -07:00
Simon Michael
eaa494a4cb ;pkg: allow doclayout 0.5 2024-09-09 14:04:43 -07:00
Simon Michael
6f07328501 ;examples: csv: monzo 2024-09-09 14:04:43 -07:00
Simon Michael
979c387663 ;doc: changelogs: 1.40 2024-09-09 14:04:08 -07:00
Simon Michael
105670edad ;doc: Config files: rewrite 2024-09-09 14:04:02 -07:00
Simon Michael
0088490701 ;doc: update sample config files 2024-09-09 14:04:02 -07:00
Simon Michael
55d47ceacd fix:pkg:ui: avoid brick 2.3.2 which doesn't build on windows
That version depends on unix as well as unix-compat.
2024-09-09 14:03:41 -07:00
Simon Michael
53373d9620 install: bump versions 2024-09-09 14:03:35 -07:00
Simon Michael
08a356a7cb ;dev: pkg: bump to latest nightly stackage snapshot 2024-09-09 14:03:35 -07:00
Simon Michael
30b58272b8 ;dev: cleanup [#2218] 2024-09-09 11:04:26 -07:00
Michael Rees
e34fa491af Add abs implementation for MixedAmount 2024-09-05 11:56:07 +01:00
Michael Rees
52253c01f6 Add absamount as --sort field for register 2024-09-05 11:56:07 +01:00
Michael Rees
d96e3a1e5a ;Include desc/description field in help text for --sort 2024-09-05 11:56:07 +01:00
Michael Rees
693360344c Add desc/description as possible sort field 2024-09-05 11:56:07 +01:00
Michael Rees
25bcf3eebb ;Don't apply sort spec when only sorting by date
If there is no sort spec given, then the postings are already sorted by
date, so there's no need to apply the default sort spec again.
2024-09-05 11:56:07 +01:00
Michael Rees
275c72b770 ; Use defsortspec everywhere instead of hard-coding default 2024-09-05 11:56:07 +01:00
Michael Rees
74db7f688c Document register --sort in Register.md 2024-09-05 11:56:07 +01:00
Michael Rees
b429f57afb Show error message on conflicting --sort and -H 2024-09-05 11:56:07 +01:00
Michael Rees
4b564966c9 Improve register --sort help message 2024-09-05 11:56:07 +01:00
Michael Rees
b4a9f87fe4 Move SortSpec to Hledger.Reports.ReportOptions
As part of this migration, I also switched from using Data.List.splitOn
to Hledger.Utils.splitAtElement.
2024-09-05 11:56:07 +01:00
Michael Rees
00eb0aa16b feat: register: add --sort as in ledger 2024-09-05 11:56:07 +01:00
Simon Michael
c24c09337c ;doc: whitespace 2024-09-04 16:26:41 +01:00
Henning Thielemann
57b2d02760 cli: Commands.Balance.budgetReportAsSpreadsheetHelper: no longer needed 2024-09-04 16:15:19 +01:00
Henning Thielemann
2d59bc8591 cli: Commands.Balance.budgetReportAsCsv, budgetReportAsSpreadsheet: remove duplicate transposition 2024-09-04 16:15:19 +01:00
Simon Michael
3fbad1892d dev: rename some Intervals for clarity [#2218] 2024-09-04 16:07:54 +01:00
Simon Michael
038ebd8c7a fix: three more interval start date cases; add tests; cleanup [#2218] 2024-09-04 16:07:54 +01:00
Simon Michael
c8b6ca7b70 fix: 'every Nth day of month from DATE' start date [#2218] 2024-09-04 16:07:54 +01:00
Simon Michael
e2053374f5 ;doc: relnotes: correction to 1.29's date adjustment notes [#1982], [#2218] 2024-09-04 16:07:54 +01:00
Simon Michael
7fe6de02cf ;doc: date adjustments, period headings: rewrite, clarify [#2218] 2024-09-04 16:07:54 +01:00
Simon Michael
ceb7f289f5 ;dev: Justfile: cleanups 2024-09-04 15:30:38 +01:00
Simon Michael
e9a52b4b9c ;bin: bashrc: also define TIMEDOT 2024-09-04 15:30:38 +01:00
Simon Michael
6fc117fa15 ;cabal: update cabal files [#2213] 2024-08-29 23:20:39 +01:00
Simon Michael
375fb07ede ;dev: cleanups 2024-08-29 10:07:02 +01:00
Simon Michael
6355134592 ;doc: input: clarify multiple -f options allowed 2024-08-29 10:07:02 +01:00
Arto Jonsson
f001b23114 ;examples: csv: add Nordea CSV rules file 2024-08-20 20:06:58 +01:00
Simon Michael
982401704f
Merge pull request #2213 from thielema/balance-export-fods
Balance export FODS and HTML
2024-08-16 17:35:38 +01:00
Henning Thielemann
fdc007d446 doc: hledger.m4.md: new column for FODS
balance support for HTML export is now complete
2024-08-16 16:57:38 +02:00
Henning Thielemann
70e556998f cli: Command.Balance.budgetReportAsSpreadsheet: support for budget export to HTML and FODS 2024-08-16 16:57:38 +02:00
Henning Thielemann
3af8eb3bc6 cli: Command.Balance: use Date format for dates in LayoutTidy 2024-08-16 16:57:38 +02:00
Henning Thielemann
da61b64f94 cli: Command.Balance: support FODS export for multibalance
Data.Amount.showMixedAmountLinesPartsB: new helper function
2024-08-16 16:57:38 +02:00
Henning Thielemann
66a047aade lib: Write.Spreadsheet.Cell: add type parameter for the text type
instance Functor Cell
This way you can choose between Text, Lazy.Text, WideBuilder for cell content.
2024-08-16 16:57:38 +02:00
Henning Thielemann
f306df6d61 imp: lib: Write.Html: use Lucid to generate HTML 2024-08-16 16:57:38 +02:00
Henning Thielemann
48723c930c cli: Cli.Balance.balanceReportAsCvs: now based on balanceReportAsSpreadsheet
This warrants consistency of ODS, HTML and CSV export.
2024-08-16 16:57:38 +02:00
Henning Thielemann
37be769540 doc: Commands/Balance.md: mention FODS export format 2024-08-16 16:57:38 +02:00
Henning Thielemann
8c42a735c2 cli: lib: Write.Spreadsheet: common data types for Write.Ods and Write.Html
Write.Html: write spreadsheet data to a HTML table

enables HTML export for the balance command
2024-08-16 16:57:38 +02:00
Henning Thielemann
29b67691fb cli: Write.Ods: also use a number cell if the total amount has a single commodity 2024-08-16 16:57:38 +02:00
Henning Thielemann
2a1f3920c6 lib: Write.Ods.escape: escape cell contents 2024-08-16 16:57:38 +02:00
Henning Thielemann
ba0db5feec cli: Write.Ods: write single amounts as numbers with units
This way you can do computations with the numbers in LibreOffice Calc.
2024-08-16 16:57:38 +02:00
Henning Thielemann
7b136600fa cli: Cli.Balance.balanceReportAsFods: use distinguished cell formatting styles 2024-08-16 16:57:38 +02:00
Henning Thielemann
0e158d0c3e cli: lib: Hledger.Write.Ods: basic support for FODS export
used in Commands.Balance
2024-08-16 16:57:38 +02:00
Henning Thielemann
14b5a1f82a imp: Hledger.Read.CsvUtils -> Write.Csv 2024-08-16 16:57:38 +02:00
Simon Michael
bafe70efb4 ;doc: scripts and add-ons: edits 2024-08-12 11:59:41 +01:00
Simon Michael
aa7a38f586 ;doc: update stack doc urls 2024-08-12 11:55:06 +01:00
Simon Michael
a0c8237697 ;doc: scripts and add-ons: edits 2024-08-12 11:40:59 +01:00
Simon Michael
b352a5e281 ;doc: scripts and add-ons: edits 2024-08-12 11:36:58 +01:00
Simon Michael
1fd6fbb4f7 ;doc: scripts and add-ons: edits 2024-08-12 11:10:13 +01:00
Simon Michael
6670c465d1 ;doc: scripts and add-ons: edits 2024-08-12 11:06:11 +01:00
Simon Michael
397a464aeb ;doc: bin readme/Scripts and add-ons: rewrites, list add-ons again 2024-08-12 11:00:54 +01:00
Simon Michael
d6b905fa08 ;bin: bashrc: updates 2024-08-12 08:48:42 +01:00
Simon Michael
7e684116f2 ;install: refactor, bump snapshot, perhaps fix hledger-interest install 2024-08-10 08:34:54 +01:00
Simon Michael
cfe8182c78 ;install: clarify some stack/cabal setup messages 2024-08-10 08:34:23 +01:00
Simon Michael
b99c4f75d2 ;doc: timeclock: edits 2024-08-06 18:19:33 +01:00
Simon Michael
ee629b98ce ;doc: timeclock: fix layout 2024-08-06 18:14:56 +01:00
Simon Michael
2fbd81df2d ;doc: timeclock: fix ti/to scripts 2024-08-06 18:13:27 +01:00
Simon Michael
a22901a983 ;bin: bashrc updates 2024-08-06 18:12:52 +01:00
Simon Michael
1f880f39bd ;bin: drop silly diff alias 2024-08-04 19:16:22 +01:00
Simon Michael
d19b353bfb imp: improve bad regexp error message
Eg '(?:foo)' is not malformed, it's just not supported.
https://hledger.org/hledger.html#hledgers-regular-expressions
2024-07-24 11:06:13 +01:00
Simon Michael
fa8d223858 imp: web: guess a more robust base url when --base-url is not used
A followup to #2099, #2100 and #2127. Now relative links to js/css
resources will use the same hostname etc. the main page was requested
from, making them work better when accessed via multiple IP
addresses/hostnames without an explicit --base-url setting.
2024-07-18 10:12:40 +01:00
Simon Michael
13a5299237 imp: web: require a http[s] scheme in --base-url
Previously it accepted just a hostname, and generated bad links.
2024-07-18 10:10:26 +01:00
Simon Michael
c0a4983e87 ;dev: web: refactor 2024-07-18 09:14:56 +01:00
Simon Michael
957b217386 ;examples: hledger.conf updates 2024-07-17 15:09:54 +01:00
Simon Michael
4ad4ddf0c9 ;examples: hledger.conf updates 2024-07-17 08:42:37 +01:00
Simon Michael
165e70df7a imp: bs,cf,is: show interval in report title
This makes the report interval clearer, eg when it's set unexpectedly
by a config file.
2024-07-17 08:26:43 +01:00
Simon Michael
224e0bfb38 ;examples: hledger.conf updates 2024-07-17 07:39:11 +01:00
Simon Michael
58c5b0803b ;doc: readme: fix contributors link 2024-07-17 07:06:12 +01:00
Simon Michael
e795666f53 ;examples: hledger.conf updates 2024-07-17 06:49:14 +01:00
Simon Michael
185c336bff ;examples: hledger.conf updates 2024-07-17 06:46:12 +01:00
Simon Michael
823ac9246b ;examples: hledger.conf updates 2024-07-17 06:39:29 +01:00
Simon Michael
1e62cb4c2f ;examples: hledger.conf updates 2024-07-17 06:34:31 +01:00
Simon Michael
0e5708729f ;doc: date adjustments: edits 2024-07-16 22:45:31 +01:00
Simon Michael
776ad26b55 ;doc: date adjustment: rewrite, fix description of end date adjustment 2024-07-16 22:30:35 +01:00
Simon Michael
a1c6a409bc ;dev: clean up dates, intervals func tests 2024-07-16 22:12:51 +01:00
Simon Michael
4b3abfd470 ;imp: check: recentassertions: improve message readability 2024-07-16 22:12:41 +01:00
Simon Michael
4b4d35fb80 ;doc: cli: fix another hledger and Ledger link [hledger_site#112] 2024-07-15 09:55:48 +01:00
Simon Michael
8bb4831053 ;doc: cli: Journal: fix hledger and Ledger link [hledger_site#112] 2024-07-15 09:42:40 +01:00
Simon Michael
f25b9ee4ae imp: conf: rightmost of --conf/--no-conf options wins 2024-07-14 12:43:17 +01:00
Simon Michael
098acb422b ;tools: make justfiles compatible with just 1.28+ 2024-07-14 09:44:54 +01:00
Simon Michael
b4e96c8f0e ;dev: .ghci: cleanup 2024-07-13 07:32:18 +01:00
Simon Michael
27408092bd ;dev: just: cleanup 2024-07-13 07:11:04 +01:00
Simon Michael
6f3c4c9bf0 fix: cli: accept --conf with no command 2024-07-12 15:41:53 +01:00
Simon Michael
85480a7572 fix: cli: move pre-command --debug option more carefully; cleanup 2024-07-12 15:23:03 +01:00
Simon Michael
06f5075b6b ;doc: bin/README, Scripts page: justfile -> Justfile 2024-07-12 14:21:33 +01:00
Simon Michael
d76dff310a imp: ui: menu screen: show narrowed period in header; cleanup 2024-07-12 13:49:33 +01:00
Simon Michael
e3c414fe59 ;dev: cli: clarify that conf debug output goes to console 2024-07-12 13:29:14 +01:00
Simon Michael
a059c9e8cc ;cabal: update cabal files 2024-07-12 12:55:29 +01:00
Simon Michael
5b00566a70 ;pkg: ui: allow brick 2.4 2024-07-12 12:47:02 +01:00
Simon Michael
0d878415e9 ;pkg: stack: bump to latest nightly; bump various script snapshots 2024-07-12 12:45:00 +01:00
Simon Michael
dcf0249c8c ;fix: add help: D does not cause it to add the symbol 2024-07-10 21:43:17 +01:00
Simon Michael
6d8ce1dc16 ;doc: ui: fix the description of the Shift-T key 2024-07-07 23:57:01 +01:00
Simon Michael
a8f1968d4b imp: ui: menu screen: support the shift arrow and shift T keys, for consistency 2024-07-07 23:36:33 +01:00
Simon Michael
cc88617c70 ;doc: ui: CHANGES: 1.23: mention the #822 fix 2024-07-07 23:30:55 +01:00
Simon Michael
2f7eae0e35 ;doc: ui: keys: updates, clarify period narrowing & shift arrow keys 2024-07-07 23:18:28 +01:00
Simon Michael
7020ed3023 ;bin: bashrc: add years, eachyear scripts 2024-07-06 17:25:22 +01:00
Simon Michael
cc1797253e bin: simplebal: ignore config files 2024-07-06 17:12:08 +01:00
Simon Michael
cdc6987e76 imp: cli: demote some debug output 2024-07-06 17:12:08 +01:00
Simon Michael
65ac41e155 fix: cli: move flags with shadowed names, like -p, more carefully 2024-07-06 17:12:08 +01:00
Simon Michael
17e292eddd ;doc: config file: updates 2024-07-06 10:36:50 +01:00
Simon Michael
321cdca918 ;bin: shell aliases cleanup 2024-07-06 06:58:16 +01:00
Simon Michael
84da054baf ;bin: shell aliases cleanup 2024-07-06 06:53:44 +01:00
Simon Michael
cf0c7c2ef8 ;bin: hledger-script-example: explain shebang commands better 2024-07-02 13:34:48 +01:00
Simon Michael
21465c050b ;examples:csv: tiller.csv.rules 2024-07-02 01:07:54 +01:00
Simon Michael
d354395743 ;dev: gitignore 2024-07-01 23:36:46 +01:00
Simon Michael
2303147fa4 imp: files: support conf flags (and other hidden flags) 2024-07-01 23:06:14 +01:00
Simon Michael
b33d2a8f91 imp: conf: fail if --conf file is bad; improve debug output; refactor 2024-07-01 23:06:14 +01:00
Simon Michael
b54a31d585 imp: conf: --debug 1: show all conf files found 2024-07-01 23:06:14 +01:00
Simon Michael
1996630b09 imp: cli: --debug: demote large CliOpts output to level 2 2024-07-01 23:06:14 +01:00
Simon Michael
6af992bc3a dev: consolidate/update cli/addons tests 2024-07-01 23:06:14 +01:00
Simon Michael
2ab8ac31f4 fix: cli: more cli parsing fixes; debug output improvements 2024-07-01 22:50:44 +01:00
Simon Michael
2a6a5ea042 fix: conf: fix passing of general options to ui, web 2024-07-01 08:10:40 +01:00
Simon Michael
65c30bceb6 ;doc: update manuals 2024-06-27 00:24:23 +01:00
Simon Michael
e0cbe65d9b ;tools: Shake txtmanuals: silence all but wide table warnings 2024-06-27 00:24:09 +01:00
Simon Michael
d35e4bde11 ;doc: cli: fix some manual warnings 2024-06-27 00:24:09 +01:00
Simon Michael
6aa1bbc18a ;doc: --debug help tweak 2024-06-26 23:24:41 +01:00
Simon Michael
26978ffc26 imp: config file: sample: simplify 2024-06-25 18:37:55 +01:00
Simon Michael
b8706dee56 ;doc: config files: edits 2024-06-25 18:37:55 +01:00
Simon Michael
5f285a56ab doc: update manuals 2024-06-25 18:37:55 +01:00
Simon Michael
d9f314dfa3 ;doc: update help 2024-06-25 18:37:55 +01:00
Simon Michael
9a89adf737 ;tools: Shake cmddocs: improve help 2024-06-25 18:37:55 +01:00
Simon Michael
5c45963a07 ;doc: config files 2024-06-25 18:37:55 +01:00
Simon Michael
40620666f8 imp: cli: rename --rules-file to --rules; tweak options help
For brevity, and consistency with --conf.
--rules-file remains supported, as a hidden option.

hledger's main mode now supports the hidden legacy flags,
as the command modes do.
2024-06-25 18:37:55 +01:00
Simon Michael
5739bff249 imp: config file: --conf, --no-conf/-n, improve debug output 2024-06-25 18:37:55 +01:00
Simon Michael
6180a162b2 imp: config file: also try parent dirs 2024-06-25 18:37:55 +01:00
Simon Michael
f89e62cb6f imp: config file: also try home and XDG config dirs 2024-06-25 18:37:55 +01:00
Simon Michael
d76677c6ad imp: config file: don't require -- before addon-specific opts 2024-06-25 18:37:55 +01:00
Simon Michael
361b0016ff fix: cli: ensureDebugFlagHasVal: fix multiple --debug flags not just one 2024-06-25 18:37:55 +01:00
Simon Michael
66f4091b38 fix: cli: don't let a valueless --debug flag eat the command name 2024-06-25 18:37:55 +01:00
Simon Michael
6c294e91d6 fix: ui, web: accept valueless --debug flag again 2024-06-25 18:37:55 +01:00
Simon Michael
0c9b704bcc fix: config file: pass only post-cmd and cmd-specific conf opts to addons 2024-06-25 18:37:55 +01:00
Simon Michael
3345adb2fc dev: refactor: cli main procedure 2024-06-25 18:37:55 +01:00
Simon Michael
969b5a89d1 dev: comment parsing tests/refactoring, fix indented timedot comments 2024-06-25 18:37:54 +01:00
Simon Michael
713c3f4067 imp: TimedotReader: trace parsing at debug level 9 2024-06-25 18:37:54 +01:00
Simon Michael
b3e648a2db feat: config file: rename/update sample config 2024-06-25 18:37:54 +01:00
Simon Michael
6b24c09a58 feat: config file: ignore unsupported general options; refactor 2024-06-25 18:37:54 +01:00
Simon Michael
3797fe13d3 imp: move --debug to help flags, making it more universal 2024-06-25 18:37:54 +01:00
Simon Michael
e1991be46f feat: config file: add a real parser, support command-specific options 2024-06-25 18:37:54 +01:00
Simon Michael
4175dc50ac ;cabal: update cabal files 2024-06-25 18:37:54 +01:00
Simon Michael
f5c2ec681c dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse 2024-06-25 18:37:54 +01:00
Simon Michael
07a4b21620 dev: refactor: move emptyorcommentlinep'; hlint 2024-06-25 18:37:54 +01:00
Simon Michael
46cda5e7de imp: cli: allow command options to be written before the command also
It's clearer to write command-specific flags after the command name
argument, but that's no longer required.
(Writing non-builtin, addon-specific flags after -- is still required).

Also, give up on "obey help/doc/version flags even if there's a bad
command/flag", it's too hard to do well.
2024-06-25 18:37:54 +01:00
Simon Michael
570a5472e2 dev: cli: refactor/clarify main procedure and command line processing 2024-06-25 18:37:54 +01:00
Simon Michael
204df22739 feat: cli: basic config file support for hledger
And some refactoring of command line parsing code.

General options only, in ./hledger.conf, for now.
2024-06-25 18:37:54 +01:00
Simon Michael
6c47fa034a ;dev: update doctests for weekly headings change [#2204] 2024-06-25 18:36:43 +01:00
Simon Michael
a734ba5026 ;dev: update tests for weekly headings change [#2204]
Unfortunately our ci workflow does not reliably detect commit messages
with PRs, and in this case it wrongly identified the commit as a
harmless doc change.
2024-06-25 09:06:29 +01:00
Simon Michael
831b4638cb ;tools: just twih: date fixes 2024-06-25 07:45:27 +01:00
Simon Michael
007f2eba15 ;tools: just ghci: -fobject-code was a mistake, keep everything interpreted
Note: stack clean --full wasn't enough to reset things after removing
this flag, rm `fd -e o -e hi` was needed.
2024-06-25 07:45:27 +01:00
Simon Michael
f847ef63e2 ;fix: bin: register-max: update/fix 2024-06-25 07:45:27 +01:00
Simon Michael
49c4ccd0b7 dev: Hledger.Utils.IO: fix hlint warnings 2024-06-25 07:45:27 +01:00
Victor Mihalache
60efd035f5 imp: abbreviate week naming for weekly reports 2024-06-14 09:37:32 +01:00
Simon Michael
83bd98076a ;doc: box-drawing: edits 2024-06-12 18:39:27 +01:00
Simon Michael
aa5bca04d3 ;doc: box-drawing: edits 2024-06-12 18:36:10 +01:00
Simon Michael
2916b12651 ;doc: mention --pretty's new border-enabling behaviour 2024-06-12 18:24:32 +01:00
Simon Michael
de617ec91b imp: balcmds: improve html output; refactor
The Total: row headings are now configurable in one place,
and currently disabled for text output and enabled for csv & html.

The balance commands' HTML output no longer repeats the "total" and
"Net" headings when the totals row has multiple lines.
And the layout has been improved and made more consistent with the
text output.
2024-06-12 18:04:56 +01:00
Simon Michael
85dde3bac9 dev: refactor: balance report rendering 2024-06-12 15:28:51 +01:00
Simon Michael
1b4b079f4d imp: balcmds: with --pretty, show table and inter-column borders 2024-06-12 05:02:08 +01:00
Simon Michael
574115e001 imp: balcmds: csv, html output: change "total" row header to "Total:" 2024-06-12 05:02:08 +01:00
Simon Michael
9788a06223 fix: balcmds: don't repeat "total" and "Net:" headers in HTML output 2024-06-12 05:02:04 +01:00
Simon Michael
1a242c1264 dev: refactor table rendering code
- Consolidate some table rendering helpers in Balance.hs
- Rename, document for clarity
- Extract parameters for controlling table borders
- hlint suggestions
2024-06-12 05:01:48 +01:00
Simon Michael
1260a68596 dev: CompoundBalanceCommand: refactor table rendering 2024-06-12 05:01:48 +01:00
Simon Michael
9d6cb0f969 tools: functest: try again to reduce rebuilding/slowdowns when testing
--fast is always fighting with my non-fast builds and defeating the purpose.
--threads 64 was making my macbook air m1 stutter, 32 seems better.
2024-06-12 05:01:48 +01:00
Simon Michael
5b83e5c2f0 ;dev: cleanup [#2202] 2024-06-10 08:46:19 +01:00
Simon Michael
e89bea8563 fix: handle account type declarations in multiple files correctly [#2202]
Tags and types declared in account directives in sibling files or
included files are now combined more carefully.

In particular, when merging two Journals into one,

- jdeclaredaccounttags and jdeclaredaccounttypes no longer lose information;
  any duplicated/conflicting tag/type values are preserved.

- jaccounttypes now prefers the last type declared in case of
  conflict, not the first.
2024-06-10 08:32:54 +01:00
Simon Michael
7804685b09 ;dev: test: multiple-files: convert to latest shelltest format 2024-06-10 08:26:58 +01:00
Simon Michael
8d1ad8a3fe lib: add journalDbg, for inspecting Journal fields 2024-06-10 08:26:58 +01:00
Simon Michael
a3a0f87997 ;doc: cli: mention --tldr near the start [#2201] 2024-06-08 13:29:35 -07:00
Simon Michael
4900072ff8 imp: mention the tldr --render flag in the failure warning [#2201] 2024-06-08 13:29:32 -07:00
Simon Michael
971396a34e imp: discourage auto-update of tldr db when using tldr-node-client 2024-06-08 10:23:05 -07:00
Simon Michael
4772001fe5 fix: make --tldr compatible with the tealdeer client also 2024-06-08 10:22:44 -07:00
Simon Michael
1d7fdd423d ;tools: Shake: fix partial warnings 2024-06-07 18:49:23 -07:00
Simon Michael
8e0326b521 ;tools: Shake cmddocs: ignore failures when running hledger -h
Eg if it's not yet built/buildable, carry on without updating the flag docs.
2024-06-07 18:46:58 -07:00
Simon Michael
91d5308783 ;tools: Shake cmdhelp -> cmddocs, now runs hledger to update flag docs
Now, updating a command's docs (for hledger manual and for --help) requires
running the command (with stack exec -- hledger). The sequence is now
a bit recursive:

1. Run hledger CMD -h to update CMD.md with the latest cmdargs help output for CMD's flags.
   CMD.md is included in the hledger manual, when rendering that.
2. Convert CMD.md to CMD.txt, with pandoc.
3. Build hledger, embedding CMD.txt for cmdargs to use as -h output.

This need only be done after changing command docs or flags, and
hopefully won't be a hassle. Shake cmddocs now shows progress output
to make things clearer.
2024-06-07 14:35:31 -07:00
Simon Michael
c3e9255488 ;imp: bal: drop blank line in flags help 2024-06-07 14:11:44 -07:00
Simon Michael
c4e138dfb1 ;doc: update help 2024-06-07 07:05:52 -07:00
Simon Michael
2139505c02 ;doc: update manuals 2024-06-07 07:05:51 -07:00
Simon Michael
3e13f39f94 imp: diff, prices: improve help layout 2024-06-07 07:05:35 -07:00
Simon Michael
c787286844 imp: doc: show flags help in manuals
Each CMD.md file now contains a snapshot of the flags help as rendered
by --help. For now these must be updated manually.
2024-06-07 06:55:33 -07:00
Simon Michael
9a7ba1ecab ;tools: Shake cmdhelp: simplify commit message 2024-06-07 06:49:43 -07:00
Simon Michael
0ccfc78844 ;dev: cleanup 2024-06-07 06:32:52 -07:00
Simon Michael
f4bdf80e71 ;ci: oldest: cleanup 2024-06-07 06:32:35 -07:00
Simon Michael
30dbb9f393 ;doc: ghrelnotes: cleanups 2024-06-02 07:10:24 -10:00
Simon Michael
e85171c842 ;doc: ghrelnotes: fix mac, linux install commands 2024-06-02 07:02:02 -10:00
Simon Michael
245b082eb9 ;doc: relnotes.github: link to the build from source doc 2024-06-01 16:00:07 -10:00
Simon Michael
ef249b385d ;install: 1.34 2024-06-01 16:00:02 -10:00
Simon Michael
91591cd6cc ;doc: relnotes: 1.34: unwrap long lines 2024-06-01 15:50:51 -10:00
Simon Michael
18771d4dd6 ;doc: relnotes: fixes 2024-06-01 15:48:39 -10:00
Simon Michael
33d30bd188 ;doc: relnotes: update 2024-06-01 15:37:06 -10:00
Simon Michael
0e440a82c2 ;tools: just installrel: update for .tar.gz 2024-06-01 15:34:41 -10:00
Simon Michael
50c3f9720c ;doc: RELEASING: updates 2024-06-01 15:22:58 -10:00
Simon Michael
f86e170124 ;ci: release: fix a macos-ism, part 2 2024-06-01 14:39:20 -10:00
Simon Michael
0c0addde18 ;ci: release: fix a macos-ism 2024-06-01 14:36:29 -10:00
Simon Michael
5c695ebce2 ;ci: release: note, not triggering 2024-06-01 14:31:19 -10:00
Simon Michael
4f0e07d024 ;doc: changelogs: bump to latest commit 2024-06-01 14:14:24 -10:00
Simon Michael
8f24fad909 ;doc: merge 1.34 release docs 2024-06-01 14:13:57 -10:00
Simon Michael
2448744ce9 ;ci: binaries-mac-*: use architecture-specific cache keys 2024-06-01 13:51:47 -10:00
Simon Michael
3f3672e999 ;doc: update manuals 2024-06-01 13:30:47 -10:00
Simon Michael
d18c00e1ec ;cabal: update cabal files 2024-06-01 13:30:21 -10:00
Simon Michael
aec28842c7 ;pkg: bump version to 1.34.99 2024-06-01 13:30:20 -10:00
Simon Michael
6716e3a503 ;doc: edit 2024-06-01 09:46:14 -10:00
Simon Michael
84d788b2df ;doc: edit 2024-06-01 09:39:29 -10:00
Simon Michael
e2c2594d60 ;doc: edit 2024-06-01 09:34:51 -10:00
Simon Michael
76882319a7 ;doc: officially deprecate secondary dates, harder 2024-06-01 09:31:55 -10:00
Simon Michael
6376f459f5 ;doc: officially deprecate secondary dates and --date2 2024-06-01 08:46:42 -10:00
Simon Michael
6fd856aa47 ;cabal: update cabal files 2024-05-31 19:55:33 -10:00
Simon Michael
311be367b0 ;doc: cli: simplify, use generic help flags again 2024-05-31 19:54:18 -10:00
Simon Michael
e7b60be4b0 ;dev: drop old extra-source-file 2024-05-31 19:52:40 -10:00
Simon Michael
0f8b536055 ;doc: Generating data: rewrite 2024-05-31 19:41:56 -10:00
Simon Michael
a5a067204e ;doc: JSON output, web: link to OpenAPI spec 2024-05-31 19:41:23 -10:00
Simon Michael
88f70eba6b ;doc: cli, ui, web: synopsis, options cleanup/consistency 2024-05-31 19:41:01 -10:00
Simon Michael
7f583a8414 ;doc: correction, NO_COLOR does not override --color=yes 2024-05-31 18:16:33 -10:00
Simon Michael
c3c95990fa ;tools: just twih: template tweaks 2024-05-31 14:48:50 -10:00
Simon Michael
4aa81da931 ;doc: sync with tldr docs 2024-05-29 17:30:50 -10:00
Simon Michael
12eaee8dcb ;doc: update manuals 2024-05-29 17:02:13 -10:00
Simon Michael
77ee3fd846 ;doc: update command help 2024-05-29 17:02:03 -10:00
Simon Michael
d47513c669 ;doc: sync command summaries between manuals and tldr, updating both 2024-05-29 17:00:11 -10:00
Simon Michael
85cf808183 ;doc: update manuals 2024-05-29 16:12:48 -10:00
Simon Michael
9d53698eab ;imp: cli: also mention 'y' and 'n' in help 2024-05-29 16:12:44 -10:00
Simon Michael
7d0e605bc3 ;imp: cli: improve --debug's help 2024-05-29 16:09:53 -10:00
Simon Michael
4c575c521b ;doc: options: remove redundancy 2024-05-29 15:45:56 -10:00
Simon Michael
29567a3b29 imp: --tldr: show the source if 'tldr' is not installed 2024-05-29 15:37:48 -10:00
Simon Michael
152b20413c doc: update manuals 2024-05-29 15:32:19 -10:00
Simon Michael
f3eba65726 ;doc: update command help 2024-05-29 15:32:19 -10:00
Simon Michael
6007e4b417 ;cabal: update cabal files 2024-05-29 15:32:19 -10:00
Simon Michael
1295ea7678 ;doc: options cleanup 2024-05-29 15:32:19 -10:00
Simon Michael
3a387fab47 imp: cli: commands list: cleanup 2024-05-29 15:32:19 -10:00
Simon Michael
c5f8444627 feat: hledger's tldr pages are now built in, accessible via --tldr
And a few cleanups/fixes related to flag processing.
The help flags are now listed in order of precedence.
2024-05-29 15:32:19 -10:00
Simon Michael
4a57403684 doc: tldr: copy tldr pages to the hledger repo for robustness 2024-05-29 15:32:19 -10:00
Simon Michael
3f5f99a1e9 ;tools: checkembeddedfiles: make it more robust 2024-05-29 14:45:04 -10:00
Simon Michael
82230e5a1f imp: cli: end help output with a blank line 2024-05-29 14:45:04 -10:00
Simon Michael
c35eed5506 imp: cli: fix help headings highlighting 2024-05-29 14:45:04 -10:00
Simon Michael
56bc34f1a2 ci: ci: fix package index update step description, note slowness 2024-05-29 14:45:04 -10:00
Simon Michael
5f255e28ee ;doc: update/simplify general options list in the manuals 2024-05-29 10:00:34 -10:00
Simon Michael
d4dcbbd4c8 fix: help, --man: fix jumping to TOPIC when viewing a man page
And clarify exact/prefix matching behaviour.
2024-05-29 09:37:20 -10:00
Simon Michael
085910708b imp: help: add standard help and (hidden) --debug flags 2024-05-29 09:37:20 -10:00
Simon Michael
f88aa8f871 imp: cli: --info before --man 2024-05-29 09:37:20 -10:00
Simon Michael
1fe7e7af8c imp: cli: --color now also accepts y or n, like --pretty 2024-05-29 09:37:20 -10:00
Simon Michael
a366f3aeaa imp: ui, web, cli, all cli commands now show the general flags grouped
And cli/ui/web each have their own more specific help flags.
2024-05-29 09:37:19 -10:00
Simon Michael
ffb52e3032 imp: cli: refactor, reorg, update general flags 2024-05-28 23:44:29 -10:00
Simon Michael
68fb788c48 ;doc: tldr: translation instructions 2024-05-28 07:56:51 -10:00
Simon Michael
80fbd4b4f9 ;doc: tldr: mention tldr browser 2024-05-28 07:24:12 -10:00
Simon Michael
fc43c6abbc ;doc: Unicode characters: mention UTF-8 on windows 2024-05-28 07:23:10 -10:00
Simon Michael
2a279bb006 ;just: twih: date fixes 2024-05-28 07:18:46 -10:00
Simon Michael
65aac621d4 ;doc: tldr: readme updates 2024-05-24 11:06:50 -10:00
Simon Michael
9deaa1c206 ;doc: tldr: readme updates 2024-05-24 11:05:30 -10:00
Simon Michael
2270e56828 ;doc: tldr: readme updates 2024-05-24 11:03:41 -10:00
Simon Michael
e2e21e7d61 ;doc: tldr: readme updates 2024-05-24 11:00:26 -10:00
Simon Michael
bdb24409a4 ;install: use stackage nightly, fix breakage on non-windows platforms 2024-05-24 10:39:52 -10:00
Simon Michael
8a190e2012 ;doc: tldr: readme updates 2024-05-24 10:28:31 -10:00
Simon Michael
8ad803cae7 ;doc: add: drop lengthy transcript, add simpler example commands (from tldr) 2024-05-23 16:22:58 -10:00
Simon Michael
265183e835 ;doc: add (links to) old & new tldr pages 2024-05-23 16:22:58 -10:00
Simon Michael
7e8f9f09dd ;just: twih: improve output, copy to clipboard 2024-05-23 09:26:53 -10:00
Simon Michael
f3f5fae83f ;doc: period expressions: mention last day of month adjusting [#2005] 2024-05-23 08:20:44 -10:00
Simon Michael
d4684c36fe ;doc: move "Amount formatting" down, it seems not the best first topic 2024-05-23 08:08:12 -10:00
Simon Michael
46b79079bf ;doc: The flattening: adapt to the site's depth-1 page TOCs
and tweak command/screen headings.

This goes further in the direction of showing simple lists of topics
instead of outlines. mdbook-toc doesn't support configuring the TOC
depth this per page, so it has to be site wide.

Overall I feel this is better, see eg the hledger manual.  It hides a
lot of interesting topic names but a shorter, linear list is less
scary and clearer than a huge scrolling outline. Once you click in to
a section and find a subsection of interest, it's still easy to
bookmark/share those by clicking their heading.
2024-05-22 13:06:08 -10:00
Simon Michael
af568f1ae2 ;doc: ghrelnotes: simplify 2024-05-19 10:14:01 -10:00
Simon Michael
fe301e1672 ;doc: relnotes: cleanup 2024-05-19 09:55:49 -10:00
Simon Michael
5aed755b71 ;doc:,workflows: auto-generate github release notes 2024-05-19 09:55:02 -10:00
Simon Michael
cf800cb3bf ;dev: gitignores 2024-05-19 01:16:56 -10:00
Simon Michael
717f13db80 ;workflows: release: cleanup 2024-05-18 23:29:52 -10:00
Simon Michael
f6abd33bc3 ;workflows: release: create release, upload latest binaries 2024-05-18 23:07:23 -10:00
Simon Michael
6e7b8f9862 ;workflows: release: fixes 2024-05-18 22:06:30 -10:00
Simon Michael
1faad6fabb ;workflows: cleanups 2024-05-18 21:25:35 -10:00
Simon Michael
ecda3d93f3 ;workflows: release: first draft of a release-creating workflow 2024-05-18 21:17:54 -10:00
Simon Michael
365b44200b ;ci: ci: restore ; short-circuit logic after refactor 2024-05-18 19:58:00 -10:00
Simon Michael
076312b3d4 ;doc: relnotes.github: start mentioning github nicks
(enables Contributors avatar list)
2024-05-18 19:55:48 -10:00
Simon Michael
d0a0f337db ;doc: relnotes.github: fix curl urls 2024-05-18 19:49:05 -10:00
Simon Michael
b44ac4957f ;doc: relnotes.github: show relnotes, hide install instructions by default 2024-05-18 19:49:00 -10:00
Simon Michael
5077a1a2b1 ci: ci: disable failing ripgrep cache attempt 2024-05-17 15:46:03 -10:00
Simon Michael
57963554cb ci: oldest, ci: more cleanup, more modular steps 2024-05-17 15:31:53 -10:00
Simon Michael
605f8446e5 fix:pkg: fix a doctest failure with ghc 8.10 2024-05-17 15:08:26 -10:00
Simon Michael
76ce328d5f ci: oldest: build with oldest GHC on push to eponymous branch
and ci: cleanups
2024-05-17 15:08:17 -10:00
Simon Michael
235cb3d8e2 fix:pkg: fix a build error with ghc 8.10 [#2198] 2024-05-17 14:48:32 -10:00
Simon Michael
fbd7b7d3f2 ci: cache ripgrep (for checkembedded files) 2024-05-16 09:31:52 -10:00
Simon Michael
176a45b12a ci: cleanup, test warm build time 2024-05-16 09:08:23 -10:00
Simon Michael
70389f5764 ci: update default CI tests to ubuntu 2404 / preinstalled ghc/stack 2024-05-16 08:40:02 -10:00
Simon Michael
43c93eb376 ;ci: binaries-mac-x64: bump from ghc 9.4 to 9.8 2024-05-09 21:26:12 -10:00
Simon Michael
e3a67b197e ;doc: bal: mention --summary-only 2024-05-09 14:47:53 -10:00
Simon Michael
1d2f85432d ;doc: include ui, web in commands in TOC 2024-05-09 14:20:32 -10:00
Simon Michael
b7219f8935 ;doc: reorganise the commands list in manual to match cli, improve links 2024-05-09 13:56:09 -10:00
Simon Michael
9fb210da8c ;doc: report start & end date, smart dates: cleanup, simplify markup 2024-05-09 11:10:51 -10:00
Simon Michael
373b1cdd14 ;tools: just pushfaq 2024-05-09 11:10:31 -10:00
Simon Michael
e0f017f544 ;dev: journalFinalise: doc update 2024-05-08 12:40:06 -10:00
Simon Michael
802bdd3433 imp: cli: commands list: updates 2024-05-07 16:49:34 -10:00
Simon Michael
d817254290 ;doc: update changelogs 2024-05-07 16:45:21 -10:00
Simon Michael
b7e5c05da2 imp: -I can now be overridden by -s or the check command
This enables a "relaxed" workflow where you delay balance assertions
checking until strict mode is turned on: always run hledger -I, and
add -s when you're ready.
2024-05-07 15:44:06 -10:00
Simon Michael
0fedc35a95 ;tools: just installas* 2024-05-07 10:34:13 -10:00
Simon Michael
be1d98ef75 ;tools: just log -> twih, cleanups 2024-05-06 18:34:18 -10:00
Simon Michael
4af919e377 ;tools: just cleanups 2024-05-06 17:39:10 -10:00
Simon Michael
93de348acb ;examples: csv: paypal-custom: more notes, mention paypaljson 2024-05-03 10:23:36 -10:00
Simon Michael
d008eeb216 ;examples: csv: add some old custom paypal csv rules 2024-05-03 10:15:43 -10:00
Simon Michael
ad90de62d3 ;doc: check: edits 2024-05-02 21:58:52 -10:00
Simon Michael
8975988015 ;doc: check: ordereddates: edit 2024-05-02 21:46:48 -10:00
Simon Michael
243a96b656 dev: clarify how readJournalFiles defers checks, and use a dedicated flag 2024-05-02 21:36:32 -10:00
Simon Michael
e3000f463f ;tools: just functest: show elapsed time 2024-05-02 21:36:32 -10:00
Simon Michael
ea58a7ccd7 imp: check: check ordereddates before balance assertions, when both are enabled 2024-05-02 21:11:04 -10:00
Simon Michael
4abb8ffc2e ;doc: check: expand check descriptions 2024-05-02 19:59:00 -10:00
Simon Michael
9cdf435c0e ;bin: add hledger-pricehist (alias for pricehist) 2024-05-02 18:44:21 -10:00
Simon Michael
fe1fc313ba imp: cli: commands list: more cleanup 2024-05-02 18:44:18 -10:00
Simon Michael
16e00062d3 fix: cli: don't re-list known installed addons in final section 2024-05-02 17:19:46 -10:00
Simon Michael
a7026d694e ;imp: web: a basic openapi specification of the current HTTP-JSON API 2024-05-02 16:49:12 -10:00
Simon Michael
8666b5edc0 imp: cli: a commands list refresh 2024-05-02 12:24:33 -10:00
Simon Michael
b13949c7b8 imp: cli: commands list: drop dedicated entry for hledger-stockquotes 2024-05-02 11:38:42 -10:00
Simon Michael
4fe0344d6d ;doc: ANNOUNCE*, relnotes.github: edits 2024-05-02 08:20:44 -10:00
Simon Michael
490a46fcd2 fix: journal: parse include directives with trailing whitespace
[https://github.com/adept/full-fledged-hledger/issues/29]
2024-05-02 07:26:12 -10:00
Simon Michael
89de1ae764 ;doc: RELEASING: updates 2024-05-02 01:27:08 -10:00
Simon Michael
d52e248aab ;doc: relnotes: fixes 2024-05-02 01:23:43 -10:00
Simon Michael
54e4d00e68 ;doc: relnotes.github: fixes 2024-05-02 01:11:58 -10:00
Simon Michael
ddd7b694a9 ;tools: just doctest: fix flag 2024-05-02 01:04:29 -10:00
Simon Michael
731fb7c97b ;doc: ANNOUNCE*: 1.33.1 2024-05-02 00:46:15 -10:00
Simon Michael
93b1070a6a ;doc: relnotes.github: 1.33.1 2024-05-02 00:46:15 -10:00
Simon Michael
fe5065de6f ;doc: relnotes: 1.33.1 2024-05-02 00:46:15 -10:00
Simon Michael
2a659e18db ;doc: changelogs: 1.33.1 2024-05-02 00:46:15 -10:00
Simon Michael
51f8f424cb ;install: 1.33.1 2024-05-02 00:42:58 -10:00
Simon Michael
02e242c9b1 ;doc: update changelogs 2024-05-01 23:23:37 -10:00
Simon Michael
7525014c7d ;cabal: update cabal files 2024-05-01 23:04:18 -10:00
Simon Michael
8d62af8ae0 imp: Revert problematic process-1.6.19.0 bound, it seems not strictly needed [#2149] 2024-05-01 23:04:08 -10:00
Simon Michael
543e96b6bc ;doc: DEVFAQ, just: installdbg: simplify ghc-debug build command 2024-05-01 22:46:57 -10:00
Simon Michael
9ac905459f ;doc: relnotes.github: windows: add -Force to extract command, overwriting old hledger executables; cleanups 2024-05-01 22:46:53 -10:00
Simon Michael
9726aa3f5f ;pkg: stack: bump to latest nightly 2024-05-01 20:46:06 -10:00
Simon Michael
e5c68dd7c0 ;doc: REGRESSIONS: edits 2024-05-01 19:16:52 -10:00
Simon Michael
4ae534e682 ;doc: REGRESSIONS: cleanup 2024-05-01 19:09:07 -10:00
Simon Michael
336162fd1c ;doc: DEVFAQ, REGRESSIONS: edits 2024-05-01 19:05:27 -10:00
Simon Michael
f07749e159 ;doc: DEVFAQ: updates 2024-05-01 17:39:33 -10:00
Simon Michael
962f673373 ;tools: just install* updates, installdbg to install with ghc-debug support 2024-05-01 17:31:45 -10:00
Simon Michael
e476124d6b ;doc: DEVFAQ: updates 2024-05-01 17:16:08 -10:00
Simon Michael
2eda0934f4 ;doc: DEVFAQ: edits 2024-05-01 16:36:25 -10:00
Simon Michael
470f359a56 tools: just ghci*: accept GHCI arguments 2024-05-01 16:22:00 -10:00
Simon Michael
fd5b6a124a doc: DEVFAQ: describe latest not-too-good state of ghc-debug support 2024-05-01 16:21:24 -10:00
Simon Michael
929f050c43 ;cabal: update cabal files 2024-05-01 16:21:13 -10:00
Simon Michael
96caa8f352 fix: detect ghc-debug support more accurately, checking hledger-lib also 2024-05-01 15:27:42 -10:00
Simon Michael
6796decb72 fix: show trailing decimal mark on cost amounts too, when needed 2024-05-01 14:17:46 -10:00
Simon Michael
81ec7c2c9d ;doc: DEVFAQ: edits 2024-05-01 14:17:44 -10:00
Simon Michael
2295185735 doc: DEVFAQ: building with ghc-debug support 2024-05-01 13:48:12 -10:00
Simon Michael
4c53ab419b cabal: update cabal files 2024-05-01 13:44:14 -10:00
Simon Michael
d17b32c7eb imp: cli,ui,web: support ghc-debug for analysing memory/profile info
When built with the ghcdebug flag and started with --debug=-1 (or -2
to pause at startup, or -3 to pause before exit), hledger can be
controlled by ghc-debug clients like ghc-debug-brick or a custom
ghc-debug query script.

Also, refactor version string code.
2024-05-01 13:43:04 -10:00
Simon Michael
e1bcbc3238 ;doc: restart Developer FAQ 2024-05-01 08:48:28 -10:00
Simon Michael
320d85a6cb ;doc: dev: tweak title 2024-05-01 08:48:28 -10:00
Simon Michael
f851d55f01 ;doc: CONTRIBUTING: update 2024-05-01 08:48:28 -10:00
Simon Michael
a6861e6ab6 ;doc: RELEASING: link 2024-04-27 09:22:16 -10:00
Simon Michael
55401282a0 imp: run checks in a well-defined order; and tweak that order
Now commodities are checked before accounts, and tags before recentassertions.
Also some check doc cleanups.
2024-04-26 18:59:45 -10:00
Simon Michael
4cbf72ab1f imp!: check ordereddates: drop --date2 support; check primary dates only
date2 is a deprecated feature and was getting in the way, so has been dropped
from the ordereddates check, simplifying it.
2024-04-26 18:59:45 -10:00
Simon Michael
afe9e2c6f4 dev: move journalCheckBalanceAssertions to JournalChecks 2024-04-26 18:59:45 -10:00
Simon Michael
0c0c088398 ;examples: csv: vanguard, fidelity updates 2024-04-26 17:38:13 -10:00
Simon Michael
1c5fd0c6a3 ;doc: update changelogs 2024-04-26 17:09:17 -10:00
Simon Michael
060528aac9 ;doc: REGRESSIONS: edits, updates 2024-04-25 08:29:13 -10:00
Simon Michael
7c33561c77 ;doc: REGRESSIONS: edits 2024-04-25 08:17:13 -10:00
Simon Michael
fbd26f67a2 dev: tests: errors: recentassertions: fix recently broken test 2024-04-25 08:09:10 -10:00
Simon Michael
9ffa990e9e fix: balcmds: show digit groups marks in html output again [#2196]
This broke in 1.25.
2024-04-25 08:09:10 -10:00
Simon Michael
0dc59cdc12 ;doc: REGRESSIONS: update 2024-04-25 08:09:10 -10:00
Simon Michael
160bfff51d ;cabal: update cabal files 2024-04-25 06:52:09 -10:00
Simon Michael
23d13c9a9f imp: web: support base64 >=1.0 2024-04-25 06:51:34 -10:00
Simon Michael
ca03da5968 ;just: quickprof 2024-04-25 06:27:37 -10:00
Simon Michael
7920b0b9ac ;doc: csv: amount decimal places: edits 2024-04-24 16:02:15 -10:00
Simon Michael
2a67aa327b ;doc: import: edits 2024-04-24 15:54:09 -10:00
Simon Michael
210f28a7b5 ;doc: import: edits 2024-04-24 15:49:51 -10:00
Simon Michael
13cf8de1a1 ;doc: import: edits 2024-04-24 15:04:54 -10:00
Simon Michael
061580f0bc ;doc: import: Skipping -> Date skipping 2024-04-24 14:47:42 -10:00
Simon Michael
7911a4b29a ;doc: import: edits 2024-04-24 14:39:34 -10:00
Simon Michael
3863623ed9 ;doc: import: rename/expand/link commodity styles section 2024-04-24 14:32:20 -10:00
Simon Michael
dff7ff0dc1 ;doc: csv: amount decimal places: test edit for website hook 2024-04-24 14:26:06 -10:00
Simon Michael
a439a7ba78 ;doc: csv: amount decimal places: edits 2024-04-24 14:25:17 -10:00
Simon Michael
5397c73a1a ;doc: csv: amount decimal places: edits 2024-04-24 14:23:00 -10:00
Simon Michael
876f115806 ;doc: csv: amount decimal places: edits 2024-04-24 14:13:22 -10:00
Simon Michael
7f72cce6ce ;doc: csv: amount decimal places: edits 2024-04-24 13:49:29 -10:00
Simon Michael
69c0df4390 ;doc: csv: amount decimal places: expand, note import behaviour 2024-04-24 13:38:06 -10:00
Simon Michael
6fa69ab6e2 ;doc: dev: edits 2024-04-24 08:59:32 -10:00
Simon Michael
7ba0c3999e ;doc: dev: edits 2024-04-24 08:51:15 -10:00
Simon Michael
5766d8fe7e ;doc: dev: update 'make' mentions to 'just' 2024-04-24 08:39:35 -10:00
Simon Michael
81d67a1dd1 ;doc: merge/update just/make/shake dev docs 2024-04-24 08:23:38 -10:00
Simon Michael
9e8f8b42e1 ;tools: retire the main Makefile 2024-04-24 07:34:31 -10:00
Simon Michael
2d35b1051d ;just: port more old make rules 2024-04-24 07:33:57 -10:00
Simon Michael
61d512b6ef ;dev: tests: errors: cleanup for easier flycheck-hledger testing 2024-04-23 08:01:39 -10:00
Simon Michael
0c5bc382f3 ;doc: dev: repology link 2024-04-22 22:03:54 -10:00
Simon Michael
ee3d2c0e38 ;pkg: stack: bump to latest nightly, drop vty-windows extra-dep 2024-04-22 22:03:54 -10:00
Simon Michael
ea13ee63d3 ;doc: relnotes.github: 1.33: copy latest relnotes, fix issue links 2024-04-22 15:58:14 -10:00
Simon Michael
a1a4121093 ;doc: relnotes: 1.33: update with relnotes.hs, fix issue links 2024-04-22 15:58:11 -10:00
Simon Michael
7749483849 ;tools: relnotes.hs: generate/update release notes from changelogs 2024-04-22 15:58:08 -10:00
Simon Michael
27d5f14553 ;doc: changelogs: 1.33: fix issue links (using md-issue-refs.el) 2024-04-22 15:58:05 -10:00
Simon Michael
7b76d87337 ;tools: helper for managing issue links in markdown. 2024-04-22 15:58:01 -10:00
Simon Michael
5d72b569fe ;doc: relnotes: hide commented heading from upcoming script 2024-04-22 15:57:56 -10:00
Simon Michael
3bc1bd2c75 imp:cli:commands list: move HELP, UIS to top; cleanups 2024-04-19 01:19:58 -10:00
Simon Michael
d6646ddbdf ci: binaries-mac-arm64: this has been building x64, fix it 2024-04-19 00:45:03 -10:00
Simon Michael
080d65b73b ;just: get-binaries update 2024-04-19 00:44:45 -10:00
Simon Michael
cbe1fde037 ;ci: binaries-mac: show platform info 2024-04-19 00:16:06 -10:00
Simon Michael
c774991398 ;doc: DEVWORKFLOWS: status 2024-04-18 23:26:25 -10:00
Simon Michael
13c5827ad7 fix: add: don't show ANSI escape codes when they're not supported 2024-04-18 23:19:21 -10:00
Simon Michael
d990a4ba63 ;doc: relnotes.github: cleanups 2024-04-18 23:18:13 -10:00
Simon Michael
81f5bf02bb ;ci: cleanups 2024-04-18 23:17:53 -10:00
Simon Michael
2354525f6d ;doc: RELEASING: site update updates 2024-04-18 15:00:58 -10:00
Simon Michael
493192e290 ;doc: ANNOUNCE tweak 2024-04-18 15:00:46 -10:00
Simon Michael
9c96b117b8 ;just: drop relfiles 2024-04-18 14:50:36 -10:00
Simon Michael
9a75ffd215 ;doc: ANNOUNCE*, relnotes.github: update relnotes url 2024-04-18 14:50:36 -10:00
Simon Michael
e14bf0bcfa ;just: release scripts 2024-04-18 13:41:52 -10:00
Simon Michael
4ae62a1833 ;doc: update manuals 2024-04-18 13:35:28 -10:00
Simon Michael
0edf99350a ;doc: update command help 2024-04-18 13:35:09 -10:00
Simon Michael
f59cb5ff3c ;cabal: update cabal files 2024-04-18 13:33:43 -10:00
Simon Michael
f5c4d99291 ;pkg: bump version to 1.33.99 2024-04-18 13:33:42 -10:00
Simon Michael
6c60148321 ;doc: RELEASING: updates 2024-04-18 13:24:47 -10:00
Simon Michael
14067e7c27 ;doc: relnotes.github: install instructions updates 2024-04-18 13:20:28 -10:00
Simon Michael
a98e8f262b ;doc: RELEASING: updates 2024-04-18 13:20:28 -10:00
Simon Michael
9651082fde ;doc: bump release date to 4/18 2024-04-18 13:20:12 -10:00
Simon Michael
81fc202d08 ci: binaries-linux-x64: use ghc 9.8 and cabal 3.10 again 2024-04-18 13:20:12 -10:00
Simon Michael
384cb4da38 ci: binaries-linux-x64: switch to more stable alpine:latest 2024-04-18 13:20:12 -10:00
Simon Michael
0bcad0a39c ci: binaries-linux-x64: try ghc 9.0 and cabal 3.8 again 2024-04-18 13:20:12 -10:00
Simon Michael
dc4a0ff82c ;ci: clean up github cache/post-cache titles again 2024-04-18 13:20:12 -10:00
Simon Michael
9910651451 ;ci: cleanups 2024-04-18 13:20:12 -10:00
Simon Michael
6d1118ee59 ;ci: use upload-artifact v4, silence node 16 warnings 2024-04-18 13:20:12 -10:00
Simon Michael
ef15f9e615 ci: use cache v4, silence node 16 warnings 2024-04-18 13:20:12 -10:00
Simon Michael
835a34b3f3 ci: use checkout v4, silence node 16 warnings 2024-04-18 13:20:12 -10:00
Simon Michael
495b3b977a ci: binaries-mac: drop unused matrix 2024-04-18 13:20:12 -10:00
Simon Michael
50ee1db91f ci: ci: drop unused matrix; cleanup 2024-04-18 13:20:12 -10:00
Simon Michael
e1540af4b8 ;ci: ci: silence vs code warnings about env.CONTINUE 2024-04-18 13:20:12 -10:00
Simon Michael
7b24c3546c ci: binaries: drop unused early termination code
It is used only in ci.yml.
2024-04-18 13:20:12 -10:00
Simon Michael
3fd350861b ci: binaries-linux-x64: cleanups 2024-04-18 13:20:12 -10:00
Simon Michael
b23b61a60f ci: binaries-linux-x64: try other static build options 2024-04-18 13:20:12 -10:00
Simon Michael
981aee3e52 ci: binaries-linux-x64: work around unwritable $HOME issue
This is for https://github.com/actions/runner/issues/863 which is causing
"Preventing creation of Stack root '/github/home/.stack/'. Parent directory '/github/home/' is owned by someone else."
2024-04-18 13:20:12 -10:00
Simon Michael
06d6730a79 ci: binaries-linux-x64: also run some unit tests 2024-04-18 13:20:12 -10:00
Simon Michael
4e5a2dcc70 ci: binaries: tool setup fixes, label tool version output 2024-04-18 13:20:12 -10:00
Simon Michael
7249fa80cd ci: binaries-linux: drop "-static" from names, assume it 2024-04-18 13:20:12 -10:00
Simon Michael
a4917f8f98 ci: binaries-linux-x64: try making the static build with stack 2024-04-18 13:20:12 -10:00
Simon Michael
7b052979b2 ci: binaries-linux-x64: try latest ghc & cabal 2024-04-18 13:20:12 -10:00
Simon Michael
8bed9a6c2f ;doc: changelog/relnotes/announcements: note apple ARM binaries 2024-04-18 13:20:12 -10:00
Simon Michael
82cc77f184 ci: binaries-mac: switch to ghcup for setup, like linux 2024-04-18 13:20:12 -10:00
Simon Michael
5c36a297dc ci: binaries-mac: update x64, add arm64
I think macos-latest is now m1 and macos-13 is x64.
2024-04-18 13:20:12 -10:00
Simon Michael
ae69800fdb pkg: require vty-windows-0.2.0.2+ to fix recent MS Terminal
And add to current stack.yaml too, since it's not yet in stackage.
2024-04-18 13:19:51 -10:00
Simon Michael
a1a47f9a9d ;just: reltag, reltagpkg 2024-04-18 13:19:51 -10:00
Simon Michael
5fd70ac2d5 ;doc: relnotes, relnotes.github: 1.33 2024-04-18 13:19:51 -10:00
Simon Michael
381b1ee662 ;just: rename relauthors 2024-04-18 13:19:51 -10:00
Simon Michael
9685897f78 ;examples: shared finances 2024-04-18 13:19:51 -10:00
Simon Michael
fa96d3e874 ;just: relprep: don't update changelogs at this stage 2024-04-18 13:19:51 -10:00
Simon Michael
5d30a1aeaa ;doc: relnotes.github: add header, begin updating for 1.33 2024-04-18 13:19:51 -10:00
Simon Michael
38bc972b09 ;doc: relnotes: move them back here from the site repo
No clear reason, it just seems like it might be best.
2024-04-18 13:19:51 -10:00
Simon Michael
53cdbf15f7 ;doc: rename github-release.md -> relnotes.github.md 2024-04-18 13:19:51 -10:00
Simon Michael
559b7f533a ;doc: announcements: 1.33 2024-04-18 13:19:51 -10:00
Simon Michael
997653e3b9 ;doc: changelogs: 1.33 2024-04-18 13:19:34 -10:00
Simon Michael
e482c4f21c ;install: 1.33 2024-04-18 13:19:29 -10:00
Simon Michael
ef948ba88e ;stack: bump 9.6 snapshot 2024-04-18 13:19:29 -10:00
Simon Michael
5151751b98 ;doc:RELEASING: updates 2024-04-17 19:27:13 -10:00
Simon Michael
205e117067 ;doc:RELEASING: cleanups 2024-04-16 07:36:29 -10:00
Simon Michael
acecbe9552 ;doc:dev:cleanup 2024-04-15 21:19:53 -10:00
Simon Michael
d10d7cc670 ;doc:dev: link CLIMATE 2024-04-15 21:18:18 -10:00
Simon Michael
4505fde9c9 ;doc: rename/move CLIMATE here from site repo 2024-04-15 21:14:31 -10:00
Simon Michael
8b125a6f7b ;doc:dev: cleanups 2024-04-15 21:05:28 -10:00
Simon Michael
60522319d0 ;doc: MOCKUPS: heading 2024-04-15 21:02:06 -10:00
Simon Michael
bab7c5eedf ;doc: merge LINKS on dev docs page; cleanup 2024-04-15 20:49:53 -10:00
Simon Michael
58492c67ef ;doc: move dev docs, mockups, investment features pages from site repo 2024-04-15 20:10:39 -10:00
Simon Michael
4770db4ee0 ;doc: update ROADMAP 2024-04-14 20:12:13 -10:00
Simon Michael
0f8eada038 ;doc: drop BACKLOG, deprecate TODO 2024-04-14 20:11:44 -10:00
Simon Michael
41fd42e8b3 ;doc: Assertions and subaccounts: edits 2024-04-11 19:39:48 -10:00
Simon Michael
ce528c5680 ;doc: Assertions and commodities / subaccounts: rewrite 2024-04-11 18:46:38 -10:00
Simon Michael
350a2c0918 ;doc: Assertions and ordering: cleanups 2024-04-11 17:50:26 -10:00
Simon Michael
1829af239c ;doc: Assertions and ordering: edits 2024-04-11 17:40:28 -10:00
Simon Michael
96e9bdb2e2 ;doc: Assertions and ordering: rewrite; update Ledger info 2024-04-11 17:28:28 -10:00
Simon Michael
28abe5e9ff ;doc:bse: links 2024-04-11 11:55:37 -10:00
Simon Michael
d9b5ed7bb2 ;doc:bse: note requirements for checking the AE 2024-04-11 11:51:44 -10:00
Simon Michael
91aef62c29 ;doc: virtual postings: edit 2024-04-11 11:36:46 -10:00
Simon Michael
ff3af71c4e ;doc: update command help 2024-04-11 11:15:44 -10:00
Simon Michael
dc8eedc16b ;cabal: update cabal files 2024-04-11 11:15:41 -10:00
Simon Michael
e4cbd88367 ;pkg:lib: disable doctests for now to allow use of process-1.6.19.0 2024-04-11 11:14:46 -10:00
Simon Michael
e2cc2a70ac ;doc:bs,bse,cf,is: update sample output 2024-04-11 11:13:18 -10:00
Simon Michael
d08ec64b7d ;dev:just: ghci, doctest: -fobject-code might reduce some recompilation 2024-04-10 08:20:54 -10:00
Simon Michael
8cc36e23a6 ;ci: "Cache" -> "Uncache" 2024-04-10 08:19:35 -10:00
Simon Michael
7231683613 cabal: update cabal files 2024-04-10 08:07:17 -10:00
Simon Michael
69e4a88ccf pkg: require process 1.6.19.0+ for HSEC-2024-0003
This is to avoid potential vulnerabilities on Windows due to the process issue disclosed today:
https://haskell.github.io/security-advisories/advisory/HSEC-2024-0003.html
2024-04-10 08:07:08 -10:00
Simon Michael
d3634cf4dd dev: update failng doctests 2024-04-08 00:08:48 -10:00
Simon Michael
8e0adec126 pkg:stack: bump dev build to latest/ghc 9.8.2 2024-04-07 23:47:27 -10:00
Simon Michael
5be3ee9e20 imp: disallow date: in expr: OR expressions, avoiding unclear semantics [#2177][#2178] 2024-04-07 23:37:28 -10:00
Simon Michael
f982a372d9 dev: matchedPostingsBeforeAndDuring: improve debug output 2024-04-07 23:14:28 -10:00
Simon Michael
06ef6de242 dev:parseBooleanQuery: refactor 2024-04-07 22:48:25 -10:00
Simon Michael
1d3e6b5543 dev:parseBooleanQuery: refactor, clarifying helper dependencies 2024-04-07 21:53:03 -10:00
Simon Michael
65e01d900a ;bin: add hledger-txnsbycat.hs 2024-04-03 15:00:53 -10:00
Simon Michael
fcff3d87f0 ;doc:REGRESSIONS: update 2024-04-03 15:00:53 -10:00
Simon Michael
9102acf152 ;doc:D: clarify scope [#2191] 2024-04-03 15:00:53 -10:00
Dmitry Astapov
08a5f1ee78 ;fix: roi correctly interacts with --value (fixes #2190) 2024-04-01 08:37:31 -10:00
Simon Michael
89d6f4a451 ;doc: text encoding: mention BOM support [#2189] 2024-03-29 14:56:57 -10:00
Simon Michael
3f184a848a ;doc: import: deduplication: edits 2024-03-27 09:23:28 -10:00
Simon Michael
080184d2e5 ;doc: import: deduplication: edits 2024-03-27 09:14:30 -10:00
Simon Michael
57ad739227 ;doc: import: deduplication: updates 2024-03-27 09:12:03 -10:00
Simon Michael
4ab55b3757 ;dev: update error message tests 2024-03-26 10:12:46 -10:00
Simon Michael
fae6e49407 imp: simpler, clearer date parse error messages
When the error message repeated the invalid date at the end,
it was possible to misinterpret that as a suggested fix (reported in chat).

Instead, date errors (most of them) now rely on the highlighted data
excerpt above. This is also preferable since it shows the original
date as written, not a reconstruction with a possibly different format.

Should this be the policy for all error messages going forward ?
It would be easier.
Can we assume the data excerpt is always visible along with the error message ?
It isn't shown by flycheck-hledger in emacs, eg.
2024-03-26 10:05:57 -10:00
Simon Michael
5519f4ac2e ;doc: import: edits 2024-03-24 15:13:56 -10:00
Simon Michael
8642db786a ;doc: update manuals 2024-03-24 14:51:30 -10:00
Simon Michael
2889bb6efb ;doc: update command help 2024-03-24 14:51:25 -10:00
Simon Michael
eb6b94ad5a ;doc:import: deduplication -> skipping 2024-03-24 14:51:16 -10:00
Simon Michael
76f98f28fd ;doc: update manuals 2024-03-24 14:22:54 -10:00
Simon Michael
70b75e4921 ;doc: update command help 2024-03-24 14:22:37 -10:00
Simon Michael
be24d6505f ;doc:import: rewrite deduplication section 2024-03-24 14:21:44 -10:00
Simon Michael
98a93d979a ;pkg:stack: bump to latest nightly & ghc 9.8.2 2024-03-17 10:54:02 -10:00
Simon Michael
85c345d9b8 ;doc: small fixes 2024-03-17 10:54:02 -10:00
aragaer
09e158d31e fix: Fill totals with correct amount of zeroes for empty reports 2024-03-17 10:52:53 -10:00
Dmitry Astapov
f1bd46fd57 ;doc: explain comments in "if tables" and order of application 2024-03-08 08:20:29 -10:00
Dmitry Astapov
b0b9e69e4f ;dev:lib allow comment lines in the "if" table body 2024-03-08 07:42:58 -10:00
Simon Michael
5def834346 ;doc: journal cheatsheet cleanups 2024-03-03 01:09:01 -10:00
Simon Michael
878ebaca40 ;just:commitlog: fix site & finance repo listing 2024-03-02 12:53:53 -10:00
Simon Michael
bd1638b443 ;just: _datearg rename, part 2 2024-03-02 12:51:11 -10:00
Simon Michael
6e5272f7df
Merge pull request #2179 from jmtd/fix-matchgroups
import: fix scoping problems with match groups
2024-03-02 12:25:18 -10:00
Simon Michael
169198ff55
Merge branch 'master' into fix-matchgroups 2024-03-02 12:15:52 -10:00
Simon Michael
861a57ebf3 ;doc:code blocks: language types 2024-03-02 12:10:27 -10:00
Simon Michael
f20457e2af ;doc:manuals: code block language type 2024-03-02 11:53:51 -10:00
Simon Michael
b605b5bfd5 ;doc:manuals: fix some code block language types 2024-03-02 11:50:10 -10:00
Jonathan Dowland
3b416a76ef ;cln:import: clarify haddock for getEffectiveAssignment
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-02 20:56:35 +00:00
Simon Michael
ee0c36dfde ;tools: bump snapshot/ghc versions 2024-03-02 10:06:35 -10:00
Simon Michael
63938f1da1 ;just:format: be silent if there's no changes to commit 2024-03-02 07:47:05 -10:00
Simon Michael
a59df34a5b ;just: cleanup 2024-03-02 07:36:43 -10:00
Simon Michael
46b0c9bacf ;just: format 2024-03-02 07:32:48 -10:00
Simon Michael
bf7b00819b ;just: tidy up 2024-03-02 07:31:42 -10:00
Simon Michael
cb0b054df7 doc:web: mention -E flag, and cost hiding, and zero balances that aren't [#2140] 2024-03-01 23:09:27 -10:00
Simon Michael
bac7171454 imp:web: show zero amounts with their commodity symbol(s?) [#2140]
This was mainly to make the sidebar more informative,
but also affects and hopefully helps, all amounts displayed elsewhere.
2024-03-01 22:51:48 -10:00
Simon Michael
7e3b205309 dev:web: give amounts in the sidebar the "amount" class also 2024-03-01 22:24:06 -10:00
Simon Michael
805fa67a28 ;tools:buglist: improvements 2024-03-01 22:23:17 -10:00
Simon Michael
8d9ce2abf9 ;just:push: allow custom poll interval argument 2024-03-01 18:13:30 -10:00
Simon Michael
3ca208a3b6 fix:queries: fix OR-ing open-ended dates, spanUnion; add spanExtend [#2177] 2024-03-01 18:10:24 -10:00
Simon Michael
b7d7dda463 dev: rename query-expr.test 2024-03-01 18:09:34 -10:00
Simon Michael
afd009db9e ;doc: update command help 2024-03-01 18:09:34 -10:00
Simon Michael
7db8e01200 imp:stats: with multiple reports, add a blank line before runtime stats 2024-03-01 18:09:34 -10:00
Simon Michael
c24054455f imp:stats: be more private by default; update doc
The old details (file paths, commodity names) can be shown
with -v/--verbose.
2024-03-01 09:03:57 -10:00
Simon Michael
0c44eddd4c imp:stats: more compact sub-80-width output 2024-03-01 08:09:51 -10:00
Jonathan Dowland
c5079d4f1e dev:import: call hledgerFieldValue rather than re-implementing it
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-01 18:02:29 +00:00
Jonathan Dowland
1424a1f2f1 ;cln:import: update some Haddock strings to reflect #2158
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-01 17:58:28 +00:00
Simon Michael
7e28e38bbc ;doc:balance: cleanups 2024-02-29 23:13:23 -10:00
Simon Michael
d8f86a9b7d ;doc:balance: updates, cleanups 2024-02-29 22:56:23 -10:00
Simon Michael
67f027de33 ;doc:journal:transaction balancing, commodity directive: simplify 2024-02-29 19:23:31 -10:00
Simon Michael
babaf70932 ;doc:journal:transaction balancing, commodity directive: highlight #2135 2024-02-29 19:09:39 -10:00
Simon Michael
3e93b69c25 ;doc:balance: consolidated --related/-r doc 2024-02-29 18:14:52 -10:00
Simon Michael
39a0a4d08a ;doc:journal:valuation: cleanups 2024-02-29 18:00:10 -10:00
Simon Michael
24571f99e0 ;doc:journal: drop redundant/wrong Querying with cost or value section 2024-02-29 17:48:22 -10:00
Simon Michael
1a7523d16e ;doc:journal: move complex discussion of other lot notations later 2024-02-29 17:09:09 -10:00
Simon Michael
158e0850fd ;doc:journal:directives: fix formatting 2024-02-29 16:56:22 -10:00
Simon Michael
b39948a3dd ;doc:journal: move complex discussion of commodity styles later 2024-02-29 16:53:20 -10:00
Simon Michael
256294101d ;doc:journal:Digit group marks: simplify, don't encourage mad unicode spaces 2024-02-29 16:35:45 -10:00
Simon Michael
ed3dc344fc ;doc:journal: split Decimal marks, Digit group marks 2024-02-29 16:31:26 -10:00
Simon Michael
81f9b51967 ;doc:journal: edits 2024-02-29 16:16:23 -10:00
Simon Michael
d0c0a3f72c ;doc:journal:transaction balancing: edits 2024-02-29 16:12:32 -10:00
Simon Michael
8225b3dcef ;doc:journal:commodity directive: clarify & fix scope of effects (#2135) 2024-02-29 16:06:46 -10:00
Simon Michael
90c824adaa ;doc:journal:transactions: typo 2024-02-29 15:34:48 -10:00
Simon Michael
86ba7cc3a3 ;doc:journal:amounts/commodities/numbers: cleanup 2024-02-29 15:31:44 -10:00
Simon Michael
62151d679e ;doc:journal: move intro before cheatsheet 2024-02-29 15:05:41 -10:00
Simon Michael
2ccbb16f07 ;doc:journal:transactions: explain transaction balancing (#2135) 2024-02-29 14:52:52 -10:00
Simon Michael
a6db6762ac ;doc:journal:transactions: edits; mention debits and credits and sign 2024-02-29 14:52:19 -10:00
Simon Michael
1ee0e80719 imp:errors:unbalanced transaction: show more precise amounts (#2135)
Like we used to in 1.30, but better (show all available decimal digits,
unless they're infinite in which case show 8, show trailing zeros,
show commodity symbol with zero).
2024-02-29 12:34:17 -10:00
Simon Michael
3ec432bd53 dev: rename/improve amountSetFullPrecisionUpTo, add mixedAmountSetFullPrecisionUpTo 2024-02-29 12:31:07 -10:00
Jonathan Dowland
71684f5611 ref:import: simplify renderTemplate and friends
renderTemplate and its ancillary functions did not need the
HledgerFieldName argument, so remove it.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:42 +00:00
Jonathan Dowland
b7027c8bbb feat:import: resolve matchgroup references in ConditionalBlock scope (#2158)
Adjust getEffectiveAssignment to compute an intermediary form of the
active assignments (with an additional Either wrapper to distinguish
top-level and conditional assignments) and move the remaining work to
its only caller, hledgerField.

Rework hledgerFieldValue. Instead of calling hledgerField, call
getEffectiveAssignment and--in the conditional block case--construct
a CsvRules scoped just to the active ConditionalBlock before calling
renderTemplate.

Adjust regexMatchValue to use rconditionalblocks to access conditional
blocks from the CsvRules, rather than rblocksassigning, since we haven't
narrowed the scope of that field.

The result is match group references are only expanded for match groups
that occur within the in-scope ConditionalBlock. Fixes: #2158.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:40 +00:00
Jonathan Dowland
ac7f726282 ;ref:import: consistently use hledgerField
hledgerField is an alias to the function getEffectiveAssignment: both
names are used in various parts of RulesReader.

Treat hledgerField as the canonical name, and getEffectiveAssignment
as an implementation detail of hledgerField.

Replace all uses of getEffectiveAssignment with hledgerField (except the
one in hledgerField.)

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:39 +00:00
Jonathan Dowland
8b14022d97 ;test:import: update matchgroup functest for #2158
Also re-format the comments. Some of the comments within the conditional
blocks were actually being parsed as case-insensitive regexes to match
against each record. Luckily this didn't impact the results.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:38 +00:00
Jonathan Dowland
8f514ac16d ;test:import: test case for match groups (#2158)
Add a test which captures the issue of overlapping scope described
in GitHub issue #2158.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:36 +00:00
Jonathan Dowland
7e06e0caeb ;dev:ghc-tags: ignore hledger/test/addons
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:35 +00:00
Jonathan Dowland
bd5652c1c2 ;cln:import: remove superfluous comment lines
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:32 +00:00
Simon Michael
ce0990d1e2 ;cabal: update cabal files 2024-02-29 01:08:37 -10:00
Simon Michael
d755699c9b imp:stats: also show RTS memory usage stats 2024-02-29 01:07:04 -10:00
Simon Michael
8f1ae401f4 dev: fix some partial head/tails, silence ghc 9.8's new warnings
Note the headErr/tailErr calls will print stack traces if they fail
(small ones: five lines, one of which is the useful location info),
which may or may not be best UX.
2024-02-28 15:58:21 -10:00
Simon Michael
697e5a5671 ;cabal: update cabal files 2024-02-28 15:34:11 -10:00
Simon Michael
3798a3baef pkg: require safe >=0.3.20, for ghc 9.8 head/tail helpers 2024-02-28 14:39:53 -10:00
Simon Michael
4cec8aa0d7 pkg:stack:9.8: make default 2024-02-28 13:35:15 -10:00
Simon Michael
bf40a1ae25 pkg:stack:9.6: make non-default 2024-02-28 13:34:32 -10:00
Simon Michael
cf192de502 pkg:stack:9.8: updates 2024-02-28 13:34:07 -10:00
Simon Michael
41e14634ff pkg:stack:9.6: updates 2024-02-28 13:34:07 -10:00
Simon Michael
56d5a84cfe pkg:stack:9.4: updates 2024-02-28 13:25:42 -10:00
Simon Michael
9bc3a092ee pkg:stack:9.2: updates 2024-02-28 13:25:42 -10:00
Simon Michael
e182dc3a46 pkg:stack:9.0: updates (untested) 2024-02-28 13:25:42 -10:00
Simon Michael
9dbb0f6f2a pkg:stack:8.10: updates (untested) 2024-02-28 13:25:42 -10:00
Simon Michael
fac3ee89af feat:allow other kinds of unicode space as digit group separators
Based on feedback in chat, I added support for several more kinds of
Unicode space character for separating digit groups, both when reading
and when displaying numbers. These are the spaces currently supported,
which are just my best guess at the ones that might show up in CSV files
now and then:

space,
no-break space,
en space,
em space,
punctuation space,
thin space,
narrow no-break space,
medium mathematical space
2024-02-28 09:12:17 -10:00
Simon Michael
eb0f736899 dev: update failing test 2024-02-28 09:11:49 -10:00
Simon Michael
f1de5737d7 ;doc:REGRESSIONS: better bounty requests link 2024-02-26 15:05:50 -10:00
Simon Michael
9827860f17 ;dev:pkg:stack: bump nightly 2024-02-26 14:52:00 -10:00
Simon Michael
6f7b8f8b55 ;doc:queries:combining multiple queries: edits 2024-02-26 11:05:05 -10:00
Simon Michael
2cfd051989 ;doc:csv:balance field: fix old "Tips" link 2024-02-26 11:04:32 -10:00
Simon Michael
37881b76fc ;doc:csv: drop outdated note about auto-creation of rules files 2024-02-26 10:25:50 -10:00
Simon Michael
c7dd1fcc2f ;imp:cli:errors: make file-not-found error more format agnostic 2024-02-26 10:25:22 -10:00
Simon Michael
a4c2776a18 feat:close: support --round, like print 2024-02-25 17:37:59 -10:00
Simon Michael
d3ad743b36 imp: print, close: disambiguate balance assertion/assignment amount also (#2176)
Add a trailing decimal mark when necessary to disambiguate a single
digit group mark in the balance assertion/assignment amount, also.
2024-02-25 16:47:58 -10:00
Simon Michael
4c3deeb2ae ;doc:REGRESSIONS:#2071 2024-02-25 02:00:38 -10:00
Simon Michael
a871f274c4 fix:bal:budget: don't omit necessary parent accounts in tree mode (#2071)
Parent accounts with no actual or goal amounts would ideally be shown
elided on the same line, but the budget report in tree mode was
omitting them completely. Now --budget always shows them.
The effect is much like forcing --no-elide on, except it might not
show goal amounts that --no-elide does show.

It's not a wonderful fix, but the budget report code is twisty and I
can't afford to spend more time on this.
2024-02-25 01:23:39 -10:00
Simon Michael
c701e3a663 dev:budget: big refactor, clarify
Big functions like budgetReportAsTable are grouped as much as possible
into more modular sub-scopes.
2024-02-25 01:23:39 -10:00
Simon Michael
3cad760851 dev:budget: simplify some confusing fmaps 2024-02-25 01:23:31 -10:00
Simon Michael
ffdde364de imp:bal:budget:csv,tsv output: show 0 not empty when there's no amount 2024-02-24 18:21:42 -10:00
Simon Michael
37f9d6b239 dev:budget report: clarify code, add debug output 2024-02-24 18:21:42 -10:00
Simon Michael
f82016cf63 dev:budget report:tests: fix numbering 2024-02-24 18:21:42 -10:00
Simon Michael
12f79f4fca ;doc:csv: combining matchers: clarify 2024-02-23 02:56:07 -10:00
Simon Michael
e53f25bf13 ;doc: add Text encoding section 2024-02-22 16:48:07 -10:00
Simon Michael
5a36362b33 imp:journal: use a symlink's target's directory for relative include paths
When reading a symbolically-linked journal file,
relative paths in include directives are now evaluated
relative to the directory of the real linked file,
not the directory of the symlink.

This also seems to fix an obscure case where stats did not report
absolute included file paths in certain circumstances (stdin, maybe no
terminal..)
2024-02-22 08:48:31 -10:00
Simon Michael
f6a50923c2 imp: interpret glob patterns in $LEDGER_FILE
For example, LEDGER_FILE=2???.journal now works.
2024-02-22 07:32:37 -10:00
Simon Michael
e6b3fa0f54 dev:IO: comments 2024-02-22 07:32:10 -10:00
Simon Michael
9523cb8e21 ;doc:Special tags: note type: as another one to avoid 2024-02-21 00:26:49 -10:00
Simon Michael
f70eac2591 imp:close: add --assertion-type option 2024-02-20 20:55:47 -10:00
Simon Michael
60a1adc5ba lib: refactor, extract parseBalanceAssertionType 2024-02-20 20:55:27 -10:00
Simon Michael
9f53e36904 ;imp: close: --assert: make default description "assert balances" 2024-02-20 20:55:27 -10:00
Simon Michael
5519065a94 ;pkg:stack:9.8: can now build all packages 2024-02-19 11:25:05 -10:00
Simon Michael
9a6df91537 ;doc:journal:description/payee/note: edits 2024-02-18 15:03:25 -10:00
Simon Michael
85836eaa21 ;doc: update manuals 2024-02-18 14:59:10 -10:00
Simon Michael
862758d6a3 ;cabal: update cabal files 2024-02-18 14:58:38 -10:00
Simon Michael
17817650da ;fix:pkg:web: set upper bound to exclude base64 1.0 [#2166] 2024-02-18 14:57:46 -10:00
Simon Michael
3f6c400ddb ;doc:journal:description/payee/note: clarify 2024-02-18 14:57:41 -10:00
Vekhir
de3209a2fb fix: Hide ambiguous instance for (!?)
base 4.19.0.0 introduces Data.List.!? which clashes with Data.Vector.!?, the latter of which is needed for vector operations.
2024-02-18 14:55:31 -10:00
Jonathan Dowland
32328e33de feat: ui: Add a dark theme
I wanted a theme with roughly the same degree of colour as the
default but which was easier on my eyes late at night.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-18 14:54:31 -10:00
Colin Dean
4c15cfb275 fix: correct to inherit_errexit in hledger-bar
I misread something and apparently whatever test I used didn't fail because what's there now is not valid at all.
2024-02-17 20:54:30 -10:00
Simon Michael
f706bd2765 ;doc:Special tags: edits 2024-02-17 13:52:22 -10:00
Simon Michael
d65114f57a ;doc:Special tags: edits 2024-02-17 13:30:25 -10:00
Simon Michael
6103d74b4b doc:Tags: improve the Special tags list, and the tags doc generally 2024-02-17 13:06:10 -10:00
Simon Michael
baca5f8b54 fix:check:tags: add date and date2 to the implicitly-declared special tags
And add tests/comments.
2024-02-17 13:06:10 -10:00
Simon Michael
a964fd25c0 ;just: log,tootlog: tweaks 2024-02-16 11:45:11 -10:00
Simon Michael
2f4262df1f ;examples:csv:daedalus: cleanups 2024-02-16 10:53:27 -10:00
Simon Michael
c07f7c696d ;examples:csv:daedalus-transactions: update for current daedalus [#2171] 2024-02-15 12:21:40 -10:00
Simon Michael
876bbf10a0 ;doc:journal:account directive: edits 2024-02-14 15:53:15 -10:00
Simon Michael
de8df9f861 ;doc: journal: account directive: edits 2024-02-14 15:45:16 -10:00
Simon Michael
a7cbef0f51 ;doc: journal: account display order: clarify 2024-02-14 15:03:28 -10:00
Simon Michael
d78a37eeda ;doc: journal: account display order: clarify 2024-02-14 14:19:38 -10:00
Simon Michael
f4a8823cf3 ;doc: journal: account display order: clarify 2024-02-14 14:11:44 -10:00
Simon Michael
2de3e6e2dc ;doc:Data formats: clarify a little [#2164] 2024-02-08 07:01:14 -10:00
Simon Michael
806d84fcf3 ;just:worklogdates: update 2024-02-08 06:47:46 -10:00
Simon Michael
e9dd01a7db imp:close:--assert/--retain: no tag value; rename --assert's tag to assert: 2024-02-08 06:47:46 -10:00
Michael Rees
d4ecdb3fea imp: Support tsv and ssv prefixes (#2164) 2024-02-08 06:44:44 -10:00
Martijn van der Ven
a7c5225498 fix: css to preserve linebreaks in messages 2024-02-04 16:42:09 -10:00
Simon Michael
d702788a64 ;doc: github-release: 1.32.3 2024-01-28 02:35:02 -10:00
Simon Michael
aa69eb188a ;doc: update changelogs 2024-01-28 02:34:54 -10:00
Simon Michael
65af4c344b install: bump versions, build with lts-22/ghc 9.6.4 2024-01-28 02:33:32 -10:00
Simon Michael
bbd53d06be ;just:relprep: fixes 2024-01-28 00:03:39 -10:00
Simon Michael
0cd2c4591d ;doc:ISSUES: cleanup 2024-01-27 20:26:02 -10:00
Simon Michael
d83cb14abe ;doc:ISSUES: tweak impact/severity levels; updates 2024-01-27 19:54:31 -10:00
Simon Michael
d6ad974c27 ;doc:ISSUES:simplify urls 2024-01-27 13:39:54 -10:00
Simon Michael
062780b1eb ;doc:ISSUES:prioritising: notes 2024-01-27 13:31:01 -10:00
Simon Michael
5d90a89eda ;tools:buglist: prototype 2024-01-27 13:30:50 -10:00
Simon Michael
fb1c223567 ;stack: bump to lts 22.7/ghc 9.6.4 2024-01-27 11:28:11 -10:00
Simon Michael
91762d2f67 ;doc:ISSUES: label updates, hyphens instead of spaces 2024-01-27 11:27:54 -10:00
Simon Michael
3bfc50a044 ;doc: REGRESSIONS: updates 2024-01-27 00:05:32 -10:00
Simon Michael
daad124625 ;just:worklog: updates 2024-01-26 23:40:11 -10:00
Simon Michael
a68fe69491 ;cabal: update cabal files 2024-01-26 22:49:45 -10:00
Simon Michael
13baabb880 ;doc: update command help 2024-01-26 22:49:21 -10:00
Simon Michael
32ef1e3dd9 ;doc: update manuals 2024-01-26 22:49:07 -10:00
Simon Michael
015943b93d ;pkg:stack:9.8: updates 2024-01-26 22:48:05 -10:00
Simon Michael
f7c18bc6e7 ;pkg:ui: allow vty 6.2 2024-01-26 22:47:40 -10:00
Simon Michael
dd1468fe7e ;just: more benchmarks 2024-01-26 22:23:04 -10:00
Simon Michael
31241bc968 ;just: more benchmarks 2024-01-26 17:14:25 -10:00
Simon Michael
12e67e4859 dev: postingAddInferredEquityPostings: cleanup 2024-01-26 15:04:44 -10:00
Simon Michael
4c7abc3d2f just:samplejournals: more, faster, better 2024-01-26 14:41:15 -10:00
Simon Michael
21adfe2c25 fix: really fix slowdown with many accounts [#2153]
The previous #2153 fix used accountNameTreeFrom, but it turns out this
has always had O(n^2) performance, so our tests with 10k accounts ran
even slower than before. Now it's faster, the main #2153 slowdown
should really be fixed, and other commands which build an account tree
should also be free of this slowdown when there are very many accounts.
2024-01-26 13:53:47 -10:00
Simon Michael
a38af98c9e fix: a slowdown with many txns and many accounts since 1.29 [#2153]
When processing costs and equity postings in transactions during
journal finalisation, we now pass just the conversion account name(s)
rather than the entire map of account types. This slowdown was severe
for some users/data/machines.
2024-01-25 13:49:49 -10:00
Simon Michael
53431d9ac6 ;just: note GNU/linux portability issue 2024-01-25 13:21:38 -10:00
Simon Michael
70ec71edd7 ;tools: bench5k.sh 2024-01-24 23:50:01 -10:00
Simon Michael
78f3655dd5 ;just: symlink-binary: -f 2024-01-24 23:05:20 -10:00
Simon Michael
0f43946646 ;just: portability fix, 2 2024-01-24 23:03:26 -10:00
Simon Michael
80cc54cc27 just: portability fix 2024-01-24 22:46:14 -10:00
Simon Michael
d969421c21 ;tools: standard 1k, 10k, 100k-txn benchmarks 2024-01-24 22:31:01 -10:00
Simon Michael
b5cdc295b4 ;just: find GNU tar more portably 2024-01-24 22:06:59 -10:00
Simon Michael
04bbcc076d ;tools: bench.sh: simplify default benchmarks 2024-01-24 21:59:58 -10:00
Simon Michael
492dfb0cdc ;just: bench: improve 2024-01-24 21:55:08 -10:00
Simon Michael
08dc13aca0 ;just: get-binaries 2024-01-24 21:49:27 -10:00
Simon Michael
94c9317670 ;examples:multi-year:readme: clarify/warn about print --equity losing directives 2024-01-23 23:52:52 -10:00
Simon Michael
508ccfc7d2 imp: balance assertions error: show costs detail with --debug=2 2024-01-23 22:18:34 -10:00
Simon Michael
54c60b4de9 imp: balance assertions error: clarify wording 2024-01-23 22:18:34 -10:00
Simon Michael
e694e7869d fix: check mixed-cost balances correctly again; cleanup (#2150)
The code is a bit clearer, and it no longer discards amounts other
than the first when the running balance contains multiple costs.
(This bug was exposed by the fix for #2039).
2024-01-23 21:35:07 -10:00
Simon Michael
8ec46baec9 dev: clarify behaviour of filterMixedAmountByCommodity, showMixedAmount* 2024-01-23 21:35:06 -10:00
Simon Michael
df79aa5e35 dev: distinguish oneLineFmt and oneLineNoCostFmt; add fullZeroFmt 2024-01-23 21:35:06 -10:00
Simon Michael
999cba8c31 dev: cleanup; add showAmountWith, showMixedAmountWith 2024-01-23 21:35:06 -10:00
Simon Michael
0cb382cf0e dev: rename AmountDisplayOpts -> AmountFormat, and related constants
noColour          -> defaultFmt
noCost            -> noCostFmt
oneLine           -> oneLineFmt
csvDisplay        -> machineFmt
2024-01-23 21:35:06 -10:00
Simon Michael
e2ed2b3b6d dev: clarify showAmountsCostB 2024-01-23 21:35:06 -10:00
Simon Michael
ca55c2f0f8 dev: rename other Price helpers to Cost
showAmountWithoutPrice             -> showAmountWithoutCost
mixedAmountStripPrices             -> mixedAmountStripCosts
showMixedAmountWithoutPrice        -> showMixedAmountWithoutCost
showMixedAmountOneLineWithoutPrice -> showMixedAmountOneLineWithoutCost
2024-01-23 21:35:06 -10:00
Simon Michael
323f87b3e9 dev: Amount: aprice -> acost
Acked-by: Simon Michael <simon@joyful.com>
2024-01-23 21:35:06 -10:00
Simon Michael
8102bd9c2b dev: AmountPrice,UnitPrice,TotalPrice -> AmountCost,UnitCost,TotalCost; related renames 2024-01-23 21:35:06 -10:00
Simon Michael
e201775e93 dev: amountStripPrices -> amountStripCost 2024-01-23 21:35:06 -10:00
Simon Michael
0353840d90 dev: showAmountPrice -> showAmountCostB, showAmountPriceDebug -> showAmountCostDebug 2024-01-23 21:35:06 -10:00
Colin Dean
2ac0905c70 dev: Runs shellcheck on hledger-simplebal
Shellcheck handled the variable fixups. The pipefail flag avoids another
Shellcheck warning w.r.t. handling pipe failures. This script is so
minimal that it's safe to simply fail the pipe entirely if the hledger
command fails.
2024-01-23 06:30:32 -10:00
Colin Dean
4faa381ccd fix: Run shellcheck on hledger-bar
I [encountered][1] an unexpected error when testing hledger-bar for
proposed inclusion in Homebrew's default installation of hledger:

    /opt/homebrew/Cellar/hledger/1.32.2_1/bin/hledger-bar: line 81:
    conditional binary operator expected

I'm doubt that this is fixed by running shellcheck, but checking
a script against shellcheck is usually one of the first things I check
before debugging shell!

This patch is ~generated by shellcheck with

    shellcheck --shell=bash --enable=all --format=diff bin/hledger-bar | \
    git apply

plus some extra, manual additions in the form of a shellcheck directive
to accept something that's a little abnormal for shellcheck but fine
here. The `set -o inherit_exit` was also recommended by shellcheck.

[1]: https://github.com/Homebrew/homebrew-core/actions/runs/7606843601/job/20713321881?pr=160590
2024-01-22 18:16:47 -10:00
Simon Michael
bd8bd393f2 ;fix:hledger-bar: really fix the error when NO_COLOR is not defined [#2159]
Also, it's now more compliant with the no-color.org spec:

  Command-line software which adds ANSI color to its output by default
  should check for a NO_COLOR environment variable that, when present
  and not an empty string (regardless of its value), prevents the
  addition of ANSI color.

so one can now temporarily override $NO_COLOR=1 in the environment by
setting it empty: NO_COLOR= hledger ...
2024-01-22 12:40:48 -10:00
Simon Michael
0f30316cfd ;bin:hledger-bar: fix an error when NO_COLOR is not defined [#2159] 2024-01-22 11:28:13 -10:00
Simon Michael
d8addd5926 ;bin:hledger-bar: fix a shellcheck warning 2024-01-22 10:29:47 -10:00
Simon Michael
ac47ea4a0e imp:balance assertion error message: make it clearer, show diff again 2024-01-21 15:02:51 -10:00
Simon Michael
6091f583dc fix: import: --catchup works again [#2156] 2024-01-21 12:33:15 -10:00
Simon Michael
41711d8ab5 fix:--anon: now hidden, gives an error, still usable as --obfuscate [#2133] 2024-01-21 11:59:11 -10:00
Simon Michael
0cdc012fd9 dev:journalTransform: cleanup 2024-01-21 10:25:55 -10:00
Simon Michael
f3073990cc imp:close: infer a default tag value by incrementing current file name [#2151] 2024-01-21 02:30:33 -10:00
Simon Michael
c2ce1c2037 imp:close: add tags, with optional custom value, for easier matching/exclusion [#2151]
They are `balances:` for assertion transactions,
`retain:` for retained earnings transactions,
and `start` for opening/closing transactions.

And some --help cleanups.
2024-01-21 01:44:14 -10:00
Simon Michael
29ac554765 ;doc:tags: discuss tag names, list reserved ones 2024-01-21 01:25:54 -10:00
Simon Michael
298a9c29b4 ;dev: Query comments 2024-01-21 00:57:30 -10:00
Simon Michael
f53f3a0194 dev:close: refactor 2024-01-20 21:53:46 -10:00
Simon Michael
38d9f1760e ;examples:multi-year: edits 2024-01-20 16:48:58 -10:00
Simon Michael
b418e686c9 ;examples:multi-year: edits 2024-01-20 16:36:52 -10:00
Simon Michael
15b4f9e8d2 ;doc:close: layout 2024-01-20 16:18:25 -10:00
Simon Michael
4b1410c4b5 ;doc:close: fix link 2024-01-20 16:14:35 -10:00
Simon Michael
5d073e16e3 ;doc:close: edits 2024-01-20 16:07:00 -10:00
Simon Michael
6b5b467cce doc:close: edits 2024-01-20 15:43:46 -10:00
Simon Michael
682609c501 ;examples:README: update 2024-01-20 15:42:38 -10:00
Simon Michael
4ccb5ad9f6 ;examples:multi-year: expand, show equity & accounting equation [#2151] 2024-01-20 15:42:38 -10:00
Simon Michael
e61c9bad10 ;examples:multi-year: how to show year-end balances in closed files [#2151] 2024-01-20 15:42:38 -10:00
Simon Michael
785206ee94 ;doc:close: rewrite again; and give a better excluding technique [#2151] 2024-01-20 15:42:38 -10:00
Simon Michael
cd72c62858 imp:close: exclude E by default; and always exclude the balancing account [#2151]
The first of some changes discussed on the issue. A more useful default ?
2024-01-20 15:42:38 -10:00
Simon Michael
582d6dbdd7 ;doc:CREDITS: committer avatars 2024-01-19 15:59:58 -10:00
Simon Michael
28d30ae8a1 ;doc:ISSUES: fix links 2024-01-18 20:18:01 -10:00
Simon Michael
e92575d9e6 ;doc:ISSUES: update regressions label 2024-01-18 19:43:17 -10:00
Simon Michael
0a5650f13d ;doc:REGRESSIONS: update, list all regressions since 1.19 2024-01-18 19:35:30 -10:00
Simon Michael
cc254dda26 ;doc:ISSUES: cleanup 2024-01-18 13:03:07 -10:00
Simon Michael
2182560ab4 ;doc:ISSUES: cleanup 2024-01-18 12:48:24 -10:00
Simon Michael
6f30cea2fc ;doc:ISSUES: update open issues table 2024-01-18 12:44:48 -10:00
Simon Michael
fa66d18e40 ;doc:ISSUES: fix links 2024-01-18 12:44:39 -10:00
Simon Michael
0d1fbb334e ;doc:REGRESSIONS: edit 2024-01-18 11:52:35 -10:00
Simon Michael
239ba6ed8d ;doc:REGRESSIONS: update 2024-01-18 11:42:53 -10:00
Simon Michael
4a00e9bbb9 ;just:commitlog: show pta.o commits 2024-01-18 11:42:53 -10:00
hamzashezad
6afff58fb8 ;doc: add version annotations for features in 1.32
- match groups and match negations
- beancount output format
- tsv output format
- consistently add annotation
- `--round` for print
2024-01-17 00:12:57 -10:00
Simon Michael
6461839e33 ;doc:journal:tags: edit 2024-01-15 10:54:26 -10:00
Simon Michael
eb6d038090 ;doc:journal:tags: clarify multiple tags 2024-01-15 10:47:17 -10:00
Simon Michael
0a54f6313c ;doc: more links to Amount formatting, parseability [#2152] 2024-01-15 06:37:39 -10:00
Simon Michael
c92a0852f8 ;doc: update manuals 2024-01-12 13:56:01 -10:00
Simon Michael
d064b12898 ;doc: update command help 2024-01-12 13:55:49 -10:00
Simon Michael
584ab748d5 ;doc:manuals: remove all "experimental" annotations for now, 2 2024-01-12 13:55:39 -10:00
Simon Michael
352b0bc1b5 ;doc: update manuals 2024-01-12 13:52:11 -10:00
Simon Michael
ebda894b23 ;doc: update command help 2024-01-12 13:52:00 -10:00
Simon Michael
ea99aa9dfb ;doc:manuals: remove all "experimental" annotations for now 2024-01-12 13:47:30 -10:00
Simon Michael
43dc321742 ;just:bench: accept quickbench args 2024-01-12 07:01:21 -10:00
Simon Michael
76209d5765 ;doc:forecasting: drop unnecessary reference to budgeting 2024-01-09 09:36:27 -10:00
Simon Michael
80e4428e77 ;doc:close: improvements 2024-01-06 18:42:46 -10:00
Simon Michael
50441dae04 ;doc:close: improvements 2024-01-06 18:26:53 -10:00
Simon Michael
3b6d00ff9a ;doc:scripts:sortandmergepostings: edit 2024-01-06 14:01:28 -10:00
Simon Michael
6b2cb5124a ;doc:scripts:sortandmergepostings: give a little more context 2024-01-06 13:56:51 -10:00
Simon Michael
59999e4ada enh:close: add --assert and --assign modes, generating assertions or assignments 2024-01-06 10:26:33 -10:00
Simon Michael
30de688765 ;doc:readme: cleanup 2024-01-06 10:26:33 -10:00
Simon Michael
c5a5ea6e5b ;doc: REGRESSIONS: split the bounty between finder and fixer 2024-01-05 23:42:18 -10:00
Simon Michael
31ce7ecea5 ;doc:readme: add a few more OC avatar slots ? 2024-01-05 11:46:27 -10:00
Simon Michael
3c868988a9 ;ci:windows: switch to more recent ghc (9.6.3) 2024-01-05 11:25:30 -10:00
Simon Michael
4fcc09b259 fix:pkg:include hledger-ui.exe in release binaries 2024-01-05 11:17:40 -10:00
Simon Michael
840b8ba67d ;examples:invoicing: cleanups 2024-01-05 09:18:32 -10:00
Simon Michael
735fbaef42 ;examples:pandoc-make-invoice: remove the REMOVE THIS LINE line 2024-01-05 09:16:50 -10:00
Simon Michael
71642799ea ;doc:examples:readmes: edits 2024-01-05 08:36:41 -10:00
Simon Michael
625261baac ;doc:examples:invoicing:pandoc-make-invoice: don't write to $LEDGER_FILE 2024-01-05 08:31:58 -10:00
Simon Michael
0a759d3269 ;doc:examples:invoicing: rename scripts 2024-01-05 08:28:51 -10:00
Simon Michael
cc403d5ff9 ;doc:examples: expand READMEs, clarify status for examples 2024-01-05 08:22:12 -10:00
Simon Michael
03f6864e60 ;doc:examples: markdown readme 2024-01-05 07:39:35 -10:00
Simon Michael
529d930b5a fix:add: rethink adding default commodity symbol; fix doc instead (part 2) [#815] 2024-01-04 21:13:40 -10:00
Simon Michael
62e3ec9b34 ;doc:journal:balance assignments: price -> cost 2024-01-04 20:51:48 -10:00
Simon Michael
9ccc1d3fa5 fix:add,import,web: really avoid filenames ending with . on Windows [#1056]
On MS Windows, trying to add or import or web add to a file whose name
ends with a dot could cause data loss, so in 2019 I made this raise an
error instead (in Hledger.Read.ensureJournalFileExists).

But, the logic was backward, so it did not do the check on Windows.
Now it does.

Also I have removed mention of this from add's doc; currently it's
not documented anywhere. It's obscure, but maybe this is not ideal.
2024-01-04 17:35:22 -10:00
Simon Michael
d462611d6a fix:add: rethink adding default commodity symbol; fix doc instead [#815] 2024-01-04 17:33:05 -10:00
Simon Michael
034d37c3be fix👿stack: build with ghc 9.8, latest stackage nightly (part 2)
Fix the build with GHC < 9.8.

This reapplies commit 87600e5dd, this time with the correct description.
2024-01-04 17:33:02 -10:00
Simon Michael
d4a5361081 dev: Revert "fix:add: apply the D default commodity to bare numbers, per docs, 2 [#815]"
This reverts commit 87600e5dd, which had a wrong description.
2024-01-04 16:57:38 -10:00
Simon Michael
87600e5dd3 fix:add: apply the D default commodity to bare numbers, per docs, 2 [#815]
Avoid breaking GHC < 9.8.
2024-01-04 13:50:37 -10:00
Simon Michael
202aff6549 dev:add.test: convert to modern shelltest format 2024-01-04 13:37:13 -10:00
Simon Michael
1fcc8f1c89 fix:add: apply the D default commodity to bare numbers, per docs [#815] 2024-01-04 13:24:57 -10:00
Simon Michael
9f5f235198 ;doc:journal:auto postings: edit 2024-01-04 13:05:56 -10:00
Simon Michael
1f1cc58efc ;doc:journal:auto postings: clarify 2024-01-04 12:54:39 -10:00
Simon Michael
0c2bc9c217 ;install: bump stackage resolver and belatedly hledger-install version 2024-01-04 08:42:36 -10:00
Simon Michael
19461010f8 ;pkg:stack: use lts 22.4 2024-01-04 08:39:29 -10:00
Simon Michael
a0922a3866 ;cabal: update cabal files 2024-01-04 08:25:13 -10:00
Simon Michael
2a99b3d456 imp: stack: build with ghc 9.8, latest stackage nightly 2024-01-04 08:24:50 -10:00
Simon Michael
1648d2bcb7 fix:check:tags: also ignore builtin modified, _modified tags [#2148]
These tags are generated by --auto.
2024-01-04 05:55:24 -10:00
Simon Michael
c0b6a1e153 ;just:bloglog 2024-01-03 21:30:49 -10:00
Simon Michael
56aa988205 ;doc:RELEASING: updates 2024-01-03 21:03:45 -10:00
Simon Michael
6d455e765c ;doc:changelogs: cleanup 2024-01-03 20:43:39 -10:00
Simon Michael
5b1281fc69 ;doc: update changelogs 2024-01-03 20:42:28 -10:00
Simon Michael
ea34562b4b ;doc: changelogs 2024-01-03 20:42:04 -10:00
Simon Michael
0a838bdd6c ;doc:changelogs: cleanup for easier merge 2024-01-03 20:41:36 -10:00
Simon Michael
65ccdb4696 install: 1.32.2 2024-01-03 20:40:35 -10:00
Simon Michael
680205b72d ;doc:RELEASING: cleanup, summarise 2023-12-31 14:35:45 -10:00
Simon Michael
1128927632 ;doc:changelogs: whitespace 2023-12-30 20:29:49 -10:00
Simon Michael
04449ea12c ;just: log: more 2023-12-30 16:43:39 -10:00
Simon Michael
c825605721 ;doc:cli: html version: drop quick reference links 2023-12-29 19:52:12 -10:00
Simon Michael
137d825f7f ;just: format 2023-12-29 13:03:50 -10:00
Simon Michael
173e65fcc1 ;just: format: better commit message 2023-12-29 13:03:35 -10:00
Simon Michael
0be21fde65 ;just: log, summarise activity 2023-12-29 13:00:38 -10:00
Simon Michael
3b3adc83c2 ;just: cleanup 2023-12-29 05:06:13 -10:00
Simon Michael
e2525e05f8 just: fmt 2023-12-29 04:54:16 -10:00
Simon Michael
d6bc5e3875 ;just: watch args, cleanup 2023-12-29 04:54:16 -10:00
Simon Michael
a7b2c74d3b ;doc:journal:queries: edits 2023-12-27 14:39:17 -10:00
Simon Michael
bcf7ad9bf2 ;doc:journal: periodic txns, auto postings: edits 2023-12-27 08:41:55 -10:00
Simon Michael
1ac5237d54 ;doc:queries: edits 2023-12-24 10:56:20 -10:00
Simon Michael
d11158f53b ;doc:queries: edits 2023-12-24 10:03:43 -10:00
Simon Michael
0d7daffad8 ;doc:queries: edits 2023-12-24 10:00:42 -10:00
Simon Michael
2f479fc931 ;just: etags fixes 2023-12-24 09:44:06 -10:00
Simon Michael
bf54f84b2c ;just: cleanups 2023-12-24 09:43:54 -10:00
Simon Michael
8b45d4ba8c fix:csv: fix %FIELD interpolation in assignments using \n [#2134]
In field assignment values we now parse %FIELD references, \MATCHGROUP references
and "\n" newline markers more carefully, so all can coexist.
Parsing these values might be slower than before, but hopefully not noticeably so.
2023-12-23 19:25:34 -10:00
Simon Michael
20c299684b dev:csv: clarify renderTemplate [#2134] 2023-12-23 19:25:22 -10:00
Simon Michael
8f6b7b202e fix: traceOrLog and a rare warning from valuation code
Hledger.Utils.Debug.traceOrLog was logging when it should trace and vice versa.

This affected a warning which Hledger.Data.Valuation.pricesShortestPath
should display if encountering a pathologically long (>1000) price chain.
Also note some oddities about that warning.
2023-12-23 19:22:33 -10:00
Simon Michael
42c7383f57 ;dev:Hledger.Utils.Parse: cleanup 2023-12-23 19:22:33 -10:00
Simon Michael
4b7e7f77bd ;dev:Hledger.Utils.Debug: haddockify some comments so they show in hover 2023-12-23 19:22:33 -10:00
Simon Michael
4651f2e0bb ;doc: rename DEVWORKFLOWS.md to avoid a clash 2023-12-23 14:53:23 -10:00
Simon Michael
e45f09f99c ;just: updates, cleanups 2023-12-22 17:16:07 -10:00
Simon Michael
6a2e30897f ;doc: clarify how auto postings work 2023-12-21 15:19:36 -10:00
Vekhir
095f65d9b4 ;imp: hledger-ui: add brick 2.2 support to package.yaml 2023-12-19 10:08:53 -10:00
Vekhir
30ceeadcf7 imp: Support brick 2.2 2023-12-19 10:08:53 -10:00
ShrykeWindgrace
ce02f20d29 feat: support hledger-ui on windows
Introduced or bumped dependencies:

- brick-2.1.1
- vty-6.1
- vty-crossplatform-0.4.0.0
- vty-windows-0.2.0.1 conditionally on windows (current version of
  vty-crossplatform has 0.2.0.0 as a lower bound, need to put a newer version explcitly;
  once we get a newer vty-crossplatform, we will be able to drop this conditional)
- vty-unix (indirectly via vty-crossplatform)
2023-12-19 08:20:16 -10:00
ShrykeWindgrace
03808552ff feat: add notepad as default editor for windows 2023-12-19 08:20:16 -10:00
Simon Michael
fcda6bfb35 ;doc: REGRESSIONS 2023-12-19 08:06:59 -10:00
Simon Michael
4e3db05507 ;just: functest: allow any shelltest options 2023-12-16 11:13:27 -10:00
Simon Michael
7163bb4290 ;dev: revert chinese.journal, fix func tests 2023-12-16 11:12:35 -10:00
Simon Michael
51826d5c90 ;just: fmt 2023-12-16 10:59:18 -10:00
Simon Michael
d7ff57add9 ;just: drop cloc 2023-12-16 10:59:15 -10:00
Simon Michael
9a38fd7efb Merge branch 'just' 2023-12-16 10:48:22 -10:00
Simon Michael
57a92a2caa ;git: mailmap: update to clean up git shortlog -se
Dump everyone in there, it's easier.
2023-12-16 10:46:41 -10:00
Simon Michael
7c82c54f0b ;just: more porting, cleanups 2023-12-16 10:46:20 -10:00
Simon Michael
f4156475cf ;just: port more make rules 2023-12-15 19:35:18 -10:00
Simon Michael
f7763cbc9c ;examples: update some example journals 2023-12-15 19:35:18 -10:00
Simon Michael
1f5a6fc758 ;tools: generatejournal: make runnable without compiling, with arguments 2023-12-15 19:35:18 -10:00
Simon Michael
07967b4c04 ;just: _watch 2023-12-15 19:35:18 -10:00
Simon Michael
da5c507383 ;just: fmt 2023-12-15 19:35:18 -10:00
Simon Michael
78aea61b60 ;just: capitalise 2023-12-15 19:35:18 -10:00
Simon Michael
1d69d9b71f just: port/copy remaining make rules (TESTING, BENCHMARKS, DOCUMENTATION, MISC) 2023-12-15 19:35:02 -10:00
Simon Michael
4333694bd3 ;just: show some group headings; cleanup 2023-12-15 18:29:42 -10:00
Simon Michael
5798a73a96 ;just: format 2023-12-15 18:29:42 -10:00
Simon Michael
e1711f613f just: port BUILDING make rules 2023-12-15 18:29:42 -10:00
Simon Michael
9430ca5109 just: port INSTALLING make rules 2023-12-15 18:29:42 -10:00
Simon Michael
d1ca270063 ;doc: REGRESSIONS: cleanup 2023-12-15 14:53:22 -10:00
Simon Michael
ad1c2d43cc ;doc: REGRESSIONS, group by version 2023-12-15 14:48:09 -10:00
Simon Michael
2bd78cdbc4 ;doc: REGRESSIONS, group by version 2023-12-15 14:44:06 -10:00
Simon Michael
217f9787aa ;doc:REGRESSIONS 2023-12-15 14:26:56 -10:00
Simon Michael
bf8875bfbb ;doc:REGRESSIONS 2023-12-15 14:08:56 -10:00
Simon Michael
fccaf0d35a ;doc: update command help 2023-12-15 13:59:12 -10:00
Simon Michael
ac50d8c5a6 ;doc: update manuals 2023-12-15 13:59:02 -10:00
Simon Michael
60f7896dd5 fix:web: drop non-working --file-url option for now [#2139] 2023-12-15 13:58:25 -10:00
Simon Michael
13ebf18d24 fix:web: make --base-url work again [#2127], [#2100] 2023-12-15 13:58:25 -10:00
Simon Michael
7bc077cd8e ;cabal: update cabal files 2023-12-15 13:58:25 -10:00
Simon Michael
14a9ab5f28 dev:web:docs 2023-12-15 13:58:25 -10:00
Simon Michael
e81430f05b dev:web: rename makeFoundation* to makeApp* 2023-12-15 13:58:25 -10:00
Simon Michael
8e0370bd58 dev:web: rename Hledger.Web.Foundation to Hledger.Web.App 2023-12-15 13:58:25 -10:00
Simon Michael
0396725e71 dev:web: cleanup 2023-12-15 13:58:25 -10:00
Simon Michael
d5b967834f dev:web: add tests: --base-url, --file-url (disabled) [#2127], [#2139] 2023-12-15 13:58:22 -10:00
Simon Michael
9c56ed1104 imp!:web:tests: respect options when running tests
The hledger-web tests have been cleaned up and now allow more testing
of command line options like (though still not everything).

Note tests now run the app listening on its default host and port,
127.0.0.1 and 5000, instead of "any IPv4 or IPv6 hostname" and 3000.
This would seem to mean hledger-web tests can conflict more with
things running on port 5000, eg a normal hledger-web instance, but I
haven't been able to reproduce it.
2023-12-15 09:57:01 -10:00
Simon Michael
80ebd18d08 imp:web: more accurate startup messages, eg with --socket [#2127] 2023-12-14 17:58:25 -10:00
Simon Michael
569d2c8e5f doc:web: clean up options and manual [#2134] 2023-12-14 15:31:49 -10:00
Simon Michael
fbd2fdef40 ;cabal: update cabal files 2023-12-14 08:58:02 -10:00
Simon Michael
a3290bfaeb pkg: allow megaparsec 9.6* 2023-12-14 08:57:42 -10:00
Simon Michael
eeb45ec6ef ;doc:ISSUES:prioeritisation: sync levels with github labels 2023-12-13 18:07:01 -10:00
Simon Michael
6771d37f13 ;github: issue templates: update 2023-12-13 11:45:37 -10:00
Simon Michael
b9826434e7 ;github: new issue templates: edits 2023-12-12 23:08:02 -10:00
Simon Michael
c740891feb ;github: new issue templates: more cleanups; solicit severity and likelihood estimates
(for ISSUES.md > Prioritising)
2023-12-12 22:38:44 -10:00
Simon Michael
1c840e144c ;github: new issue templates: cleanups 2023-12-12 22:31:05 -10:00
Simon Michael
d2f95966ab ;github: new issue templates: cleanups 2023-12-12 22:20:07 -10:00
Simon Michael
ad36708518 ;doc: ISSUES: update 2023-12-12 21:58:40 -10:00
Simon Michael
5bcf69a72b ;doc: ISSUES: edit 2023-12-12 21:45:00 -10:00
Simon Michael
11090a53ee ;doc: ISSUES: simpler prioritisation scheme 2023-12-12 21:41:59 -10:00
Simon Michael
0646218205 ;doc: ISSUES: edits 2023-12-12 19:01:30 -10:00
Simon Michael
766faf5c1e ;doc: ISSUES 2023-12-12 18:58:34 -10:00
Simon Michael
b61e731f24 ;ci: ignore the commit message check if it fails 2023-12-12 18:26:15 -10:00
Simon Michael
22882e2b49 ;doc: ISSUES 2023-12-12 18:17:42 -10:00
Simon Michael
122cd22bc6 ;doc:journal: balance assertions and *costs* 2023-12-12 18:09:28 -10:00
Ilja Kocken
0e2aa1623b add Wise CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
9407e115ba add ING CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
3290065441 add Venmo CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
cb751cf674 add PayPal 2023 CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
d7cfdfd651 add FHB CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
336a14c27f add N26 CSV rules file 2023-12-09 11:02:50 -10:00
Ilja Kocken
ce9905e768 add Triodos CSV rules file 2023-12-09 11:02:50 -10:00
Simon Michael
b6531a516e just: format 2023-12-09 00:30:31 -10:00
Simon Michael
74864f682e just: hide check, fmt 2023-12-09 00:30:31 -10:00
Simon Michael
67deeafd34 just: push 2023-12-09 00:26:06 -10:00
Simon Michael
36e1380674 ;tools: just, make, shake: cleanup 2023-12-09 00:20:57 -10:00
Simon Michael
7b8df1d34f ;tools: port bake to just, clean up 2023-12-09 00:16:54 -10:00
Simon Michael
c0e9a7f797 ;tools: start using just, a possible replacement for make and bake 2023-12-09 00:16:53 -10:00
Simon Michael
aaf4a38161 fix:timedot: accept numbers beginning with a decimal point again [#2130] 2023-12-08 15:08:35 -10:00
Simon Michael
2cf83cd213 ci: bump shelltestrunner to 1.10 2023-12-08 06:56:48 -10:00
Simon Michael
b0c4bf6f22 ci: bump ghc version to 9.4.4, preliminary for #2129, #2128 2023-12-08 06:34:43 -10:00
Simon Michael
cf99c4ab5d ;stack:9.4: bump to 9.4.8 2023-12-08 06:34:16 -10:00
Simon Michael
51224f6e27 fix: bal --budget --layout=tall was hiding commodity symbols
When reports want to render amounts without commmodity symbols,
they must now use AmountDisplayOpts' new displayCommodity flag.
(Previously it was a side effect of setting displayCommodityOrder.)
2023-12-08 05:52:29 -10:00
Simon Michael
0bc86c95e4 lib: Hledger.Data.Amount: noPrice -> noCost 2023-12-07 23:35:50 -10:00
Simon Michael
862b7e5712 dev: clarify AmountDisplayOpts, add a new flag for symbol display 2023-12-07 23:35:50 -10:00
Simon Michael
aa8c0e8279 ;doc:balance:budget report: tighten up 2023-12-07 23:35:50 -10:00
Simon Michael
c9764e82c9 ;doc:balance:budget report: trim some content
Moved "Budgets and subaccounts" to the cookbook's Budgeting page,
I think it's not needed in the reference manual.
2023-12-07 19:03:52 -10:00
Simon Michael
0526c834dd ;doc:balance:budget report: update/clean up 2023-12-07 18:48:26 -10:00
Simon Michael
9bad34c341 ;doc: changelogs 2023-12-07 11:36:39 -10:00
Simon Michael
1bd7e1bf48 ;doc: update manuals 2023-12-07 11:33:14 -10:00
Simon Michael
e2751a79a3 ;doc: github-release 2023-12-07 11:32:33 -10:00
Simon Michael
7ace5ee560 ;doc: changelogs for 1.32.1 2023-12-07 11:32:20 -10:00
Simon Michael
74cbbd152f ;doc: note that payee and tag can't have tags, unlike account 2023-12-07 09:04:48 -10:00
Simon Michael
c062b14c5d imp: auto-declare builtin tag names like type: and t: (#2119)
Now using type: in account declarations or generating t: with timedot
letters won't cause the `tags` check to fail.

If a user declares any of these explicitly with a tag directive,
it does not cause an error.
2023-12-07 08:55:05 -10:00
Simon Michael
6ae64c8f3e imp: allow declaring the empty payee name with "" (#2119) 2023-12-07 08:30:55 -10:00
Simon Michael
6a41ed9e64 imp: drop the "a difference of ..." line from balance assertion errors
Rationale:
To satisfy the recentassertions check I'm often filling in a bunch of
placeholder balance assertions, copy/pasting the correct amount from
the balance assertion failure messages. In this situation the
difference just repeats the amount in the line above, with opposite
sign, which makes it harder for me to interpret the message and to
copy-paste the right amount. And more generally I think showing the
difference isn't really necessary.
2023-12-07 07:58:52 -10:00
Simon Michael
1d29540a53 ;doc:csv:matchers: clarify, mention !/& limitation (#2088) 2023-12-07 07:58:52 -10:00
Simon Michael
22ac8d056d fix:print: pad/round amounts with inferred costs like the others (#2123) 2023-12-07 03:41:31 -10:00
Simon Michael
cf48fbfad8 ;doc: REGRESSIONS: 2125 2023-12-07 03:41:31 -10:00
Simon Michael
c6a580ff3b fix:import: save each file's latest dates, separately (#2125) 2023-12-07 03:41:31 -10:00
Simon Michael
d1635a55f8 lib: move readFileStrictly to Hledger.Utils.IO 2023-12-07 03:41:31 -10:00
Simon Michael
7899b992b7 fix: prevent a Glob/filemanip package conflict in IO.hs 2023-12-05 17:43:04 -10:00
Simon Michael
d831f48cb0 ;doc: update manuals 2023-12-02 09:09:53 -10:00
Simon Michael
ab313c49c7 ;cabal: update cabal files 2023-12-02 09:09:07 -10:00
Simon Michael
80d1da2db9 ;pkg: bump version to 1.32.99 2023-12-02 09:09:07 -10:00
Simon Michael
26f56e0a13 ;doc: changelogs: merge edits from release branch 2023-12-02 09:06:53 -10:00
Simon Michael
a77c8e0e92 ;doc: update github release template 2023-12-02 09:03:33 -10:00
Simon Michael
4e65d91bc9 pkg: ui: upper bounds for vty & brick 2023-12-02 09:03:20 -10:00
Simon Michael
5c9d98d482 install: 1.32 2023-12-02 09:03:17 -10:00
Simon Michael
38140945f7 ;ci: use newer shelltestrunner with newer ghc 2023-12-02 09:03:14 -10:00
Simon Michael
565e068a00 ;doc: RELEASING tweaks 2023-12-01 22:02:30 -10:00
Simon Michael
2b7e34a247 ;doc: 1.32 announcements 2023-12-01 20:10:39 -10:00
Simon Michael
e90483a75a ;doc: update manuals 2023-12-01 17:25:00 -10:00
Simon Michael
6cfeb65d7b ;doc: update command help 2023-12-01 17:24:23 -10:00
Simon Michael
71222d75e5 ;doc: changelogs: edit 2023-12-01 17:23:31 -10:00
Simon Michael
0b4b4ed70c ;doc: draft changelogs from commit messages (Shake changelogs) 2023-12-01 17:23:31 -10:00
Simon Michael
938b89ecab ;doc: draft changelogs from TWIH (site/src/news.md) 2023-12-01 17:23:31 -10:00
Simon Michael
d652535632 ;tools: bake projectcommits 2023-12-01 17:23:31 -10:00
Simon Michael
f2d7f2f289 ;tools: bake lastweek: drop an unnecessary report 2023-12-01 17:23:31 -10:00
Charlie Ambrose
3645720157 ;doc: Update pathspec for running roi-unrealised.ledger and generated output. 2023-12-01 17:21:33 -10:00
Simon Michael
f2a7f71a00 ;doc: timedot: example tweak 2023-11-26 08:47:58 -10:00
Simon Michael
3f2e6381ee ;doc: Amount formatting, parseability: improve example 2023-11-26 08:41:20 -10:00
Simon Michael
e66945bc51 ;doc: Amount formatting, parseability: fix link 2023-11-26 08:33:37 -10:00
Simon Michael
0c85b48d2c ;doc: use ``cli not ``shell for command-line examples 2023-11-26 08:30:04 -10:00
Simon Michael
a1988546f1 ;doc: Amount formatting, parseability: fix link 2023-11-26 08:20:59 -10:00
Simon Michael
20ab21e1fa ;doc: Amount formatting, parseability: examples, links 2023-11-26 08:01:57 -10:00
Simon Michael
84f11c2c07 ;doc:REGRESSIONS: note real name exposure 2023-11-25 21:28:34 -10:00
Simon Michael
833cd45188 ;doc:REGRESSIONS: note one pending 2023-11-25 21:28:34 -10:00
Simon Michael
b6a46f637f feat:timedot: tagged time logging with letters 2023-11-25 21:28:23 -10:00
Simon Michael
6a232e247a ;doc:timedot: cleanups 2023-11-25 21:28:23 -10:00
Simon Michael
96f9c1d2b2 ;dev: lotcostp: cleanup 2023-11-23 09:14:54 -10:00
Simon Michael
b4a6212453 imp:ledger-compat: accept lot costs with spaces after {, like Ledger 2023-11-23 08:31:57 -10:00
Simon Michael
4b13af0634 imp:print:beancount: conversion improvements
- omit balance assertions
- replace more currency symbols, and match within symbols like C$
- do more account validation, and error if conversion is too hard
- backslash-escape double quotes and backslashes in payee and note
2023-11-23 01:47:15 -10:00
Simon Michael
0b8e920810 imp:print:beancount: also convert cost amounts 2023-11-22 23:54:10 -10:00
Simon Michael
0bf0c30b8d doc: update manuals 2023-11-22 22:57:55 -10:00
Simon Michael
fcfa7ed78a ;doc: update command help 2023-11-22 22:57:36 -10:00
Simon Michael
a8062381dd ;cabal: update cabal files 2023-11-22 22:57:36 -10:00
Simon Michael
e2cc2d7e24 feat:print: add a basic beancount output format
This prints journal output more likely (but not guaranteed) to
be readable by Beancount.

All packages now require text 1.2.4.1 or greater.
2023-11-22 22:57:36 -10:00
Simon Michael
606d99834a fix: -o/--outputfile with a .json or .sql extension now selects those formats 2023-11-22 19:25:37 -10:00
Simon Michael
f2026aec5a ;doc:commodity directive: edits 2023-11-22 16:27:26 -10:00
Simon Michael
e623df23a3 ;doc:commodity directive: explain why decimal mark is required 2023-11-22 16:23:16 -10:00
Simon Michael
443336033e ;doc: amount formatting: correction, csv does not force . (#2115) 2023-11-22 16:06:33 -10:00
Simon Michael
5cda7c582a ;doc: amount formatting: edits (#2115) 2023-11-22 15:27:41 -10:00
Simon Michael
edf6738109 ;doc: amount formatting: edits (#2115) 2023-11-22 14:49:59 -10:00
Simon Michael
b5fd3c767c ;doc: amount formatting: edits (#2115) 2023-11-22 14:46:50 -10:00
Simon Michael
1744021986 fix: non-print-like reports no longer add trailing decimal marks (fix #2115)
That 1.31 change was advertised as being for the print command only,
but it affected all commands. Now it affects only print and other
"print-like" commands (ie all commands that show whole journal entries
that we might want to re-parse).

Also three classes of hledger output, and how they modify the
commodity display styles' digit group marks and decimal marks
to suit different consumers, have been identified and documented
(under REPORTING CONCEPTS).
2023-11-22 14:22:51 -10:00
Simon Michael
ef2f3e1607 ;doc:csv:if table: clarify, explain why backslash won't work (#2107) 2023-11-21 12:01:28 -10:00
Simon Michael
32d9deb3e1 ;bin:bar: cleanup 2023-11-21 09:27:26 -10:00
Simon Michael
2b18715885 fix:csv: fix tag: queries on CSV data (#2114) 2023-11-20 21:55:11 -10:00
Simon Michael
4febb74d1e ;doc:journal: decimal marks, commodity directives: rewrites 2023-11-20 10:45:37 -10:00
Simon Michael
d717732928 ;doc: Hledger.Read: cleanups (#2113) 2023-11-16 23:37:20 -10:00
Simon Michael
037613abab ;doc: Hledger.Read: cleanups (#2113) 2023-11-16 23:28:14 -10:00
Simon Michael
fba297f705 imp:import: support -s/--strict properly (fix #2113)
hledger import -s now runs strict checks on an in-memory copy of the
updated journal, before updating the journal file; if strict checks
fail, nothing is written to disk.

And hledger import now does not update any .latest files until it has
run without error (no failing strict checks, no failure while writing
the journal file). This makes it more idempotent, so you can run it
again after fixing problems.
2023-11-16 22:21:05 -10:00
Simon Michael
e92ab28cce imp:reading: better timing of strict checks and .latest writing (#2113)
Strict checks now run only once, at end of the high level read operation,
and not for each individual file; this fixes some spurious --strict failures,
like account declarations not affecting a sibling file as they should.

And .latest file writing now happens as the last step, after passing
strict checks. This is mainly for the import command, but it also
means that hledger print --new now does not update .latest files
if strict checks are failing.

The file reading API has been improved and documented in more detail.
2023-11-16 21:48:43 -10:00
Simon Michael
5ee2139f18 imp: web: round amounts to display precision as before (precisiongeddon) 2023-11-14 13:26:06 -08:00
Simon Michael
6bd862efbf imp: ui: round amounts to display precision as before (precisiongeddon) 2023-11-14 13:23:40 -08:00
Simon Michael
96db4a1b97 ;tools:bake lastweek: time percentage report 2023-11-10 16:30:30 -08:00
Simon Michael
fa40077ebf ;doc: regular expressions: add examples (hledger_site#224) 2023-11-09 12:04:33 -08:00
Simon Michael
c8484b5792 ;doc: More valuation examples: drop obsolete explanation (precisiongeddon) 2023-11-09 06:19:57 -08:00
Simon Michael
f4de65ab48 doc:code: add Jargon section; describe styling/precision in detail (precisiongeddon) 2023-11-08 13:59:18 -08:00
Simon Michael
f2320bf57c ;doc: move Hledger.hs haddock to a named chunk below code 2023-11-08 13:59:18 -08:00
Simon Michael
8a2a9643de ;tools: bake jargon - extract Hledger.hs haddock examples to a test journal 2023-11-08 13:59:18 -08:00
Simon Michael
96f52ee00c ;tools: make haddock-watch etc.: new fast version, cleanups 2023-11-08 13:59:18 -08:00
Simon Michael
1ae59ad0af dev: Amount: cleanups 2023-11-08 13:59:18 -08:00
Simon Michael
e035730afb imp: roi: limit large decimals to 8 digits by default (precisiongeddon)
With valuation now preserving more decimal digits, roi could show
excessively precise decimals if there was no known display precision
for the valuation commodity. Now in that situation it limits the
precision to a maximum of 8 digits.
2023-11-08 13:59:18 -08:00
Simon Michael
f8ffd9cdda imp: more precision handling fixes, debug output, test updates (precisiongeddon)
This and the preceding commits were "work in progress" that got out of control.
There's more to do, but this one brings these precision-related improvements
(at least):

When "infinite decimals" arise, they are now generally shown with
8 decimal digits rather than 255.

print and prices no longer add trailing decimal zeros unnecessarily.

Some code has been refactored or given more debug output.

All tests have been updated to match the recent changes.
2023-11-08 13:59:18 -08:00
Simon Michael
c51d883162 imp: prices: clarify, fixes, improve semantics (precisiongeddon)
- The prices comand now more accurately lists the prices that hledger
  uses when calculating value reports (similar to what you'd see with
  eg `hledger bal -V --debug=2`).

- The prices command's --infer-reverse-prices flag was confusing since
  we always infer and use reverse prices; it has been renamed to --show-reverse.

- --infer-market-prices and --show-reverse combine properly.

- --show-reverse now ignores all zero prices rather than giving an error.

- Reverse prices (which can be infinite decimals) are now displayed
  with at most 8 decimal digits (rather than the internal precision of
  255 digits).

- Filtering prices by cur: or amt: now works properly.

- Price amounts are styled, but all decimal digits are shown.
2023-11-08 13:59:18 -08:00
Simon Michael
50dc7bebb1 imp: set display style, natural precision on valued amounts (fix #2105, precisiongeddon)
Cost/value conversion now applies the standard display style, and
sets the display precision equal to the internal decimal precision
(or 8 if the decimal appears to be infinite).
This means value reports and especially `print -V` now show amounts
with more accurate and standard style and precision.

New tests have been added describing and explaining various
style/precision behaviours in print cost/value reports.
2023-11-08 13:59:18 -08:00
Simon Michael
64ffdd7c9c dev: clarify some amount operations 2023-11-08 13:59:18 -08:00
Simon Michael
d435557979 lib: Hledger.Utils.Debug: lbl_ helper, cleanups, notes 2023-11-08 13:50:33 -08:00
Simon Michael
b1dc550c35 ;tools:bake dbgstrs 2023-11-08 13:50:33 -08:00
Simon Michael
6e54de12b2 ;tools:ghci :rmain 2023-11-08 13:50:33 -08:00
Simon Michael
a4d3573d29 ;dev: valuation.test: cleanup 2023-11-08 13:50:33 -08:00
Jonathan Dowland
d424966706 ;doc: import: document Match Groups
Add a description of Match Groups to the manual; Section "Matchers".
Include two examples.

Clarify a description of regular expression features with respect
to match groups.

Expand the description of field assignments to cover match group
interpolation, cross-referencing to Section "Matchers" for the full
description.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Jonathan Dowland
aaf50c165c test: import: functional tests for match group interpolation
Add functional tests for matching substrings in field matchers and
interpolating them into the corresponding field assignments. Check
the following properties and use-cases:

 * Use-case 1: matching a portion of a date in a known format
   (YYY-MM-DD) and writing a comment-command to warp a posting date.
   Useful for credit cards.
 * Use-case 2: match a portion of a CSV field and use it as an
   account assignment. Useful for my byzantine setup with two
   separate ledgers cross-importing to each other.
 * Ensure bracketed portions of field matchers are captured.
 * Ensure bracketed portions of record matchers are captured.
 * Check match token numerical offset is relative to match group,
   not the whole rules file.
 * Check nested matches work.
 * Ensure match group token expansion works with or without
   surrounding text.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Jonathan Dowland
8bfa382c68 feat: import: interpolate regex matches in field templates (#2009)
Replace occurrences of '\N' (where N is a positive number) in field
templates with the corresponding regular expression match group, if it
exists.

E.g. Warp the date to the first of the month for the second posting

    if %date (....-..)-..
        comment2 date:\1-01

E.g. Strip a prefix from an imported account name

    if %account1 liabilities:jon:(.*)
        account1 \1

Fixes #2009.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Jonathan Dowland
549c47bca8 ;dev: add Utils.Regex.regexMatchTextGroups
A matcher function which returns the list of match-groups, which may
be empty.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Jonathan Dowland
c619e387ea ;fix: import: minor typo 2023-11-08 13:49:39 -08:00
Simon Michael
23c961f4bb ;doc: Setting LEDGER_FILE: fix a quote (hledger_site#93) 2023-11-07 16:19:21 -08:00
Simon Michael
250d98df29 cabal: update cabal files 2023-11-07 09:25:29 -08:00
Simon Michael
fef3413c51 pkg:web: clean up some apparently redundant declarations and deps 2023-11-07 09:06:58 -08:00
Simon Michael
4813e3fc5f pkg:ui: fix wasteful double-building of hledger-ui modules 2023-11-07 09:06:56 -08:00
Simon Michael
96117ae514 ci: do haddock testing less often, in the mac binaries workflow
It costs 1m+, doesn't fail that often, and is not hard to fix even if
detected late.
2023-11-07 05:27:18 -08:00
Simon Michael
617e35ec57 ci: really fix some redundant building of hledger-lib and hledger 2023-11-07 04:59:53 -08:00
Simon Michael
1eee7f0208 ci: fix some redundant building of hledger-lib and hledger 2023-11-07 04:47:04 -08:00
Simon Michael
54b4c2ed22 fix: auto postings: detect redundant costs properly (fix #2110) 2023-11-07 04:38:39 -08:00
Peter Sagerson
efcea0600a feat: cli: Add tsv output (#869)
All commands that suport csv output now also support tsv output. The
data is identical, but the fields are separated by tab characters and
there is no quoting or escaping. Tab, carriage return, and newline
characters in data are converted to spaces (this should rarely if ever
happen in practice).
2023-11-06 16:46:04 -08:00
Simon Michael
dae7b352dd ;ci: disable weekly scheduled builds
They also run in forks, which I don't want.
2023-11-06 10:13:57 -08:00
Simon Michael
66cb349998 ci: fix tests breakage 2023-11-05 01:02:13 -07:00
Simon Michael
b19a9ff56d ;doc:tests:readme 2023-11-01 06:53:25 +00:00
Simon Michael
876bdacf5d ;tools:make:etags: include .test files 2023-11-01 06:53:25 +00:00
Simon Michael
abc99d8dca ;dev: tests: ledger-compat tests cleanup 2023-10-29 00:16:47 +01:00
Simon Michael
65efc8b87f ;dev: tests: add outshine headings for more readability (in emacs) 2023-10-29 00:16:47 +01:00
Simon Michael
48732e6655 ;doc: TESTS name/link 2023-10-28 17:27:45 +01:00
Simon Michael
da2f021654 ;tools:bake:lastweek: improvements 2023-10-28 16:46:39 +01:00
Simon Michael
2ba321885d dev:web: refactor permission checking 2023-10-25 12:51:08 +01:00
Simon Michael
24ce9b5be1 ;bin:report1: cleanups 2023-10-24 13:38:08 +01:00
Simon Michael
efc87d9c0d ;web:sandstorm: bump app version, tweak title 2023-10-24 13:38:08 +01:00
Simon Michael
e40c82c153 ;cabal: update cabal files 2023-10-24 13:37:36 +01:00
Simon Michael
795dbd97f8 imp:web: cleanups; use --allow on Sandstorm (#834) 2023-10-24 13:37:36 +01:00
Simon Michael
95d33f20f6 imp:web: access control UX cleanups (fix #834)
Changes:

1. rename the sandstorm "manage" permission to "edit"
(old permission names: view, add, manage;
 new permission names: view, add, edit).

Rationale: "edit" best describes this permission's current powers, to users and to operators.
If we ever added more manager-type features we'd want that to be a new permission,
not a rename of the existing one (which would change the powers of existing users).

2. rename the sandstorm roles for consistency with permissions
(old role names: viewer, editor, manager;
 new role names: viewer, adder, editor)

Rationale: it's needed to avoid confusion.

3. add a new option: --allow=view|add|edit|sandstorm (default: add).
'sandstorm' sets permissions according to the X-Sandstorm-Permissions header.
Drop the --capabilities and --capabilities-header options.

Rationale: it's simpler and more intuitive.

4. replace "capability" with "permission" in ui/docs/code.

Rationale: consistent with the above, more familiar.
2023-10-24 13:37:36 +01:00
Simon Michael
c195e35572 ;bin:report1: cleanups 2023-10-23 19:29:32 +01:00
Simon Michael
15e76488e3 ;bin: link hledger-report1 scripts 2023-10-23 19:13:52 +01:00
Simon Michael
33cef6f494 ;imp:Hledger.Cli.Script: don't export main, do export CompoundBalanceCommand 2023-10-23 19:09:19 +01:00
Simon Michael
da774bd708 ;bin: hledger-report1: a custom compound report in haskell and bash 2023-10-23 19:07:52 +01:00
Simon Michael
31ecc9f4f2 imp:demo: improve error message when asciinema fails 2023-10-23 14:21:20 +01:00
Simon Michael
d8021ef754 fix:demo: avoid breaking asciinema 2.3.0 (fix #2094)
We were adding a trailing newline, which causes asciinema 2.3.0 to
show a JSON decode error.
2023-10-23 14:08:01 +01:00
Simon Michael
63d41b30db ;doc: haddock, comment fixes 2023-10-21 17:58:43 +01:00
Simon Michael
6d849f9e73 ;make: copy-exe[s]-*: fix help
vv#	examples/shared-expenses.journal
2023-10-21 17:58:43 +01:00
Simon Michael
b6a0ecd424 fix:web: check options like --capabilities before starting the app 2023-10-21 08:54:44 +01:00
Simon Michael
9b8044f737 fix:web:edit form: fix broken "File format help" link (fix #2103)
Now not broken, https rather than http, and pointing to the "Data
formats" section, which has links to each of the file formats
(in case editing a non-journal file).
2023-10-21 03:36:04 +01:00
Simon Michael
3a717d1625 ;doc:cli:Data formats: link to each format's doc 2023-10-21 03:36:04 +01:00
Simon Michael
605b3d6b94 imp:cli:Hledger.Cli.Version: export packagemajorversion 2023-10-21 03:36:04 +01:00
Jacob Weisz
b5bf0cbdb9 ;feat: Upgrade Sandstorm package with permissions 2023-10-20 16:18:37 +01:00
Philipp Klocke
6312446cbf web: Use guessAppRootOr to enable relative root if desired (fix #2099)
This is useful when serving on 0.0.0.0, such that querying from any
other device with <IP>:<PORT> does not fallback to 0.0.0.0:PORT,
which would fail.

Tested: Manually
2023-10-20 09:25:31 +01:00
Simon Michael
edeb906922 ;dev:bake lastweek 2023-10-20 08:34:57 +01:00
Simon Michael
03f757204b ;examples:csv: note where to find vanguard, fidelity CSV 2023-10-20 08:00:27 +01:00
Simon Michael
f157720fa3 ;bin:justfile: rename forecast.journal, forecast-import refinement 2023-10-19 11:17:57 +01:00
Simon Michael
7970ce7434 ;doc:areg,ui: note how separately-dated postings get combined 2023-10-19 10:24:47 +01:00
Simon Michael
8bfde51ae8 ;dev:ci: rename usual CI branch to "ci" 2023-10-18 14:02:59 +01:00
Simon Michael
6c95f47725 ;dev:ci: clean up, rename main CI workflow
Back to ci.yml.
2023-10-18 14:02:59 +01:00
Simon Michael
bd5b8b0b51 ;doc:REGRESSIONS: update 2023-10-18 14:02:59 +01:00
Simon Michael
661260f756 ;doc:print: cleanups (#2085) 2023-10-18 14:02:59 +01:00
Simon Michael
2f5feffa74 ;doc:CHANGES: document print and zero-rendering changes (#2085) 2023-10-18 13:56:24 +01:00
Simon Michael
5a72b9e9ea feat:print: add --round option for more control of precisions (#2085) 2023-10-18 13:56:24 +01:00
Simon Michael
c7bcdfcdcf ;doc:internals: Precision and rounding 2023-10-18 13:56:24 +01:00
Simon Michael
4e56199c57 dev: refactor transactionCheckBalanced 2023-10-18 13:56:24 +01:00
Simon Michael
c13c13ab1f lib!: use styleAmounts in more places; add rounding strategies 2023-10-18 13:56:24 +01:00
Simon Michael
94ab8b1ed7 dev: journalApplyCommodityStyles -> journalStyleAmounts 2023-10-18 13:56:24 +01:00
Simon Michael
f8027abb44 dev:print: refactor, add AmountStyle "rounding strategy"
Changes to enable more control of "rounding" behaviour
(ie, choosing display precisions for amounts).

This reverts 1.31's change of asprecision, making it a non-Maybe
again, and adds a new asrounding field providing more control over how
a target display precision is applied to existing amounts (two options
for now, more later). Functionality is in an interim state (reports do
no rounding).
2023-10-18 13:56:24 +01:00
Simon Michael
a0136a0b28 ;doc:REGRESSIONS: update 2023-10-18 02:36:40 +01:00
Simon Michael
ba8adf91fb ;doc:REGRESSIONS: update 2023-10-18 02:28:01 +01:00
Simon Michael
9ead8a64e1 fix:timedot: parse unitful quantities more accurately (fix #2096)
A quantity with a unit like "15m" was being parsed internally as
0.249999999... rather than 0.25 (and since hledger 1.21, printed that
way also). Now we round such quantities to two places during parsing,
to get exact quarter-hour amounts.
2023-10-17 12:05:10 +01:00
Simon Michael
ffc535ad64 lib: add Show to Table render functions for debugging 2023-10-17 11:46:00 +01:00
Simon Michael
72ef9186ba ;doc:journal: rewrite Commodity display style 2023-10-17 11:46:00 +01:00
Simon Michael
eda60f1e06 ;dev:stack: ghc 9.4 fix 2023-10-16 18:53:17 +01:00
Simon Michael
614b17cfa8 ;doc:LINKS: updates 2023-10-15 19:23:30 +01:00
Simon Michael
2135d388df ;doc:REGRESSIONS: add 2034 2023-10-15 18:16:17 +01:00
Simon Michael
929c5d6362 ;doc:REGRESSIONS: cleanup 2023-10-15 18:10:59 +01:00
Simon Michael
9dbfdffa06 ;doc:REGRESSIONS: cleanup 2023-10-15 18:03:01 +01:00
Simon Michael
9bfe56510d ;doc:REGRESSIONS: update 2023-10-15 17:57:00 +01:00
Simon Michael
2de0901d71 ;dev:stack: stack9.8.yaml 2023-10-15 13:56:47 +01:00
Simon Michael
81f155d039 ;dev:stack: drop stack9.6.yaml 2023-10-15 13:56:47 +01:00
Simon Michael
f7262ae4e8 dev:stack: bump default GHC to 9.6.3 2023-10-15 13:56:47 +01:00
Simon Michael
e771424fed ;doc:REGRESSIONS: update 2023-10-15 13:41:38 +01:00
Simon Michael
3a8d57ba53 ;doc:REGRESSIONS: update 2023-10-15 13:38:55 +01:00
Simon Michael
420f1f876a ;doc:REGRESSIONS: update 2023-10-15 13:23:43 +01:00
Simon Michael
75c553d6be ;doc:REGRESSIONS: cleanup, update 2023-10-15 12:53:12 +01:00
Simon Michael
7b8a69f756 ;doc:regressions: fix link 2023-10-15 09:52:06 +01:00
Simon Michael
b67cc64c08 ;doc: REGRESSIONS, moved from issue tracker; renamed FINANCE section 2023-10-15 09:24:02 +01:00
Simon Michael
e8da1f9f25 fix: balance-assigned amounts affect styles again (fix #2091) 2023-10-14 08:38:20 +01:00
Simon Michael
dadb904b04 ;doc:examples/bin: add gsheet-csv.hs 2023-10-14 06:09:34 +01:00
Simon Michael
ae8f9dd232 ;doc:justfile: update import, time report scripts 2023-10-14 05:59:20 +01:00
S. Zeid
ac547142ae imp: web: include adeclarationinfo in accounts JSON 2023-10-13 09:33:36 +01:00
S. Zeid
91d6f8c841 imp: lib: include adeclarationinfo, if present, in accounts JSON
Note that this does not add the declaration info if it is not already
present.
2023-10-13 09:33:36 +01:00
Simon Michael
0bfd7f66b0 ;doc:troubleshooting: nix locale config (#2089) 2023-10-10 12:14:06 +01:00
Simon Michael
1e3dd21baa ;doc:examples: fidelity csv rules 2023-10-10 09:49:11 +01:00
Simon Michael
efa8f1dc84 ci:test-linux: temporary workaround for haddock failure 2023-10-09 21:58:38 +01:00
Simon Michael
17889ccb61 ci:test-linux: temporary workaround for bad commit message 2023-10-09 21:07:20 +01:00
Simon Michael
c577fa809b ;doc: csv: negative matchers (#2088) 2023-10-09 20:54:55 +01:00
Stephen Morgan
20132e892b feat: balance: Add summary-only flag (#1012)
Add a flag --summary-only for multi-column balance reports, which does
not display the main date columns for a report, but only displays the
summary columns (--row-total, --average). This is useful when there are
many columns (a weekly summary over many years) where you're only
interested in the average (or some other summary).
2023-10-06 05:25:26 +01:00
bobobo1618
9fb5740045 Add support for negating a Matcher
https://github.com/simonmichael/hledger/issues/2054
2023-10-05 10:22:01 +01:00
Simon Michael
bdf292b377 ;cabal: update cabal files 2023-10-04 10:03:35 +01:00
Simon Michael
fffae7f578 ;doc: main module haddock cleanups 2023-10-04 10:03:35 +01:00
Simon Michael
2e06c8dc27 ;doc: package description cleanups 2023-10-04 10:03:35 +01:00
Simon Michael
40037afaf1 lib!: export less from cli and web packages, and more from ui 2023-10-04 10:03:35 +01:00
Simon Michael
0e98f73e30 dev:cli: merge Hledger.Cli.Main with Hledger.Cli 2023-10-04 10:03:35 +01:00
Simon Michael
37bb9a03be make: fix haddock[-watch|-open] 2023-10-04 10:03:35 +01:00
Simon Michael
efc154a1cb dev:ci: cleanup 2023-09-16 09:05:04 +01:00
Simon Michael
0860bff057 dev:ci: update notes 2023-09-12 08:52:17 +01:00
Simon Michael
7582460e50 fix:ui: V key preserves startup valuation, if any (fix #2084)
Also: hledger-ui cost/value doc improvement and a useful cost/value test file.
2023-09-12 08:36:33 +01:00
Simon Michael
936e1b9d0a pkg:stack: build with nightly/ghc 9.6 by default 2023-09-12 07:26:36 +01:00
Simon Michael
168af19f3f ;doc:RELEASING: updates 2023-09-11 10:57:17 +01:00
Simon Michael
1ef48fd7a5 fix: failing balance assertions with cost show correct highlight #2083 2023-09-11 10:11:24 +01:00
Simon Michael
4a2da0ba1b ;doc:journal: clarify valuation date, note bug #2084 2023-09-11 10:10:49 +01:00
Simon Michael
b6325e067e ;bin: tt,ft comment 2023-09-11 10:07:52 +01:00
Simon Michael
e0d1f69575 ;doc:RELEASING: updates 2023-09-11 09:58:21 +01:00
Simon Michael
549823a783 ;doc: update manuals 2023-09-11 09:57:30 +01:00
Simon Michael
8666cc5391 ;doc: update command help 2023-09-11 09:57:02 +01:00
Simon Michael
ce41252998 ;cabal: update cabal files 2023-09-11 09:56:35 +01:00
Simon Michael
6f7c331ace ;pkg: bump version to 1.31.99 2023-09-11 09:56:34 +01:00
Simon Michael
50d4555860 ;doc: merge 1.31 changelogs 2023-09-11 09:55:38 +01:00
Simon Michael
8d2b0b439b ;doc: announce 2023-09-11 09:51:41 +01:00
Simon Michael
974b831dd9 install: bump to latest versions 2023-09-11 09:51:37 +01:00
Simon Michael
2fcc578305 install: replace hledger-stockquotes with pricehist 2023-09-11 09:51:33 +01:00
Simon Michael
6533ccea6a pkg: stack: ghc9.6: bump resolver, enable hledger-web (close #2011) 2023-09-03 08:23:43 +01:00
Simon Michael
6e0523d7b8 pkg: stack: bump default build to lts-21.9, ghc 9.4.6 2023-09-03 08:23:43 +01:00
Simon Michael
9c4235bf88 pkg: allow megaparsec 9.5 2023-09-03 08:23:43 +01:00
Simon Michael
aa7b329e3a ;errors: balance assertion: wording 2023-09-03 08:23:43 +01:00
Simon Michael
29ff5468bf dev:journalBalanceTransactions: styling comment 2023-09-02 06:46:14 +01:00
Simon Michael
d8a3c9fa3e dev: no need to style amounts when converting to cost 2023-09-02 06:46:14 +01:00
Simon Michael
c215f920aa dev: update tests 2023-09-02 06:46:14 +01:00
Simon Michael
644635b918 imp: print: show a disambiguating decimal mark when needed
Eg "1,000" (with , as a thousands separator and no decimal digits) is
now displayed with a decimal mark: "1,000.".

"1 000" (where space is a thousands separator) is less ambiguous,
but we do the same thing (eg "1 000.") for consistency, and also to
help disambiguate when forgetting to quote a numeric commodity symbol
(eg "1234 0" where 1234 is a symbol that should have been in double quotes).
2023-09-02 06:46:14 +01:00
Simon Michael
f620a3e0ea dev: showAmountB: clarify 2023-09-02 06:46:14 +01:00
Simon Michael
4bd0dd7ab0 fix: print: don't round in implicit conversions (fix #2079) 2023-09-02 06:46:14 +01:00
Simon Michael
fd97c40266 lib: amount styling: add a final styling pass to all reports 2023-09-02 06:46:14 +01:00
Simon Michael
77aeb18bbd fix:print:style balance assertion costs; more styling api; HasAmounts class 2023-09-02 06:46:14 +01:00
Simon Michael
97be1646f1 dev: AmountStyle: make setting the precision optional
This simplifies the code for styling amounts with or without precision.
But it complicates the semantics (Nothing is useful only when setting style).
Not sure if it's the best way.
2023-09-02 06:46:14 +01:00
Simon Michael
85845e51b2 dev: AmountStyle: rename, reorder fields more mnemonically
Since this type is about to change anyway.
2023-09-02 06:46:14 +01:00
Simon Michael
9f0840456d dev: consolidate amount styling as a new (interim) api 2023-09-02 06:46:14 +01:00
Simon Michael
9b15d34f9c dev: amounts: cleanups 2023-09-02 06:46:14 +01:00
Simon Michael
d3cc31780a dev: AmountStyle: improve debug output 2023-09-02 06:46:14 +01:00
Simon Michael
00a8abd46d dev: commodity-styles tests: cleanup 2023-09-02 06:46:14 +01:00
Jonathan Dowland
1ebd244abb ;dev: Add a ghc-tags.yaml file
Provide a ghc-tags.yaml file to make use of ghc-tags with Hledger easy.

ghc-tags is a standalone tool to replace the formerly-built-in
":ctags" feature (and I presume ":etags") in GHCi. These walked over
the source and produced a TAGS file (in vim-compatible ctags or
Emacs-compatible etags format) that allows the relevant editors to
quickly navigate around function definitions.

ghc-tags trips over some of the CPP used in Hledger. The solution
is to provide ghc-tags with explicit CPP defines via a YAML file.
However, if a YAML file is provided, one also must specify the source
paths, as the tool XORs config file | paths-on-command-line.

See <https://github.com/arybczak/ghc-tags/issues/6> for more
information.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-08-31 19:12:49 +01:00
Simon Michael
ff730f775b imp:print: zero posting amounts are now shown with commodity & style
print now shows zero posting amounts with their original commodity
symbol and the corresponding style (instead of stripping the symbol).

If an inferred amount has multiple zeroes in different commodities,
a posting is displayed for each of these.

Possible breaking changes:

showMixedAmountLinesB, showAmountB, showAmountPrice now preserve
commodityful zeroes when rendering. This is intended to improve print output,
but it seems possible it might also affect balance and register reports,
though our tests show no change in those.
2023-08-27 07:34:09 +01:00
Simon Michael
35c0fd692c dev: clarify showAmountB 2023-08-27 07:34:09 +01:00
Simon Michael
28cdcd1bfd dev: clarify orderedAmounts 2023-08-27 07:34:09 +01:00
Simon Michael
3f050d45a9 dev: improve showMixedAmountLinesB doc 2023-08-27 07:34:09 +01:00
Simon Michael
c9e9145318 dev: clarify missingamt/missingmixedamt docs 2023-08-27 07:34:09 +01:00
Jay Neubrand
97943b206c make groupByDateSpan return data when first period has unbounded begin 2023-08-25 18:40:50 +01:00
Dmitry Astapov
c20ebae26d ;doc:roi: mention annualization differences, clean up TWR section 2023-08-24 18:42:52 +01:00
Simon Michael
50f26c280e ;doc:check: cleanup 2023-08-22 09:56:25 +01:00
Simon Michael
ea55c75c2e ;doc:journal:include: fix data formats link 2023-08-22 09:56:08 +01:00
Simon Michael
df9917be57 ;doc:bal: note an issue with the no-symbol commodity and hledger-bar 2023-08-22 08:45:13 +01:00
Simon Michael
115b639ec2 ;doc: update manuals 2023-08-22 08:41:22 +01:00
Simon Michael
95b67ef86b ;doc: update command help 2023-08-22 08:40:46 +01:00
Simon Michael
5f1bf0404a imp:check: more intuitive "balanced..." check names
balancedwithautoconversion -> autobalanced
balancednoautoconversion   -> balanced
2023-08-22 08:38:52 +01:00
Simon Michael
273c51165e ;dev: prepare for renaming balanced checks 2023-08-22 08:04:40 +01:00
Simon Michael
9579b7a4a6 ;imp:cli:help: move test to HELP 2023-08-22 07:35:57 +01:00
Simon Michael
e849a73aa8 ;imp:cli:help: move files to BASIC REPORTS 2023-08-22 07:29:32 +01:00
Simon Michael
dd559226d8 imp:demo: ignore a broken journal, like other HELP commands 2023-08-22 07:11:53 +01:00
Simon Michael
6a12ff1232 ;doc:csv: clarify intra-day-reversed 2023-08-14 13:17:51 +01:00
Dmitry Astapov
588d0dfd26 fix:cli:roi: report TWR per period and overall TWR for multi-period reports (fix #2068) 2023-08-01 14:35:33 -04:00
Simon Michael
f7dbfcf657 fix:cli:commands list: don't show bar when not in path (fix #2065) 2023-07-20 12:04:27 -07:00
Simon Michael
e1723b7d3b ;doc:csv: rewrite "amount field" section 2023-07-17 15:55:03 -10:00
Simon Michael
c1c28aea3f imp:journal: match equity conversion postings more tolerantly (fix #2041)
Equity conversion postings and cost amounts were being matched up too
exactly, causing valid entries with redundant conversion postings and
costs to be rejected. Now the amounts are compared with the precision
(number of decimal places) used in the conversion posting's amount.
Eg, here the first posting's 209.60495 GEL cost is recognised as a
match for the third posting's -209.60 GEL, using the latter's two
digit precision:

    2023-01-01
        Assets               -84.01 USD @ 2.495 GEL  ; 209.60495 GEL
        Equity:Conversion     84.01 USD
        Equity:Conversion   -209.60 GEL
        Assets               209.60 GEL
2023-07-15 16:21:00 -10:00
Simon Michael
d19690e5bd dev:Transaction: refactor/clarify transactionInferCostsFromEquity 2023-07-15 16:19:45 -10:00
Simon Michael
516a5cb448 dev: equity/cost analysis: process in parse order, better debug output
More intuitive posting numbering, making troubleshooting easier.
2023-07-15 16:17:08 -10:00
Simon Michael
c63fba88b6 ;doc: "Cost reporting" capitalisation 2023-07-15 16:09:18 -10:00
Simon Michael
b4a80f693d ;doc:import: link to the deduplicating/importing section in CSV docs #1862 2023-07-13 21:05:27 -10:00
Simon Michael
b27d74efa1 ;dev: cleanup 2023-07-13 20:57:56 -10:00
Simon Michael
ed456a3f8c imp:check:recentassertions: improve the error message's suggestion
The suggested sample balance assertion now uses the same commodity
symbol as in the failing posting (the first, if there are more than
one). Also the cleared mark has been removed.
2023-07-13 09:01:57 -10:00
Simon Michael
002773f650 imp:check:recentassertions: give a more useful error location
hledger check recentassertions now reports the error at the first
posting that's more than 7 days later than the latest balance
assertion (rather than at the balance assertion).  This is the thing
actually triggering the error, and it is more likely to be visible or
at least closer when you are working at the end of a journal file.
2023-07-12 19:54:18 -10:00
Simon Michael
2f64c3e385 ;doc:working with csv: edits 2023-07-12 15:20:40 -10:00
Simon Michael
c90efaba82 ;doc:cost reporting: cleanup 2023-07-12 15:20:19 -10:00
Simon Michael
a99a692736 ;doc:cli: Valuation -> Value reporting 2023-07-11 16:56:41 -10:00
Simon Michael
15c1ba3e15 ;doc:cost reporting: another rewrite 2023-07-11 16:51:40 -10:00
Simon Michael
a617778f64 ;doc:journal: note some equity+cost limitations (#2051, #2056) 2023-07-09 18:44:29 -10:00
Simon Michael
0ae007cae9 ;doc:cli: formatting 2023-07-09 18:44:10 -10:00
Simon Michael
969dea72ae ;bin:justfile: make more chooser friendly, add help/pick/view 2023-07-07 13:11:11 -10:00
Simon Michael
245178cac8 ;doc:cli: fix links to balance --layout doc 2023-07-07 10:28:07 -10:00
Simon Michael
0fabbc3b32 ;bin:justfile: fix/cleanups 2023-07-07 08:16:15 -10:00
Simon Michael
67e5a453a0 ;bin: add a justfile (conversion of ft and tt) 2023-07-06 15:52:41 -10:00
Simon Michael
c0bd0d2979 ;doc:bin: fix tt link 2023-07-06 08:57:26 -10:00
Simon Michael
d221be1959 ;doc:bin:ft: updates 2023-07-06 08:53:44 -10:00
Simon Michael
0d641ad2b9 ;doc:bin:tt: updates 2023-07-06 08:39:52 -10:00
Simon Michael
519b305627 ;doc:bin: ft/tt updates 2023-07-06 08:19:16 -10:00
Simon Michael
27e5739de5 ;doc:bin: ft/tt updates 2023-07-06 08:15:13 -10:00
Simon Michael
8088fa714e ;doc:bin: link ft and tt 2023-07-06 08:10:57 -10:00
Simon Michael
37206aba5a ;bin: ft, tt reporting scripts (examples) 2023-07-06 08:06:05 -10:00
Simon Michael
1cfcb7fa76 ;cln: journalAddInferredEquityPostings -> journalInferEquityFromCosts 2023-07-04 13:21:55 -10:00
Simon Michael
4988179dac ;doc:journal: capitalisation 2023-07-04 13:04:03 -10:00
Simon Michael
8d429b5ac4 pkg:cabal: update cabal files 2023-07-01 08:14:23 -10:00
Simon Michael
1a0b745c28 pkg: add support for aeson 2.2, add upper bound 2023-07-01 08:14:23 -10:00
Simon Michael
e3bf66755a ;pkg:stack: bump stackage snapshots 2023-07-01 08:14:23 -10:00
Simon Michael
1bd1c55bd6 ;pkg: update tested-with 2023-07-01 07:34:46 -10:00
Simon Michael
1fe321ff39 ;doc:cli:Cost reporting: updates 2023-06-28 16:29:36 -10:00
Simon Michael
c6a721e260 ;examples: the hledger manual > Cost reporting examples, and shelltests 2023-06-28 16:20:19 -10:00
Simon Michael
c64ffd7fb0 ;doc:cli:Cost reporting: move some content to cookbook 2023-06-28 16:17:46 -10:00
Simon Michael
cafa58beae ;doc:cli: Cost reporting updates 2023-06-28 11:24:44 -10:00
Simon Michael
24b114a400 ;doc:cli: rewrite Cost reporting 2023-06-28 11:02:36 -10:00
Simon Michael
79f019b284 ;doc:cost: clarity cost tips #2055 2023-06-28 06:36:17 -10:00
Simon Michael
6a629289c9 ;examples:self-tracking: add missing files 2023-06-27 18:55:08 -10:00
Simon Michael
eda114d56a ;examples:self-tracking: updates 2023-06-27 18:53:18 -10:00
Simon Michael
1f4ee58f98 ;examples:self-tracking: updates 2023-06-27 18:48:34 -10:00
Simon Michael
63de119171 ;examples:self-tracking: updates 2023-06-27 18:26:00 -10:00
Simon Michael
297f05842d ;examples: self-tracking 2023-06-27 17:56:09 -10:00
Simon Michael
3bb6881500 ;doc:journal:balance assignments: mention multiple files 2023-06-23 18:39:00 -10:00
Simon Michael
4804e1be6d ;dev: bump to latest stackage nightly 2023-06-20 19:37:41 -10:00
Simon Michael
bed4c1129a ;install: bump to stackage lts-21 2023-06-20 19:37:26 -10:00
Simon Michael
f4508e73d3 ;cabal: update cabal files 2023-06-16 12:11:53 -10:00
Simon Michael
110861ee83 ;pkg: allow megaparsec 9.4 2023-06-16 12:11:08 -10:00
Simon Michael
d5fdfdbdc7 ;cln: make functest-PAT now filters the same tests run by make functest 2023-06-16 11:41:46 -10:00
Simon Michael
42efbbe4aa imp:import: also show the file path being imported to 2023-06-16 09:14:38 -10:00
Simon Michael
4faeb7527b ;doc:cli: fix a csv "field names" link 2023-06-15 09:04:01 -10:00
Simon Michael
f1492ee05a ;doc:RELEASING: updates 2023-06-14 23:56:00 -10:00
Simon Michael
a3c300b508 ;dev: make/shake/bake help titles 2023-06-14 23:54:29 -10:00
Simon Michael
480872ce22 ;dev:Shake: avoid making empty commits 2023-06-14 22:45:40 -10:00
Simon Michael
cc265d906e ;dev:checkembeddedfiles: fix mac binaries workflow 2023-06-14 22:45:12 -10:00
Simon Michael
03e0bb9c57 ;doc: update changelogs 2023-06-14 19:06:46 -10:00
Simon Michael
f660e03272 ;doc: update manuals 2023-06-14 19:04:59 -10:00
Simon Michael
f225bf2f7f cln:print: clarify code a bit, rename originalTransaction 2023-06-14 18:11:28 -10:00
Simon Michael
79a1f1dd97 ;doc: update changelogs 2023-06-13 22:04:33 -10:00
Simon Michael
0bb4abca27 ;examples:csv: vanguard rules, best effort 2023-06-11 15:28:27 -10:00
Simon Michael
068cec31eb imp:cli: desc is now preferred for pivoting on description.
`description` still works for compatibility (undocumented).
2023-06-09 08:04:06 -10:00
Simon Michael
103d7142d2 ;doc:RELEASING: sync headings 2023-06-09 08:00:16 -10:00
Eric Mertens
e668506d26
feat: cli: Support colon-delimited --pivot (#2050)
feat:cli: --pivot now can construct an account name from multiple colon-delimited fields
2023-06-09 08:00:01 -10:00
Simon Michael
29caeb9e34 ;doc:cli: fix links to include directive 2023-06-08 15:16:39 -10:00
Simon Michael
066c127a58 ;examples: dungeons and dragons ledger from glguy 2023-06-08 15:00:27 -10:00
Simon Michael
87a5ff6e11 ;dev: remove now-redundant pretty-simple loading from .ghci
With current cabal this is usually done with an environment file
instead (`cabal install --lib base pretty-simple`), and doing
it again in .ghci breaks.
2023-06-08 06:40:56 -10:00
Simon Michael
873c7339a6 ;cln: comment 2023-06-08 06:40:46 -10:00
Simon Michael
1192d8a057 ;doc:cli: document expr: and queries a little better 2023-06-08 06:40:16 -10:00
Simon Michael
3357c27390 fix: accept entries with unmatched equity conversion postings (#2045)
Since 1.29, we unconditionally run part of the --infer-cost logic to
identify redundant costs/equity postings. This was too strict, raising
an error whenever it could not find postings matching the equity
postings.  Now we do this (and also the explicit --infer-costs
operation) as a best effort, leaving transactions unchanged if we
can't detect matching postings. This is consistent with
--infer-equity, --infer-market-prices, -B and -V.
2023-06-06 20:44:03 -10:00
Simon Michael
122e7dae94 cln: try to clarify transactionInferCostsFromEquity a bit 2023-06-06 20:43:32 -10:00
Simon Michael
748e4e8e5d ;dev: comment 2023-06-06 20:35:22 -10:00
Simon Michael
814da1207a ;doc: RELEASING: updates 2023-06-06 18:45:45 -10:00
Simon Michael
12e3dc2360 ;doc: RELEASING: updates 2023-06-06 07:35:36 -10:00
Simon Michael
20a0b915c4 ;doc: RELEASING diagram: updates 2023-06-06 07:35:36 -10:00
Simon Michael
583f0f394d ;doc:RELEASING: updates 2023-06-06 07:35:36 -10:00
Simon Michael
c2c668e3a7 dev:tools:ci:master,binaries: install ripgrep for checkembeddedfiles 2023-06-02 11:17:16 -10:00
Simon Michael
7bbda90e2c ;dev:tools:checkembeddedfiles: fail when rg is not installed 2023-06-02 11:08:40 -10:00
Simon Michael
a6d3424e0b dev:tools:ci:master: check embedded files before slower operations 2023-06-02 10:51:42 -10:00
Simon Michael
c7c4c68031 dev:tools:ci: check embedded files in the binaries workflows also 2023-06-02 10:50:28 -10:00
Simon Michael
57cc76ae2e ;doc: update changelogs 2023-06-02 10:25:24 -10:00
Simon Michael
98d53b42e4 ;dev:cli: avoid breakage with old haddock versions in Demo.hs 2023-06-02 10:22:49 -10:00
Simon Michael
fc9908890d ;dev:tools: checkversions update 2023-06-02 10:22:47 -10:00
Simon Michael
8ba09f41d9 ;install: bump hledger to 1.30.1 2023-06-02 09:31:39 -10:00
Simon Michael
a56d0393be ;dev:tools: checkversions 2023-06-02 09:31:36 -10:00
Simon Michael
353ac8809b dev:tools: add checkembeddedfiles to make test & master CI 2023-06-02 08:26:37 -10:00
Simon Michael
5410f87953 ;doc: update changelogs 2023-06-02 08:07:52 -10:00
Simon Michael
5e0127c937 ;cabal: update cabal files 2023-06-02 07:50:23 -10:00
Simon Michael
9f5e85ef60 fix:cli: add missing files to Hackage release 2023-06-02 07:49:37 -10:00
Simon Michael
40bb5a2c5c ;dev:tools: checkembeddedfiles 2023-06-02 07:49:18 -10:00
Simon Michael
60d3e1ef97 ;doc:github-release: update 2023-06-01 17:03:49 -10:00
Simon Michael
280f992798 ;doc:RELEASING: update 2023-06-01 16:49:47 -10:00
Simon Michael
1985b1b993 ;doc:RELEASING: update 2023-06-01 16:35:57 -10:00
Simon Michael
21d6b00597 ;doc: update manuals 2023-06-01 16:35:11 -10:00
Simon Michael
2a3941682b ;doc: update command help 2023-06-01 16:34:57 -10:00
Simon Michael
286ee105da ;cabal: update cabal files 2023-06-01 16:34:52 -10:00
Simon Michael
9ae87a73fa ;pkg: bump version to 1.30.99 2023-06-01 16:34:52 -10:00
Simon Michael
49b3951be6 ;doc: finalise 1.30 announcements 2023-06-01 16:34:12 -10:00
Simon Michael
580b1f6d5a ;doc:cli: replace note about repeated options 2023-06-01 16:34:09 -10:00
Simon Michael
f6322d8923 ;imp: install: update for 1.30, output improvements 2023-06-01 16:34:03 -10:00
Simon Michael
34c401d1cf imp: Revert "imp: cli: make some reporting flags toggle on/off when repeated"
This reverts commit 57c0205107.

Toggling means it can be hard to know if the feature is on or off.
This needs more testing.
2023-06-01 16:32:44 -10:00
Simon Michael
1b0be2b65f imp:demo: add an easy -s/--speed option, play at 2x by default 2023-06-01 16:32:40 -10:00
Simon Michael
c9f39db363 imp:demo: rename/reorder install demo 2023-06-01 16:32:36 -10:00
Simon Michael
43f7ff6b35 ;cln:ui: help wording 2023-06-01 16:32:33 -10:00
Simon Michael
f485b30ae0 ;cln:close: fix end date doc 2023-06-01 16:32:25 -10:00
Simon Michael
003fcfee52 ;doc: github-release: rename, more folding, update for 1.30 2023-06-01 16:30:57 -10:00
Simon Michael
07bae38c4d ;doc: announce 1.30 2023-06-01 16:30:53 -10:00
Simon Michael
250d71fed2 ;doc: CHANGELOGS: update 2023-06-01 16:30:46 -10:00
Simon Michael
ecf266a808 ;doc: merge 1.30 changelogs 2023-06-01 16:29:35 -10:00
Simon Michael
3f08394c6c ;doc: update changelogs 2023-05-31 22:03:50 -10:00
Simon Michael
5048c89608 ;doc: CHANGELOGS: update 2023-05-31 22:02:26 -10:00
Simon Michael
c6afab813c ;examples:csv: Makefile: update status 2023-05-31 21:59:43 -10:00
Simon Michael
1382fbc757 ;doc:cli: update quick links 2023-05-31 19:25:21 -10:00
Simon Michael
d146b83500 ;doc: update manuals 2023-05-31 19:07:44 -10:00
Simon Michael
858135e15e ;doc: simplify man page synopses to suit website 2023-05-31 19:07:02 -10:00
Simon Michael
c008903d1e ;doc: update manuals 2023-05-31 18:57:53 -10:00
Simon Michael
f8e34e8723 ;doc:journal: improve virtual postings doc, mention inferring zero 2023-05-31 18:57:30 -10:00
Simon Michael
438891b2c5 ;dev: stack: bump to nightly-2023-05-31 2023-05-31 18:57:30 -10:00
Simon Michael
c008dd83b6 ;doc: ROADMAP: update 2023-05-31 18:57:30 -10:00
Simon Michael
f7b59c8950 dev: demo: drop two confusing demos for now 2023-05-31 18:57:30 -10:00
Simon Michael
89e0c05f11 ;imp:doc:cli: trim argument files 2023-05-31 16:42:30 -10:00
Simon Michael
3ddb43663c ;cln:doc: man page cleanups 2023-05-31 16:42:11 -10:00
Simon Michael
d92d4127af ;cln:doc: convert .html links to .md (which work in Obsidian) 2023-05-31 08:49:32 -10:00
Simon Michael
19cc3743a8 ;doc: update manuals 2023-05-31 07:57:37 -10:00
Simon Michael
f88501314e ;imp:doc:cli: update a bunch of 2020 examples to 2023 2023-05-31 07:56:53 -10:00
Simon Michael
0e9650d816 ;imp:doc:cli: move LEDGER_FILE section down 2023-05-31 07:56:33 -10:00
Simon Michael
b0e5bb4bc7 ;imp:doc: ui, web: options cleanup 2023-05-30 22:35:01 -10:00
Simon Michael
5c1721da22 ;imp:doc: cli: rearrange 2023-05-30 22:25:46 -10:00
Simon Michael
7c2b194bdf ;imp:doc: cli: update Options, Commands sections 2023-05-30 22:14:55 -10:00
Simon Michael
9cdc0f21b6 imp:cli: add-ons can also have .js, .lua, or .php extensions 2023-05-30 20:23:12 -10:00
Simon Michael
502b80ad81 ;dev: push: ensure git's pager doesn't stop progress 2023-05-27 12:47:32 -10:00
Simon Michael
96cdc0cb96 fix: likelyExecutablesInPath, hledgerExecutablesInPath on windows (#2040)
Pointed out by mauke in #haskell chat: this was incorrectly splitting
PATH on windows (splitting on the : in C:\...), which meant that
people using multiple drive letters on Windows might see hledger
failing to recognise installed add-on commands.
2023-05-27 12:28:38 -10:00
Simon Michael
d7f0398542 ;cln: doc: fix garbled haddock for journalDateSpan, journalDateSpanBothDates
hopefully
2023-05-27 12:01:20 -10:00
Simon Michael
95cedd465f ;doc: github release doc: windows updates 2023-05-27 10:40:21 -10:00
Simon Michael
a12880de05 fix: typo in Hledger.Cli.CliOptions.likelyExecutablesInPath
This had a bug noticed by mauke in #haskell: it was splitting PATH
on [ and ] as well as : and ;. Hard to trigger, but now fixed.
2023-05-27 09:21:49 -10:00
Simon Michael
6b3dd79542 ;dev: make copy-exe*/install-as*: install binaries to bin/old/ 2023-05-27 08:56:05 -10:00
Simon Michael
d19d866446 fix: use costs when balancing a txn with a balance assignment (fix #2039)
Transaction balancing is supposed to balance costs, but these were
being stripped when calculating balance assignments, causing us to
wrongly reject this transaction when the last amount is left implicit,
unlike Ledger:

2023-01-01
    Assets                AAA -1.1 @@ CCC 2
    Assets                BBB -1.2 @@ CCC 3
    Expenses:Fees         CCC  0.2
    Assets                                  = CCC 4.9

I'm not sure why costs were being stripped. I seem to have added it
in 2019 (to Journal.balanceNoAssignmentTransactionB in 3b47b58ae),
but this bug seems to be present even before that.
2023-05-27 08:34:11 -10:00
Simon Michael
d2cefedffb ;doc: update manuals 2023-05-26 09:28:53 -10:00
Simon Michael
32f616f666 ;imp:doc:cli: options note 2023-05-26 09:28:03 -10:00
Simon Michael
34a6c08b03 ;imp:doc:cli: move Input section first, consolidate LEDGER_FILE docs 2023-05-26 09:01:34 -10:00
Simon Michael
c8c5f96ed0 ;cln:doc: ui, web manuals: drop redundant FILES section 2023-05-26 09:01:32 -10:00
Simon Michael
6854b0b5e6 ;doc: update command help 2023-05-26 06:38:27 -10:00
Simon Michael
fda15f808c ;imp:doc:manuals: consolidate, update BUGS sections 2023-05-26 06:38:27 -10:00
Simon Michael
a717cbd300 ;cln:doc: update the manuals' brief input files descriptions
These come from the inputfiles (and new inputfileswithptr) macros,
currently used in five places in the three manuals.
2023-05-26 06:38:27 -10:00
Simon Michael
b8f1a67503 ;doc: FILES update 2023-05-24 18:51:45 -10:00
Simon Michael
766657cb09 ;doc: forecasting: mention --verbose-tags 2023-05-24 12:37:46 -10:00
Simon Michael
5e55258e59 ;bin: bar: help tweak 2023-05-23 17:14:47 -10:00
Simon Michael
d3079c9066 ;dev: make install-as-%: save in bin/old/ instead 2023-05-23 17:14:01 -10:00
Simon Michael
4a61caefd7 fix: infer amountless unbalanced virtual postings as zero
They were effectively zero already, but print always showed them with no amount, even with -x, which was unclear.
2023-05-20 17:41:59 -10:00
Simon Michael
e832c344c1 dev: comment 2023-05-20 17:29:06 -10:00
Simon Michael
029b59093b feat: csv: rules files can be read directly; data file can be specified
CSV rules files can now be read directly, eg you have the option of
writing `hledger -f foo.csv.rules CMD`. By default this will read data
from foo.csv in the same directory.  But you can also specify a
different data file with a new `source FILE` rule. This has some
convenience features:

- If the data file does not exist, it is treated as empty, not an
  error.

- If FILE is a relative path, it is relative to the rules file's
  directory. If it is just a file name with no path, it is relative
  to ~/Downloads/.

- If FILE is a glob pattern, the most recently modified matched file
  is used.

This helps remove some of the busywork of managing CSV downloads.
Most of your financial institutions's default CSV filenames are
different and can be recognised by a glob pattern.  So you can put a
rule like `source Checking1*.csv` in foo-checking.csv.rules,
periodically download CSV from Foo's website accepting your browser's
defaults, and then run `hledger import checking.csv.rules` to import
any new transactions. The next time, if you have done no cleanup, your
browser will probably save it as something like Checking1-2.csv, and
hledger will still see that because of the * wild card. You can choose
whether to delete CSVs after import, or keep them for a while as
temporary backups, or archive them somewhere.
2023-05-19 09:09:21 -10:00
Simon Michael
ddae3af8a3 lib: Hledger.Utils.IO: added expandGlob, sortByModTime 2023-05-19 09:09:21 -10:00
Simon Michael
71ef6ef478 fix: cli: commands list now shows help for hledger-lots if installed 2023-05-18 07:19:36 -10:00
Simon Michael
4c3046dea8 fix: cli: the commands list no longer lists non-installed addons (fix #2034)
And internally has been rewritten for clarity.
2023-05-18 07:19:36 -10:00
Simon Michael
3d2ef21081 lib: Hledger.Utils.IO: more robust monochrome pretty/debug printing 2023-05-18 07:19:36 -10:00
Simon Michael
83de76b67a lib: Hledger.Utils.IO: avoid excessively wide "compact" prettyprinting 2023-05-18 07:19:36 -10:00
Simon Michael
76f336695c lib: Hledger.Utils: added multicol 2023-05-18 07:19:36 -10:00
Simon Michael
ae4f58beb7 lib: Hledger.Cli.Commands: findCommand -> findBuiltinCommand 2023-05-18 07:13:58 -10:00
Simon Michael
3961dbc044 dev: ghci: disable color, which sometimes obscures pretty-printed output 2023-05-18 07:12:51 -10:00
Simon Michael
3dd497d94d dev: make etags-ls 2023-05-18 07:12:33 -10:00
Simon Michael
9f324ea379 ;doc: github release notes: add download count badges 2023-05-12 11:28:30 -10:00
Simon Michael
577e4b6347 fix!: csv: skip now counts non-blank lines more robustly (fix #2024)
Inner empty lines were not being skipped automatically, contrary to
docs. Now all empty lines are skipped automatically, and the `skip`
rule is needed only for non-empty lines, as intended.

This may be a breaking change: it's possible that the `skip` count
might need to be adjusted in some CSV rules files.
2023-05-11 17:06:12 -10:00
Simon Michael
69be1d4ef7 ;dev: csv: refactor, clarify 2023-05-11 15:44:56 -10:00
Simon Michael
70d4c0c638 ;dev: csv: refactor, clarify 2023-05-11 15:35:05 -10:00
Simon Michael
755c3d3dbb ;dev: csv: refactor 2023-05-11 15:34:31 -10:00
Simon Michael
fc6282898b ;examples: csv: Makefile cleanup 2023-05-11 14:16:12 -10:00
Simon Michael
78e088d982 ;examples: add a more up-to-date CSV/scripts makefile in examples/csv/ 2023-05-10 23:24:06 -10:00
Simon Michael
e2c1348a0e ;doc: add VS Code notebooks: github issues, hledger-web REST API 2023-05-10 17:08:12 -10:00
Simon Michael
7592674416 ci: windows: try ghc 9.4.4 to work around ghc#23309 2023-05-10 10:03:51 -10:00
Simon Michael
4a55a515ba ;doc: journal: change wording wrt ledger compatibility (fix (#1306) 2023-05-10 02:18:17 -10:00
Simon Michael
0fe9c2f215 ;doc: bin: fix link name (2) 2023-05-09 13:03:41 -10:00
Simon Michael
fc11cd6ce0 ;doc: bin: fix link name 2023-05-09 13:02:07 -10:00
Simon Michael
705c1bec93 ;fix: hledger-bar: detect non-interactive output properly for ANSI 2023-05-09 11:30:46 -10:00
Simon Michael
57c0205107 imp: cli: make some reporting flags toggle on/off when repeated
This can be useful to override defaults in scripts.
These flags will now toggle when repeated on the command line:

--invert
--transpose
-r/--related
-%/--percent
-E/--empty
-N/--no-total
-T/--row-total
-A/--average
-S/--sort-amount
2023-05-09 11:10:12 -10:00
Simon Michael
8735af77df lib: add toggleopt, for flags that toggle when repeated 2023-05-09 10:08:52 -10:00
Simon Michael
2d03148d7f dev: lib: drop unused pragma 2023-05-09 10:03:15 -10:00
Simon Michael
147d49c66c dev: cln: drop Hledger.Data.RawOptions.inRawOpts 2023-05-09 10:02:24 -10:00
Simon Michael
a1da8f2899 dev: fix a date-sensitive test (#2032) 2023-05-09 09:58:11 -10:00
Simon Michael
c5b2465fb0 ;imp: hledger-bar: disable ANSI if terminal is non-interactive 2023-05-06 16:25:51 -10:00
Simon Michael
515e8622a2 ;doc: ISSUES: drop old easy/good-first/other links
Easy label no longer exists, and good-first-issue isn't being used.
In fact unless you assume fairly high base level of experience it's
hard to find issues that justify either label.
2023-05-05 12:54:54 -10:00
Simon Michael
75a6c1e510 fix: "every 29th/30th/31st day of month" dates with a start date (fix #2032)
Since hledger 1.25, "every Nth day of month" period rules with N > 28
could be off by a couple of days if given certain forecast start dates.
Eg `~ every 31st day of month` with `--forecast='2023-03-30..'`.
2023-05-03 19:18:35 -10:00
Simon Michael
6749866d9e ;dev: drop hie.yaml, hls 0.10.0.0 seems to work better without it now 2023-05-03 19:18:35 -10:00
Simon Michael
24bf536f74 ;install: bump to ghc 9.4.5, hledger-lots 0.3.0 2023-05-03 19:18:35 -10:00
Simon Michael
5fa5e3f0f0 ;dev: stack: bump to ghc 9.4.5 2023-05-03 19:18:35 -10:00
Simon Michael
b4665d80d3 ;doc: fix sample.timeclock, account names may contain semicolon 2023-05-03 19:18:35 -10:00
Simon Michael
bbecd611f1 imp: timedot: make one multi-posting transaction per date line (#1754)
Descriptions and comments are now more straightforward and similar to
journal format.
2023-05-03 19:18:35 -10:00
Simon Michael
50349f81f7 imp: timeclock: support comments and tags (fix #1220)
Breaking change: previously timeclock descriptions could contain
semicolons. Now a semicolon in the description will end it and
start a comment (which may contain tags).
2023-05-03 00:05:11 -10:00
Simon Michael
f7f86a709b imp: timedot: fix day description/comment parsing; parse posting comments/tags 2023-05-02 17:03:03 -10:00
Simon Michael
1b19f3d330 dev: timedot: clarify, cleanup 2023-05-02 17:02:30 -10:00
Simon Michael
c026e74611 ;doc: auto postings: note _tag:generated trick 2023-05-02 15:52:53 -10:00
Simon Michael
559f436d3e dev: web: refactor: ViewData q, m -> qparam, q 2023-05-01 13:23:33 -10:00
Simon Michael
981ebb6518 fix: web: a startup depth limit now works, does not hide txns (fix #1763) 2023-05-01 13:11:03 -10:00
Simon Michael
a771c8fc19 imp: revert 2b5194238 imp: generate auto postings on forecast transactions by default (#2027)
I found at least one user for whom this would be a breaking change
(they generate forecast txns, and have auto posting rules, but don't
want the latter applied to the former). I guess it's better to keep
things as they were for now: if you need auto postings on your
forecast txns you must use two flags, --forecast --auto.
2023-04-30 08:08:26 -10:00
Simon Michael
4885b3ad32 ;doc: cli: improve Generating data; document --verbose-tags 2023-04-29 18:58:30 -10:00
Simon Michael
7f713f6a44 imp: Generated/modified txns/postings are now tagged only with --verbose-tags 2023-04-29 18:25:11 -10:00
Simon Michael
ca42b0aaca imp: cli: clean up some flags' help and sync docs 2023-04-29 18:11:53 -10:00
Simon Michael
2b5194238b imp: generate auto postings on forecast transactions by default 2023-04-29 16:00:14 -10:00
Simon Michael
765742ab9c ;doc: bin: cleanup 2023-04-28 14:26:14 -10:00
Simon Michael
de25142345 ;doc: bin: hledger-fifo -> hledger-lots 2023-04-28 14:21:18 -10:00
Simon Michael
9ebcd9ec28 fix: process postings in date order when inferring balance assignments (fix #2025) 2023-04-27 17:15:21 -10:00
Simon Michael
9d0eb20ac5 ;dev: improve comment 2023-04-27 09:17:29 -10:00
Simon Michael
400f401d11 ;dev: tools: fix make etags 2023-04-27 09:17:03 -10:00
Simon Michael
f5c3bbcaf0 fix: cli: posting comment lines no longer disturb the error marker (fix #1927) 2023-04-26 22:53:01 -10:00
Simon Michael
8b3b63b495 ;doc: journal: cheatsheet: fix typo (#1982) 2023-04-25 12:48:39 -10:00
Simon Michael
fe6df964b4 ;doc: bal: try to improve description of budget report differences 2023-04-25 12:39:28 -10:00
Simon Michael
f3be461045 ;doc: 1.29 relnotes: slight edit 2023-04-25 12:38:42 -10:00
Simon Michael
315df53c56 ;doc: bin: hledger-bar example 2023-04-22 20:36:36 -10:00
Simon Michael
ade9afbcb3 ;doc: forecasting: edits 2023-04-21 14:38:35 -10:00
Simon Michael
bb64bb1961 ;doc: forecasting: edits 2023-04-21 11:18:05 -10:00
Simon Michael
14e6497cf1 ;doc: forecasting: edits 2023-04-21 11:05:27 -10:00
Simon Michael
65fd7e821e ;doc: forecasting: rewrite 2023-04-21 10:41:42 -10:00
Simon Michael
93ee092ab7 ;doc: bin: hledger-bar: update 2023-04-20 20:29:12 -10:00
Simon Michael
eba95fb38b ;bin: bar: cleanups 2023-04-20 14:44:29 -10:00
Simon Michael
1be06c87c4 feat: bal: A new --count report type counts postings instead of amounts. 2023-04-20 14:36:41 -10:00
Simon Michael
40d10bc8c5 imp: cli: commands list: help for hledger-bar script 2023-04-20 12:58:30 -10:00
Simon Michael
3165d4d897 bin: hledger-bar - simple bar charts in the terminal 2023-04-20 12:58:08 -10:00
Simon Michael
ef79537943 ;doc: small fixes; remove mention of ancient setenv 2023-04-20 12:58:04 -10:00
Simon Michael
fdea2e0bcd ;doc: journal: rewrite Directives section, fix links 2023-04-14 20:20:18 -10:00
Simon Michael
f937d44538 ;doc: dev: updates 2023-04-14 20:08:37 -10:00
Simon Michael
8366011f70 ;doc: ROADMAP: mission tweaks 2023-04-13 09:07:44 -10:00
Simon Michael
c95d01531c ;doc: ROADMAP: formatting 2023-04-13 08:48:30 -10:00
Simon Michael
d473995fe1 ;doc: ROADMAP: formatting fix 2023-04-13 08:47:30 -10:00
Simon Michael
2661b7a53a ;doc: ROADMAP: simplify, add mission 2023-04-13 08:45:37 -10:00
Simon Michael
500f95321a ;doc: dev: cleanups 2023-04-13 08:45:00 -10:00
Simon Michael
32244e7231 ;doc: BACKLOG, TODO: cleanups 2023-04-13 06:48:35 -10:00
Simon Michael
74a794a05f ;doc: BACKLOG: switch to markdown 2023-04-13 06:44:06 -10:00
Simon Michael
66e658f593 ;doc: ROADMAP: switch to markdown 2023-04-13 06:26:25 -10:00
Simon Michael
e566efc04a ;doc: add TODO, begin cleaning up BACKLOG 2023-04-13 06:06:52 -10:00
Simon Michael
bc64b79574 ;doc: csv: edits 2023-04-12 21:23:12 -10:00
Simon Michael
e491aa2ff4 ;doc: csv: edits 2023-04-12 17:49:58 -10:00
Simon Michael
dc8dba4e67 ;doc: csv: edits 2023-04-12 17:28:46 -10:00
Simon Michael
08c2e3deed ;doc: csv: tweak 2023-04-12 16:13:10 -10:00
Simon Michael
d7b9f4f631 ;doc: csv: clarify amount setting, sign flipping a bit 2023-04-12 16:06:12 -10:00
Simon Michael
d2a1f17288 ;doc: RELEASING updates 2023-04-07 14:33:11 -10:00
Simon Michael
996ccb0ea2 ;doc: changes: merge from 1.29.2 branch 2023-04-07 14:26:45 -10:00
Simon Michael
d446119476 ;doc: CHANGES: install: mention hledger-iadd, hledger-lots 2023-04-07 14:19:19 -10:00
Simon Michael
7309c6224d install: update for 1.29.2; re-enable hledger-iadd, add hledger-lots 2023-04-07 14:16:30 -10:00
Simon Michael
1f42501278 pkg: stack cleanups 2023-04-07 14:15:31 -10:00
Simon Michael
ae23a18f87 ;doc: update changelogs 2023-04-07 11:31:25 -10:00
Simon Michael
ad4198b5e6 fix: ui: restore the --menu flag for compatibility 2023-04-07 10:56:55 -10:00
Simon Michael
e24de8bdc1 ;doc: RELEASING: updates 2023-04-07 10:03:11 -10:00
Simon Michael
c2288f8143 ;doc: update command help 2023-04-07 09:52:31 -10:00
Simon Michael
2bdba319b1 ;doc: update manuals 2023-04-07 09:52:29 -10:00
Simon Michael
ed2ff1e0c4 ;doc: RELEASING: updates 2023-04-07 07:12:27 -10:00
Simon Michael
03eab019a3 ;doc: rename release diagram, add obsidian source file 2023-04-07 06:58:38 -10:00
Simon Michael
9c4b5a26fa imp: ui, web: use a pager to show command line help, like cli 2023-04-06 15:36:08 -10:00
Simon Michael
939532be95 dev: make ghci-web: disable the config symlink to fix makeinfo warnings 2023-04-06 15:36:00 -10:00
Simon Michael
3e3c3c8355 imp: help: doc: warn about old info on mac (fix #1770) 2023-04-06 15:36:00 -10:00
Simon Michael
1c5dee2339 fix: doc: update manuals; regenerate all info manuals (fix #2023) 2023-04-06 14:13:39 -10:00
Simon Michael
270a92292f fix: Shake: adapt to texinfo 7, fixing info manual generation (#2023) 2023-04-06 14:12:53 -10:00
Simon Michael
fb56fff93a ;dev: make: copy-exe*: use hyphen again, less annoying 2023-04-06 13:16:28 -10:00
Simon Michael
2e58bea809 ;doc: cli: paging: cleanup 2023-04-06 12:24:31 -10:00
Simon Michael
f0157625cb ;doc: close: fix typo 2023-04-06 12:18:00 -10:00
Simon Michael
3387453578 ;doc: cli: add Paging section (#2015) 2023-04-06 11:47:03 -10:00
Simon Michael
1de8600067 imp: cli: try to ensure less (and its more mode) show ANSI (fix #2015)
If you use some other $PAGER, you will have to configure it to show
ANSI yourself (or disable ANSI, eg by setting NO_COLOR=1).
2023-04-06 11:13:00 -10:00
Simon Michael
c661fa7763 dev: lib: refactor pager 2023-04-06 11:12:56 -10:00
Simon Michael
eb5a8ecc4e doc: cli: improve 1.29 changelog for the close command (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
63ca3ac049 doc: cli: improve 1.29 changelog for periodic reports/transactions change 2023-04-06 11:12:35 -10:00
Simon Michael
6e7575317a imp: "type:" queries now see through aliases/pivots, like acct: (fix #2018)
When doing a type: match we now also check the original unaliased,
unpivoted posting, as when doing an acct: match. This is effectively
how things worked with the older account type detection in hledger <1.27.
2023-04-06 11:12:35 -10:00
Simon Michael
78271d9204 doc: cli: mention SQLite primary key workaround (fix #2017) 2023-04-06 11:12:35 -10:00
Simon Michael
94e5aa3dfa ;doc: update command help 2023-04-06 11:12:35 -10:00
Simon Michael
ba0bb5eb4a imp: close: restore legacy flags --closing/--opening/--close-to/--open-from (#2020)
They're cruft, but hidden and low cost and remove one more user hassle.
2023-04-06 11:12:35 -10:00
Simon Michael
c151d57069 imp: close: restore equity command alias; improve help/doc (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
1d83e14392 imp: close: more cleanup; add --close; always default to ALE (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
7695e409bf imp: close: tweak doc more (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
3660118575 imp: close: reorder/clean options more (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
19ea31dd61 fix: close: restore --open-acct option (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
3acd0a33df imp: close: reorder flags, rewrite help/doc (#2020) 2023-04-06 11:12:35 -10:00
Simon Michael
53aeabebbc dev: print: fix a date-sensitive JSON test 2023-04-06 11:12:35 -10:00
Simon Michael
c2aae60cf0 fix: doc: rewrite/correct Date adjustment section 2023-04-06 11:12:35 -10:00
Simon Michael
3fb1a5840a ;doc: update manuals 2023-03-31 18:31:16 -10:00
Simon Michael
ffe22846d9 ;doc: file renamed 2023-03-31 18:20:28 -10:00
Simon Michael
23bc23108d ;doc: journal: costs: mention sign 2023-03-31 18:20:11 -10:00
Simon Michael
de5cf45032 ;doc: i18n: improve display order 2023-03-31 14:04:32 -10:00
Simon Michael
b6d06f01a3 ;examples: i18n: streamline declarations, add draft CJK translations 2023-03-31 12:12:25 -10:00
Simon Michael
49c825e253 ;examples: i18n: more danish 2023-03-31 11:29:27 -10:00
Simon Michael
0f3e17e0e1 ;doc: get started link 2023-03-31 11:22:47 -10:00
Simon Michael
ef54ec4126 ;examples: top level account/type declarations in several languages 2023-03-31 11:22:04 -10:00
Simon Michael
22ef4d44de ;doc: faq cleanup 2023-03-31 08:46:54 -10:00
Simon Michael
2fbf3423de ;doc: bin: note scripts are not required 2023-03-31 05:57:13 -10:00
Simon Michael
e8cf09f477 imp: acc: reorder/clean up flags 2023-03-30 10:58:46 -10:00
Simon Michael
c03d6b1123 imp: print: --match makes better choices
Previously, similarity completely outweighed recency, so a
slightly-more-similar transaction would always be selected no matter
how old it was. Now similarity and recency are more balanced,
and it should produce the desired transaction more often.
There is also new debug output (at debug level 1) for
troubleshooting.
2023-03-27 15:21:42 -10:00
Simon Michael
6bf2afe80c ;doc: update manuals 2023-03-27 11:07:56 -10:00
Chris Lemaire
891853d2f2 queries: Update boolean queries to be case-insensitive
That is, the query operators AND, OR, and NOT are now case-insensitive.
Queries are otherwise left the same as they were.
2023-03-27 10:29:26 -10:00
Chris Lemaire
cddbae6467 queries: Prefix boolean queries with expr:
Boolean queries are now prefixed with an 'expr:' prefix, making them
completely separable from old queries and making the addition of them a
little more migration proof.

The tests are updated accordingly, changes made to the tests previously
are removed and extra cautious documentation is also removed.
2023-03-27 10:29:26 -10:00
Chris Lemaire
4f143d6bec queries: Update documentation on boolean queries
Also add a test to check that the assertion on how boolean queries
combine with space-separated queries works.
2023-03-27 10:29:26 -10:00
Chris Lemaire
35db1cae4f queries: Add generalised boolean queries
This commit changes some of the functions in the Query module and
changes the overall way to parse queries. Instead of using the words''
split function, this commit starts to fully parse the query, as it's
seen as a type of expression.

AND, OR, NOT, and space operators can be used. The space operator
simulates the behaviour from before, leaving a minimal amount of tests
that need to be adjusted to comply to the new behaviour.
2023-03-27 10:29:26 -10:00
Simon Michael
790b6ca9da fix: ui: add new screen missing from commit 2023-03-24 15:08:13 -10:00
Simon Michael
0f4413f011 doc: ui: note transaction screen's inability to update; code cleanup 2023-03-24 12:44:53 -10:00
Simon Michael
056553e8a9 imp: ui: improve screens' help footer 2023-03-24 11:33:36 -10:00
Simon Michael
6b80d2e83a ;install: bump version 2023-03-24 10:43:55 -10:00
Simon Michael
4c29669750 ;doc: update manuals 2023-03-24 10:33:17 -10:00
Simon Michael
ce07424164 ;cabal: update cabal files 2023-03-24 10:33:08 -10:00
Simon Michael
8ff0584a3c dev: ui: update tests 2023-03-24 10:32:14 -10:00
Simon Michael
5d69c09366 imp: ui: help tweak 2023-03-24 10:09:52 -10:00
Simon Michael
6cbf354206 imp: ui: show menu screen by default; drop the --menu flag
It's a simpler and more natural default; power users can use a flag to
start in the desired screen.
2023-03-24 10:07:53 -10:00
Simon Michael
3705e4c15e imp: ui: menu: move "All accounts" screen last 2023-03-24 08:03:04 -10:00
Simon Michael
a4b3476e2f feat: ui: add "Cash accounts" screen 2023-03-24 07:59:16 -10:00
Simon Michael
13cd01ca36 ;install: also list installed cabal, stack, pip versions 2023-03-24 07:25:38 -10:00
Simon Michael
69a8834803 dev: demo: notes 2023-03-18 20:49:12 -10:00
Simon Michael
c2ab616c2d dev: unbreak recent change, don't re-export Color/ColorIntensity for now 2023-03-18 20:19:50 -10:00
Simon Michael
b9af9ab367 ;doc: update changelogs 2023-03-18 20:10:25 -10:00
Simon Michael
13531b5b86 ;doc: update manuals 2023-03-18 20:07:18 -10:00
Simon Michael
4d7d982f83 ;cabal: update cabal files 2023-03-18 20:06:55 -10:00
Simon Michael
062559cbd5 imp: demo: nicer output, show clearer start/stop indicators, don't show "exit" 2023-03-18 20:06:24 -10:00
Simon Michael
33876905f1 dev: lib: Hledger.Cli.Script: cleanup 2023-03-18 20:02:22 -10:00
Simon Michael
be8e64e498 imp: lib: export more terminal size, ANSI style/color helpers
Hledger.Utils.IO (and therefore Hledger and Hledger.Cli.Script) added:

    getTerminalHeightWidth
    getTerminalHeight
    getTerminalWidth
    Color(..)
    ColorIntensity(..)
    bold'
    faint'
    black'
    red'
    green'
    yellow'
    blue'
    magenta'
    cyan'
    white'
    brightBlack'
    brightRed'
    brightGreen'
    brightYellow'
    brightBlue'
    brightMagenta'
    brightCyan'
    brightWhite'
    rgb'
2023-03-18 19:59:00 -10:00
Simon Michael
96b2cede0b ;dev: demo: balance, print: display "exit" at the end like the others 2023-03-18 01:53:29 -10:00
Simon Michael
207cad0dfb ;doc: update changelogs 2023-03-18 01:43:05 -10:00
Simon Michael
8ec59eafac imp: demo: Getting help 2023-03-18 01:33:34 -10:00
Simon Michael
0520ef03f6 ;imp: demo: titles cleanup 2023-03-18 01:32:40 -10:00
Simon Michael
7632321b3c ;imp: cli: commands list cleanups 2023-03-18 01:14:31 -10:00
Simon Michael
6588020e64 ;doc: update CLI help text files 2023-03-17 00:53:57 -10:00
Simon Michael
8b2efe3c33 ;imp: demo: help updates 2023-03-17 00:53:30 -10:00
Simon Michael
bbb58c3804 imp: demo: Watching the built-in demos (demo) 2023-03-17 00:09:24 -10:00
Simon Michael
12247c8767 ;dev: shake cmdhelp: simplify commit message 2023-03-16 23:20:14 -10:00
Simon Michael
b9273a4585 imp: cli: move OTHER last in commands list 2023-03-16 23:20:14 -10:00
Simon Michael
98865d6025 imp: demo: split print / balance demos 2023-03-16 23:20:14 -10:00
Simon Michael
6777182c70 imp: demo: output cleanups 2023-03-16 23:20:14 -10:00
Simon Michael
2d496609bc imp: demo: hide the file names 2023-03-16 23:20:14 -10:00
Simon Michael
0aab8cbd9a imp: demo: more consistent demo titles 2023-03-16 23:20:14 -10:00
Simon Michael
12853b1fda ;doc: update manuals 2023-03-16 21:58:39 -10:00
Simon Michael
7e422cb12a ;doc: update CLI help text files 2023-03-16 21:58:39 -10:00
Simon Michael
5a99ea6d63 ;cabal: update cabal files 2023-03-16 21:58:38 -10:00
Simon Michael
38fd51b97c feat: embed some asciinema demos, and a demo command to play them 2023-03-16 21:58:38 -10:00
Simon Michael
5ddb6028ed ;dev: lib: cleanup 2023-03-16 21:52:37 -10:00
Simon Michael
5655c533fa ;doc: merge release changelogs 2023-03-16 17:45:43 -10:00
Simon Michael
d124d40e6c ;bin: hledger-install: update for 1.29.1, re-enable hledger-interest 2023-03-16 16:35:40 -10:00
Simon Michael
5f50c96395 ;doc: project changelog tweak 2023-03-16 16:04:49 -10:00
Simon Michael
acc0160d7c ;dev: rename tools/release to bake 2023-03-16 15:54:39 -10:00
Simon Michael
0f63a35ea3 ;doc: update changelogs 2023-03-16 15:45:16 -10:00
Simon Michael
3d968fb98e ;doc: update manuals 2023-03-16 15:44:35 -10:00
Simon Michael
708d55c2dd ;doc: RELEASING: updates 2023-03-16 15:35:44 -10:00
Simon Michael
10a36e64a7 ;doc: RELEASING: update value map 2023-03-16 15:22:10 -10:00
Simon Michael
e9349d550a ;doc: RELEASING: update value map 2023-03-16 15:17:39 -10:00
Simon Michael
fe3477797b ;doc: update changelogs 2023-03-16 14:56:25 -10:00
Simon Michael
70ef3e816c fix: stats: fix a regression in date display since 1.28 (#2012) 2023-03-16 14:52:37 -10:00
Simon Michael
ee29893040 dev: fix Hledger.Utils.String import 2023-03-16 14:48:59 -10:00
Simon Michael
cc41704c92 ;doc: update changelogs 2023-03-16 14:44:50 -10:00
Simon Michael
83a8108055 imp: install: slight output cleanups 2023-03-16 14:36:29 -10:00
Simon Michael
62bb93af9c imp: lib: Hledger.Cli.Script: more re-exports
added:
Control.Applicative
Control.Concurrent
Data.Char
Data.Functor
System.IO
System.IO.Error
2023-03-16 14:36:29 -10:00
Simon Michael
d3e4f8547c imp: lib: Hledger.Utils.String: more string strippers
added:
strip1Char
stripBy
strip1By

Not used in hledger right now, but useful to offer in our scripting prelude.
2023-03-16 14:35:37 -10:00
Simon Michael
521e0adb5d ;pkg: early stack build plan using GHC 9.6.1 (#2011) 2023-03-15 20:44:05 -10:00
Simon Michael
cb011c0c77 ;cabal: update cabal files (#2011) 2023-03-15 20:44:01 -10:00
Simon Michael
44805f96ef ;dev: ui, web: fixes for ghc 9.6; cleanup (#2011) 2023-03-15 20:43:51 -10:00
Simon Michael
658a650bb2 ;dev: lib: another Balancing fix after ghc 9.6 support (#2011) 2023-03-15 20:26:57 -10:00
Simon Michael
eb918044ce ;dev: make releasediag 2023-03-15 10:45:39 -10:00
Simon Michael
85c037781f ;doc: RELEASING: update value map 2023-03-15 10:45:13 -10:00
Simon Michael
c3965f4746 ;doc: RELEASING: update value map 2023-03-14 22:26:34 -10:00
Simon Michael
4aa734c18c ;doc: RELEASING: update value map 2023-03-14 19:44:33 -10:00
Simon Michael
da485d8c27 ;doc: RELEASING: fix value map link 2023-03-14 18:42:34 -10:00
Simon Michael
2a0dc60eb4 ;doc: RELEASING: update value map 2023-03-14 18:41:16 -10:00
Simon Michael
78fb515864 ;doc: RELEASING: add value map diagram 2023-03-14 17:01:00 -10:00
Simon Michael
d012384d57 ;dev: cli: also build with GHC 9.6.1 2023-03-14 10:49:58 -10:00
Simon Michael
3932bafc78 ;cabal: update cabal files 2023-03-14 10:42:52 -10:00
Simon Michael
c790aa6145 ;dev: lib: also build with GHC 9.6.1; add base-compat 2023-03-14 10:42:48 -10:00
Simon Michael
c835d8f917 ;dev: update hie.yaml so HLS uses GHC 9.4, drop symlink 2023-03-14 10:41:56 -10:00
Simon Michael
d0e51597f7 ;doc: ANNOUNCE: punctuation 2023-03-14 10:41:56 -10:00
Simon Michael
3ac64a86e7 ;doc: RELEASING updates
many more needed..
2023-03-14 10:41:56 -10:00
Simon Michael
a3aebb96e4 ;doc: save ANNOUNCE.masto 2023-03-14 10:41:56 -10:00
Yehoshua Pesach Wallach
7ddcf3b9e1 fix: doc: remove duplicate in hledger close docs 2023-03-13 09:23:18 -10:00
Simon Michael
8ea30463ed ;install: fix more brokenness 2023-03-11 14:13:00 -10:00
Simon Michael
19b25e0cbb ;install: fix a brokenness with STACK_EXTRA_DEPS 2023-03-11 14:09:19 -10:00
Simon Michael
64b57da01a ;install: bump resolver 2023-03-11 14:09:17 -10:00
Simon Michael
9ceb74062d ;doc: update manuals 2023-03-11 13:28:02 -10:00
Simon Michael
f75110f49c ;cabal: update cabal files 2023-03-11 13:27:25 -10:00
Simon Michael
a0ca339c46 ;pkg: bump version to 1.29.99 2023-03-11 13:27:25 -10:00
Simon Michael
2e3872c3f1 ;doc: changelogs: 1.29 2023-03-11 13:26:30 -10:00
Simon Michael
0e41fea8e0 install: updates for 1.29 2023-03-11 13:08:26 -10:00
Simon Michael
65f2d21b74 ;doc: ANNOUNCE 2023-03-11 13:08:26 -10:00
Simon Michael
6dc91588e4 fix: lib: avoid using pager on Windows, part 2 2023-03-10 20:58:11 -10:00
Simon Michael
b83eb136cc ;cabal: update cabal files 2023-03-10 19:14:30 -10:00
Simon Michael
41e838ef83 fix: lib: avoid using pager on Windows, the package is not supported 2023-03-10 19:14:13 -10:00
Simon Michael
3206b0e278 ci: minor updates 2023-03-10 19:02:34 -10:00
Simon Michael
c2e7cc5700 pkg: update stackage resolvers, extra deps 2023-03-10 18:58:22 -10:00
Simon Michael
82be50902a ;doc: bin/README: updates 2023-02-21 16:46:34 -10:00
Simon Michael
caa8b4871e ;doc: bin/README: edits 2023-02-21 12:18:04 -10:00
Simon Michael
56c38b1b29 fix: areg: handle an extra account query correctly (fix #2007) 2023-02-21 10:04:07 -10:00
Simon Michael
44400e840c dev: lib: clarify accountTransactionsReportItem 2023-02-21 09:47:59 -10:00
Simon Michael
af38121442 imp: areg: when restricted by extra query args, show a hint in title
I was confused when using 'areg ACCT QUERY'. Now, the title will show
" (matching query)" as a hint when a QUERY is specified,
except when it is a date restriction (which is common and not confusing)
or a depth restriction (which is ignored).
2023-02-21 08:29:59 -10:00
Simon Michael
25b8d51ff2 activity: fix output after #1982; add tests 2023-02-21 07:17:21 -10:00
Simon Michael
8e34c5253c ;doc: bin/README: tweak 2023-02-21 00:39:38 -10:00
Simon Michael
c1b311011a ;doc: update manuals 2023-02-21 00:39:30 -10:00
Simon Michael
70539a70bd ;cli: consolidate commands overvinew; sync commands list 2023-02-21 00:35:14 -10:00
Simon Michael
2af744292a ;doc: update manuals 2023-02-21 00:17:02 -10:00
Simon Michael
4d66f48a47 ;doc: update CLI help text files 2023-02-21 00:16:46 -10:00
Simon Michael
3ee2f59b57 ;doc: reorganise bin/README & the Scripts page 2023-02-21 00:16:15 -10:00
Simon Michael
5c7e107c5b ;doc: cli: list commands like the CLI's commands list 2023-02-21 00:15:22 -10:00
Simon Michael
e4c6e83ed1 ;doc: bin/README: separate hledger-edit, hledger-lot entries 2023-02-20 22:28:41 -10:00
Simon Michael
2e6cf0e806 ;imp: cli: commands list: better hledger-fifo entries 2023-02-20 22:15:58 -10:00
Simon Michael
6a9f2b5745 ;doc: bin/README: add hledger-fifo, improve hledger-utils 2023-02-20 22:05:41 -10:00
Simon Michael
c74f72ff40 ;imp: cli: commands list: add an entry for hledger-fifo 2023-02-20 21:58:13 -10:00
Simon Michael
02b673e516 ;bin: git: tweak help, add commit -n example 2023-02-20 16:25:36 -10:00
Simon Michael
0db44f11bb ;doc: update CLI usage texts 2023-02-20 16:24:54 -10:00
Simon Michael
2eaab54426 imp: close: more useful defaults, retain/migrate/open modes 2023-02-20 16:24:54 -10:00
Simon Michael
173f61bee0 dev: Commands: cleanup, fix harmless bug in command finding 2023-02-20 16:24:54 -10:00
Simon Michael
7408bc02df lib: Hledger.Data.RawOptions: add unsetboolopt 2023-02-20 16:24:54 -10:00
Simon Michael
d98dfedb9e ;dev: shake: cmdhelp: tweak commit message 2023-02-20 16:24:54 -10:00
Simon Michael
0567935e4b cli: simplify command doc inclusion, give them normal heading structure 2023-02-20 16:24:54 -10:00
Simon Michael
81f596b1fb cli: fix some Commands file permissions 2023-02-20 16:24:54 -10:00
Michael Grünewald
4b43e63a89 fix: cli: don't crash multicol with few strings
When there are only few, short strs and width is large, then the div
operation in itemspercol would return zero, triggering and error in
chunksOf.

This fix makes numcols have always at least as many entries as strs,
filling one line.
2023-02-19 11:52:46 -10:00
Simon Michael
fa70f160ae imp: partial/inferred dates are flexible, full dates are not (#1982)
DateSpans are now now aware of exact/flexible dates.
2023-02-17 07:24:19 -10:00
Simon Michael
032ffd112b imp: cli: report intervals can now start on arbitrary dates
Eg, where previously -p 'monthly from 1/15' or -M -b 1/15 would always
adjust the report start date to 1/1,
unless you used the special -p 'every 15th day of month from 1/15' form,
now the start date will not be adjusted. (It is still adjusted if
the report date is not specified explicitly, eg inferred from the journal).

This keeps behaviour consistent between report periods and periodic transactions.

'in' period expressions, like 'in 2023-01', are a grey area; they
do specify a start date (2023-01-01), although they look a bit implicit.
So previously, -p 'weekly in 2023-01' would adjust the start date to
the preceding monday (2022-12-26), but now it will start exactly on
2023-01-01 (a sunday, which also causes ugly verbose column headings).

To ensure monday based weeks and simple report headings here,
you would have to explicitly specific a start date that is a monday,
eg -p 'weekly from 2022-12-26 to 2023-02'.
2023-02-17 07:24:19 -10:00
Simon Michael
4260a350c8 ;doc: cli: period expressions doc updates 2023-02-17 07:24:19 -10:00
Simon Michael
5537a251f3 imp: journal: periodic txns need not start on an interval boundary
Eg, ~ monthly from 1/15 now works, instead of giving an error message.
2023-02-17 07:24:19 -10:00
Simon Michael
0c74744626 fix: test: fix periodic transaction pretty-printing (#1988) 2023-02-17 07:24:19 -10:00
Simon Michael
7a9b0fd94c feat: check: the tags check checks tag names 2023-02-16 11:56:22 -10:00
Simon Michael
614697acf7 feat: journal: tag directive declares tag names 2023-02-16 11:56:22 -10:00
Simon Michael
e9cd1df048 dev: tests: convert remaining format 1 tests to format 3 (or 2)
Mostly done with an unreleased version of shelltestrunner, plus a few manual fixups.
2023-02-16 11:55:15 -10:00
Simon Michael
b6d36e9c0b ;dev: number pivot tests 2023-02-16 06:42:11 -10:00
Simon Michael
8aca6ff84b ;doc: import: tweak 2023-02-16 04:37:45 -10:00
Simon Michael
e34a20f3db ;doc: import: note a pitfall with multifile import 2023-02-15 20:09:20 -10:00
Simon Michael
d1e62f38a2 ;ui: help dialog: mention that LEFT shows other screens 2023-02-15 16:47:49 -10:00
Simon Michael
180d690cfc ;dev: an explicit ghc 9.2 hie.yaml for HLS, the only one that works now 2023-02-15 16:29:52 -10:00
Caleb Maclennan
7c34f08580 doc: bin: Document new AWK contrib script usage 2023-02-09 23:33:22 -10:00
Caleb Maclennan
1f088324c6 feat: bin: Add AWK script to sort postings and merge duplicates
Co-authored-by: Murukesh Mohanan <murukesh.mohanan@gmail.com>
2023-02-09 23:33:22 -10:00
Jonathan Dowland
0a052c7aef ;docs: indicate aregister supports html output
Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-02-09 10:53:09 -10:00
Jonathan Dowland
15eadd58ce feat: aregister: implement HTML output formatter (#1996)
The HTML formatter outputs a HTML snippet containing a table with a
header row and one data row per report item. The header row names
match those for the CSV output formatter. Multiple commodities in
a report item are listed together in the same cell separated by
commas, again matching the CSV formatter.

A future extension could be to explore using multiple rows for
multiple commodities, with HTML row spanning.

Fixes #1996.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-02-09 10:53:09 -10:00
Simon Michael
9106c9013f ;doc: bal: budget: fix lists 2023-02-04 14:54:54 -10:00
Simon Michael
3fea3b0db7 ;doc: bal: budget: compare with forecasting; add some tips 2023-02-04 14:47:01 -10:00
Simon Michael
02307c5369 ;doc: journal: cheatsheet: clarify date tag 2023-02-04 11:30:26 -10:00
Simon Michael
b8e538a57f ;doc: bal: --budget: clarify use of print --forecast 2023-02-04 10:37:14 -10:00
Simon Michael
513b6b5164 ;doc: check: adjacentconversionpostings was dropped 2023-02-04 08:03:54 -10:00
Simon Michael
da5b4667df ;doc: rename directive sections, fix many links 2023-02-04 08:01:47 -10:00
Simon Michael
f4160d5397 ;doc: bump man page dates 2023-02-04 07:06:18 -10:00
Simon Michael
89b699e78e ;doc: cli: fix all links to Journal > Tags / Commands > tags 2023-02-04 07:05:58 -10:00
Simon Michael
4eeafdc4d3 dev: delete strange old remnant of the checkdates command, causing HLS trouble 2023-02-04 06:42:05 -10:00
Simon Michael
a37da26ee9 ;bin: hledger-git: record: better error output 2023-02-03 19:07:28 -10:00
Simon Michael
ae26ae6294 ;bin: hledger-git: status command also shows diffs 2023-02-02 21:12:16 -10:00
Simon Michael
679f62cc60 ;dev: pr template: mention COMMITS page and prefix convention (#1997) 2023-02-01 13:30:21 -10:00
Simon Michael
1e1b26261d ;fix: bin: hledger-git: add short command aliases r, s, l 2023-02-01 13:30:21 -10:00
Simon Michael
e986bdf2d5 ;fix: bin: hledger-git: fix -h; pass unrecognised commands to git 2023-02-01 13:30:21 -10:00
Simon Michael
c477c59247 ;fix: bin: hledger-git: don't forcibly add ignored files 2023-02-01 13:30:21 -10:00
Simon Michael
c8c920cbe0 ;fix: bin: hledger-git: fix status command 2023-02-01 13:30:21 -10:00
Simon Michael
c51ebe7b8c imp: journal: remove the "adjacent conversion postings" check again
I find that single conversion postings are sometimes needed, eg with
paypal.
2023-02-01 13:30:21 -10:00
J. B. Rainsberger
c7eb9aa944 ;doc: Removed redundant paragraph in documentation. 2023-02-01 13:28:17 -10:00
Simon Michael
5ad1aab288 ;bin: rename hledger-script-example.hs; use fewer imports and deps 2023-01-29 16:57:14 -10:00
Simon Michael
b49b760497 ;bin: a version of hledger-register-max using a newer API
This one uses Hledger.Cli.Script to reduce import boilerplate,
and supports --help.
2023-01-29 16:29:58 -10:00
Simon Michael
98949beec3 ;cabal: update cabal files 2023-01-29 16:29:35 -10:00
Simon Michael
3f3401f8ad imp: cli: Hledger.Cli.Script convenience import for scripts
Hledger.Cli.Script is a convenient prelude for use in scripts,
reducing import boilerplate. It currently re-exports:

Control.Monad
Data.Either
Data.List
Data.Maybe
Data.Ord
Data.Time
Text.Printf hiding (formatString)
Data.Text (Text, pack, unpack)
Safe hiding (at)
System.Directory
System.Environment
System.Exit
System.FilePath
System.Process
Hledger
Hledger.Cli
Hledger.Cli.Main (argsToCliOpts)

but not (much of) Data.Text or Data.Text.IO, as those
need to be imported qualified.
2023-01-29 16:29:18 -10:00
Simon Michael
6589b506ed ;bin: register-max: tweaks 2023-01-29 08:14:15 -10:00
Simon Michael
173985dbfc ;bin: register-max: show multiple postings, better layou 2023-01-29 08:03:47 -10:00
Simon Michael
7f8f98707d ;bin: register-max: cleanup 2023-01-29 07:12:16 -10:00
Simon Michael
dc8e0f66de ;bin: register-max: don't add -H by default 2023-01-29 06:58:52 -10:00
Simon Michael
82abb00754 ;bin: register-max 2023-01-29 06:43:42 -10:00
Simon Michael
0f5857d94f ;pkg: stack: drop allow-newer, should be no longer needed 2023-01-28 23:03:11 -10:00
Simon Michael
66859fedb8 ;doc: account types edit 2023-01-28 23:02:33 -10:00
Simon Michael
53efb49c77 fix: cli: use black or white for banner & version, maximising legibility 2023-01-27 17:01:06 -10:00
Simon Michael
9381b46004 fix: lib: fix terminal lightness detection 2023-01-27 16:51:05 -10:00
Simon Michael
79914cbe74 fix: cli: avoid showing color detection escape sequence when piped 2023-01-27 10:50:56 -10:00
Simon Michael
110711a2a2 fix: cli: restore workaround to avoid showing escape codes in emacs 2023-01-27 10:00:07 -10:00
Simon Michael
eed8a06906 fix: cli: don't highlight help when TERM=dumb 2023-01-27 06:06:17 -10:00
Simon Michael
bb5d473955 fix: lib: don't use $PAGER when TERM=dumb 2023-01-27 06:01:49 -10:00
Simon Michael
7a636dd428 imp: cli: non-bold version string 2023-01-26 23:17:58 -10:00
Simon Michael
dc35fd173b pkg: stack: another extra dep needed 2023-01-26 22:25:24 -10:00
Simon Michael
45808c8e13 imp: cli: add terminalLightness; tweak IsLight threshold; embolden banner 2023-01-26 22:11:20 -10:00
Simon Michael
3ae9a5e0bc ;cabal: update cabal files 2023-01-26 22:11:20 -10:00
Simon Michael
9c7144e939 imp: cli: pick help accent color to contrast with terminal bg when possible 2023-01-26 22:11:20 -10:00
Simon Michael
1da4fd1eaf imp: lib: terminal colour detection
added:
terminalIsLight
terminalFgColor
terminalBgColor
2023-01-26 22:11:20 -10:00
Simon Michael
9ab8818368 dev: ci: actions/checkout: v2 -> v3 2023-01-26 22:04:04 -10:00
Simon Michael
6ebf811095 dev: ci: actions/cache: v2 -> v3 2023-01-26 22:04:04 -10:00
Simon Michael
72cd441a9f imp: cli: add a little highlighting to help output 2023-01-25 19:16:09 -10:00
Simon Michael
0de3acabcb cabal: update cabal files 2023-01-25 19:16:08 -10:00
Simon Michael
4387e6ffb5 pkg: stack: bump to latest snapshots, depend on text-ansi, add extra deps 2023-01-25 19:15:45 -10:00
Simon Michael
de330bdfce imp: journal: check for adjacent conversion postings only in strict mode
This avoids breaking existing journals if, say, they happen to have
a single "equity:trading" posting somewhere.
2023-01-25 19:00:29 -10:00
Simon Michael
9c5bcfea85 dev: transactionInferCostsFromEquity: clarify partitionPs 2023-01-25 19:00:29 -10:00
Simon Michael
6d849e06f5 ;doc: journal: redundant costs 2023-01-25 19:00:29 -10:00
Simon Michael
76f8eaf91a imp: journal: ignore redundant costs; --infer-costs more robustly
You can now write both @/@@ costs and corresponding equity conversion postings
in a transaction at any time, not just when using --infer-costs or --infer-equity.
hledger will recognise the redundancy and ignore it.

One thing has become more strict: hledger now requires conversion postings
to occur in adjacent pairs; an odd number of them is not allowed.
(Conversion postings are postings to accounts of type `V`/`Conversion`,
or named `equity:conversion`, `equity:trade`, `equity:trading`,
or subaccounts of these.)

And, --infer-costs now works in transactions with an implicit amount
(inferring costs from equity now happens after transaction balancing,
not before).
2023-01-25 19:00:29 -10:00
Simon Michael
7432769d3c lib: add journalMarkRedundantCosts to help with balancing; slight refactoring 2023-01-25 19:00:29 -10:00
Simon Michael
dd1ded3646 ;cabal: update cabal files 2023-01-25 17:25:34 -10:00
Simon Michael
d77d76e17f imp: cli: use $PAGER when help output is taller than terminal
This works with hledger, hledger -h and hledger CMD -h.
2023-01-25 17:20:27 -10:00
Simon Michael
093fdda7db ;imp: cli: commands list tweaks 2023-01-25 15:20:15 -10:00
Simon Michael
b140529465 ;doc: update manuals 2023-01-25 11:59:12 -10:00
Simon Michael
1b3b26895e ;doc: update CLI usage texts 2023-01-25 11:59:05 -10:00
Simon Michael
811ff64e30 ;doc: mockups: move lots to website 2023-01-25 11:37:01 -10:00
Simon Michael
311f0c99eb ;doc: areg: more advice on account-matching 2023-01-25 11:19:03 -10:00
Simon Michael
270e5cea5d ;doc: mockups: lots 2023-01-25 11:18:46 -10:00
Simon Michael
653a2e6030 ;doc: mockups: help.txt -> help.org 2023-01-25 11:18:08 -10:00
Simon Michael
fbbae55101 imp: cli: merge register-match with register command
register-match is now the --match mode of the register command.
It was used by ledger-autosync at one point, hopefully the new flag
works similarly.
2023-01-25 10:44:12 -10:00
Simon Michael
1899b43073 imp: cli: drop the print-unique command
It disorders same-day transactions, doesn't support print's options,
and isn't useful enough to be always shown in the builtin commands
list. I don't know of any users, or a use for it, and it could easily
be recreated as an addon script, so I'm inclined to not bother
supporting it as a hidden command.
2023-01-25 10:44:12 -10:00
Simon Michael
cce63e6816 imp: cli: reorganise commands list; add a banner; multicolumn addons 2023-01-25 10:44:12 -10:00
Simon Michael
e1cbe256d4 dev: tools: make copy-*: add .FOO suffix, not -FOO like addons 2023-01-25 10:44:12 -10:00
Simon Michael
8a139ac939 ;doc: web: improve --base-url description (#1562) 2023-01-24 14:06:51 -10:00
Simon Michael
39d5426c9d imp: install: code cleanups. 2023-01-24 13:56:22 -10:00
Simon Michael
64cd01d668 imp: install: check for pip install tool 2023-01-24 13:56:22 -10:00
Simon Michael
04a2ed2cd1 imp: install: also install hledger-edit, hledger-plot 2023-01-24 13:56:22 -10:00
Simon Michael
9f29c97b80 imp: install: add support for installing python packages 2023-01-24 13:56:21 -10:00
Simon Michael
454ee5ed74 imp: install: stack/cabal update more quietly 2023-01-24 13:56:21 -10:00
Simon Michael
82880dfc96 imp: install: align install status list 2023-01-24 13:56:21 -10:00
Simon Michael
b27a8a1ee4 imp: install: cleanups 2023-01-24 13:56:21 -10:00
Simon Michael
8cc35ba613 imp: install: bump version 2023-01-24 13:56:21 -10:00
Simon Michael
6c0ca69357 imp: install: help cleanups 2023-01-24 13:56:21 -10:00
Simon Michael
2ae0b6e439 imp: install: show quiet ('error') stack output by default 2023-01-24 13:56:21 -10:00
Simon Michael
5174b71a1d imp: install: whitespace fix 2023-01-24 13:56:21 -10:00
Simon Michael
48e90be82a imp: install: don't list hledger-install.sh in PATH, seems confusing 2023-01-24 13:56:21 -10:00
Simon Michael
0298a953e7 imp: install: bump minimum stack version to 2.5.1 (a guess) 2023-01-24 13:56:21 -10:00
Simon Michael
55b828890d imp: install: drop hledger-iadd for now
https://github.com/hpdeifel/hledger-iadd/issues/71
2023-01-24 13:56:21 -10:00
Simon Michael
9d78f0f422 imp: install: bump to latest lts-20, bump hledger-interest to 1.6.5 2023-01-24 13:56:21 -10:00
Simon Michael
c2e6121eb0 imp: install: trim stack's over-verbose version output 2023-01-24 13:56:21 -10:00
Chris Lemaire
43c9f018dc journal: Account directives reject account names with brackets
Previously, the accounts passed to account directives would be stripped
of their surrounding brackets, but the required behaviour is to have
account directives plain reject bracketed accounts. This change ensures
that accounts in account directives may not start with a bracket
character.
2023-01-24 13:40:01 -10:00
Simon Michael
ce87a89ef2
Merge pull request #1988 from chrislemaire/1984-source-name-and-position-for-forecast
journal: json: Add source positions to forecast transactions
2023-01-23 16:27:36 -10:00
Simon Michael
9497472e64
Merge branch 'master' into 1984-source-name-and-position-for-forecast 2023-01-23 16:04:00 -10:00
Simon Michael
6d5f37d438 ;doc: journal: rewrite Account names, mention brackets/parentheses (#1915) 2023-01-23 15:52:40 -10:00
Chris Lemaire
4ada2a3fbc journal: Fully unbracket AccountNames in account directives
Currently an account name like "a:(aa)" will not have (aa) unbracketed.
However, this seems reasonable since the full name is unbracketed and
thus will not be confused with virtual or virtual-balanced posting.
2023-01-23 12:43:13 -10:00
Chris Lemaire
b987c42e63 Add test checking forecast source links to periodic transaction 2023-01-22 09:18:32 +01:00
Chris Lemaire
97f15eac03 Fix failing hledger-web test
This test appeared to have failed after adding source positions to
generated transactions. This is because the generated transaction id for
web pages appears to be dependent on whether the transaction has an
associated source file. Because it has one associated now, the id was
updated to be 'transaction-2-1' for instance, instead of
'transaction-0-1' as it would have been before. The fix is to change the
test.
2023-01-21 23:24:43 +01:00
Chris Lemaire
9443fe0e0d journal: json: Add source positions to forecast transactions 2023-01-21 22:30:30 +01:00
Simon Michael
eff29ac10d ;tools: push: refactor 2023-01-21 10:21:38 -10:00
Simon Michael
7a5676dde4 ;tools: push: select branch to push more robustly 2023-01-21 10:19:03 -10:00
Simon Michael
1455a4d2fc ;doc: move plugin types table to Scripting hledger page 2023-01-21 10:19:03 -10:00
Simon Michael
6701688bd0 ;doc: start tracking DECISIONS 2023-01-21 09:50:32 -10:00
Simon Michael
51ea536ecc ;doc: csv: link, rules factoring tips 2023-01-21 09:49:47 -10:00
Simon Michael
e5f3c0ecdb lib: transactionInferCostsFromEquity: adjust to "cost" terminology 2023-01-20 21:47:44 -10:00
Simon Michael
5ca8752e48 lib: journalBalanceTransactions, balanceTransactionHelper cleanups 2023-01-20 20:23:27 -10:00
Simon Michael
3f558596ec ;doc: csv: improve Setting amounts 2023-01-20 09:24:31 -10:00
Simon Michael
ac7b59bcfa ;doc: csv: improve Amount field / Setting amounts 2023-01-20 09:06:17 -10:00
Simon Michael
abaa04f2f9 doc: cli: note --infer-costs limitation, no missing amounts for now
In journalFinalise currently things are done in this order:

...
1. infer costs from equity conversion postings if requested
2. balance transactions, possibly inferring a missing amount, and/or balancing costs if permitted
3. infer equity conversion postings from costs if requested
...

You would think that 1 could happen after 2, allowing missing amounts
to be inferred before attempting to infer costs from equity postings,
but somehow the current expected behaviour of tolerating excess costs
generated with --infer-costs depends on the current ordering.
Just document it for now.
2023-01-19 21:11:12 -10:00
Simon Michael
5b27554f0a dev: note why inferring costs from equity before balancing 2023-01-19 20:57:02 -10:00
Simon Michael
2687b7d7b6 dev: transaction-prices.test -> costs.test, cleanup 2023-01-19 20:56:41 -10:00
Simon Michael
cf469c080d lib: journalInferCosts -> journalInferCostsFromEquity 2023-01-19 20:25:41 -10:00
Simon Michael
28eb8be4fa lib: BalancingOpts{infer_transaction_prices_ -> infer_balancing_costs_} 2023-01-19 20:21:31 -10:00
Simon Michael
c0950c0900 lib: Hledger.Data.Balancing: inferBalancingPrices -> transactionInferBalancingCosts 2023-01-19 09:36:12 -10:00
Simon Michael
7ecf7ef27b lib: Hledger.Data.Balancing: inferBalancingAmount -> transactionInferBalancingAmount 2023-01-19 09:28:30 -10:00
Simon Michael
402b4265f8 lib: Hledger.Data.Journal: transactionAddPricesFromEquity -> transactionInferCostsFromEquity 2023-01-19 09:22:55 -10:00
Simon Michael
dfea6eaee2 lib: Hledger.Data.Journal: journalAddPricesFromEquity -> journalInferCosts 2023-01-19 09:17:56 -10:00
Simon Michael
440f808b3d ;doc: csv: coinbase example: avoid showing different local date 2023-01-19 08:49:58 -10:00
Simon Michael
363fc57207 ;doc: csv: align, tweak 2023-01-19 08:12:33 -10:00
Simon Michael
9c20d7955b ;doc: csv: add new coinbase example 2023-01-19 07:47:00 -10:00
Simon Michael
c403bb56a1 ;doc: csv: try to clarify how CSV/hledger fields work: tweak 2023-01-19 07:19:34 -10:00
Simon Michael
eb79385388 ;doc: csv: try to clarify how CSV/hledger fields work: tweak 2023-01-19 07:17:24 -10:00
Simon Michael
3c22259047 ;doc: csv: try to clarify how CSV/hledger fields work: tweak 2023-01-19 07:09:29 -10:00
Simon Michael
b97b48926c ;doc: csv: try to clarify how CSV/hledger fields work: add examples 2023-01-19 07:03:31 -10:00
Simon Michael
00444862f1 ;doc: csv: try to clarify how CSV fields and hledger fields work 2023-01-19 06:50:58 -10:00
Simon Michael
b4501a270d ;doc: csv: try to clarify how CSV fields and hledger fields work 2023-01-19 05:59:16 -10:00
Simon Michael
1c9a44cae9 ;doc: csv: try to clarify how CSV fields and hledger fields work 2023-01-19 05:55:29 -10:00
Simon Michael
bcf6a01c13 ;doc: csv: try to clarify how CSV fields and hledger fields work 2023-01-19 05:48:47 -10:00
Simon Michael
b15d8d214d ;doc: scripts: hledger-utils: show install command, mention hledger-plot 2023-01-14 12:04:54 -10:00
Simon Michael
b42322b166 ;doc: cli: cleanups 2023-01-12 17:54:17 -10:00
Simon Michael
18cf50afe0 ;examples: revert sample.csv, move sample.journal csv output elsewhere 2023-01-11 21:59:10 -10:00
Simon Michael
f63ca1d49e ;dev: stack: bump stackage snapshot, re-enable hledger-web 2023-01-11 21:51:02 -10:00
Simon Michael
dfebf3174c imp: csv: check assigned account names are valid (parseable) (#1978) 2023-01-11 21:42:47 -10:00
Simon Michael
c95c4ca8d6 ;dev: csvtest.sh: note need for 1+ lines above RULES 2023-01-11 21:38:04 -10:00
Simon Michael
8c496b7f06 ;dev: test: number report-interval tests 2023-01-11 20:51:50 -10:00
Simon Michael
93f74f7a0e lib: Hledger.Data.Dates: intervalStartBefore -> intervalBoundaryBefore 2023-01-11 20:51:24 -10:00
Simon Michael
8f9c35200f ;doc: csv: more cleanup 2023-01-11 14:43:27 -10:00
Simon Michael
59e31e5a42 ;doc: csv: more cleanup, CSV rules tips -> Working with CSV 2023-01-11 14:24:53 -10:00
Simon Michael
c7c2229913 ;doc: csv: sync TOC and cheatsheet links 2023-01-11 14:02:54 -10:00
Simon Michael
214cb35e02 ;doc: csv: more cleanup, reorder 2023-01-11 13:53:47 -10:00
Simon Michael
43466dbe03 ;doc: ui: mention shift-up/down config needed for Terminal.app 2023-01-11 13:39:06 -10:00
Simon Michael
545fd2d083 ;doc: csv: fix wrong if tables doc; rewrite several sections (#1977) 2023-01-11 13:25:17 -10:00
Simon Michael
fc8fe8ee46 ;doc: update manuals 2023-01-10 23:34:47 -10:00
Simon Michael
dbb1441402 ;doc: update CLI usage texts 2023-01-10 23:34:14 -10:00
Simon Michael
a7bb6dc5b5 fix: stats: remove wrong mention of output format in help 2023-01-10 23:30:15 -10:00
Simon Michael
e891eecb8b dev: add TypeOperators pragma to satisfy ghc 9.4 2023-01-10 19:33:31 -10:00
Simon Michael
704b47bb92 dev: make ghc 9.4 and current stackage nightly the default
excluding hledger-web temporarily
2023-01-10 19:04:31 -10:00
Simon Michael
8c6218805e dev: make stack9.2.yaml not the default 2023-01-10 19:03:07 -10:00
Simon Michael
1ea2c41bf7 imp: lib: registerWidthsFromOpts: fix ugly parse error message 2023-01-10 17:07:54 -10:00
Simon Michael
5c289ac92e lib: drop unused widthFromOpts 2023-01-10 17:07:19 -10:00
Yann Büchau
18f264595b ;doc: Add hledger-utils with 'hledger edit' to docs 2023-01-05 09:21:44 -10:00
Simon Michael
069b57561f ;doc: tags: clarify additive, not overriding (#1950) 2023-01-04 22:59:23 -10:00
Simon Michael
550c248088 ;doc: csv: note -in and -out are used together for one posting (#1970) 2023-01-04 22:42:45 -10:00
Simon Michael
ce208dd3d4 ;doc: mention pivoting on a tag with multiple values (#1950) 2023-01-04 21:59:21 -10:00
Simon Michael
af9f8c0416 ;doc: add: payees/descriptions completion 2023-01-04 19:58:05 -10:00
Simon Michael
e6a96dba59 dev: fix broken yearless tests 2023-01-04 19:55:58 -10:00
Simon Michael
b5ed655b49 imp: add: Description completions now include payees declared or used
Ie as well as full descriptions, it now also offers payee names which
have been declared with a payee directive, or recorded in transactions
with the | syntax.
2023-01-04 19:46:06 -10:00
Simon Michael
77ff2fcc5a ;examples: make sample.csv correspond to sample.journal 2023-01-04 18:43:18 -10:00
Simon Michael
2983b4971f ;doc: csv: clarify amount-in/amount-out docs (#1970) 2023-01-04 08:01:54 -10:00
Simon Michael
d157192462 ;doc: CREDITS: link to github contributors list 2022-12-31 07:40:33 -10:00
Simon Michael
bfe12c33de ;doc: cli: balance: fix link to Budgeting page 2022-12-30 10:05:50 -10:00
Robert Nielsen
4d8337513b ;doc: Update hledger.m4.md
Updated section on pivoting. Used synonyms for "member" in cases where there could be confusion with the tag named "member."
2022-12-28 12:00:52 -10:00
Simon Michael
177b6057ba ;dev: ledger compat test tweaks 2022-12-27 13:15:46 -10:00
Simon Michael
b945147246 ;doc: journal: directives tweak 2022-12-27 13:13:10 -10:00
Simon Michael
19821ee0e9 ;doc: csv: clarify skip/valid csv semantics (#1967) 2022-12-27 13:08:58 -10:00
Simon Michael
7df44fc199 ;fix: doc: clarify valid CSV requirements and issues (fix #1966) 2022-12-27 12:57:19 -10:00
Simon Michael
a9b63bb694 fix: csv: skip header lines before attempting to parse records (#1967) 2022-12-27 12:21:20 -10:00
Simon Michael
71bd102b4b fix: journal: don't generate bad assertion when assigning with cost (fix #1965) 2022-12-26 10:21:44 -10:00
Simon Michael
0f2fe39e43 cabal: update cabal files 2022-12-22 20:32:03 -10:00
Simon Michael
d0eaa8cf5a dev: force megaparsec 9.3 in stack build plans where supported
For the useful dbg tool.
2022-12-22 20:31:47 -10:00
Simon Michael
4b36d852b4 imp: journal: ignore ((valuation expressions)) after amounts (ledger compat) 2022-12-22 20:06:28 -10:00
Simon Michael
3b91a8475a cabal: update cabal files 2022-12-22 19:26:16 -10:00
Simon Michael
e9e8f350f2 dev: require megaparsec 9.3+ in dev build, for its useful dbg tool
The 9.3 version works with our parsers.
2022-12-22 19:25:57 -10:00
Simon Michael
3b8bec7522 dev: make; comment out unused breakpoint plugin 2022-12-22 19:07:40 -10:00
Simon Michael
1ea2bcc83f imp: journal: also parse (lot notes) in amounts (ledger compat)
and rename lotpricep -> lotcostp
and instrument some amount parsers for debugging with megaparsec's dbg
2022-12-22 19:07:40 -10:00
Simon Michael
aa54c3273a dev: lib: clarify some amount parsers; describe Ledger lot notation
amountpwithmultiplier -> amountp'
amountpnolotpricesp   -> amountnobasisp
amountwithoutpricep   -> simpleamountp
priceamountp          -> costp
2022-12-22 09:15:43 -10:00
Simon Michael
04d5813a41 dev: ci: exclude the excluded func tests in CI too 2022-12-22 09:15:43 -10:00
Simon Michael
b1e08ffe46 imp: journal: python directive also consumes empty lines (ledger compat) 2022-12-22 02:30:29 -10:00
Simon Michael
23d25c8403 dev: ledger-compat tests: cleanups 2022-12-22 02:13:08 -10:00
Simon Michael
e2ddf1e685 imp: add "since" as a synonym of "from" in period expressions (ledger compat) 2022-12-22 02:12:25 -10:00
Simon Michael
85e9fbcf7d imp: journal: allow an empty double-quoted commodity symbol
"" is equivalent to writing no symbol.
But it's now possible to declare market prices for the no-symbol
commodity, which occurs eg with timedot data.

P 2022-01-01 "" $100
2022-12-22 01:53:06 -10:00
Simon Michael
a070875fe6 imp: journal: ignore end apply year, end apply tag, drop "pop" (ledger compat) 2022-12-22 01:50:27 -10:00
Simon Michael
a5d6b42322 imp: journal: ignore end apply fixed, end apply tag directives (ledger compat) 2022-12-22 01:12:56 -10:00
Simon Michael
af5645ebb7 imp: journal: ignore python, eval directives (ledger compat) 2022-12-22 00:50:43 -10:00
Simon Michael
2e77586d1b imp: journal: ignore value directives (ledger compat) 2022-12-22 00:38:51 -10:00
Simon Michael
fb7134c9a0 imp: journal: ignore tag subdirectives (ledger compat) 2022-12-22 00:34:33 -10:00
Simon Michael
c58b9e6ac9 imp: journal: accept apply year as another synonym for Y (ledger compat) 2022-12-22 00:27:35 -10:00
Simon Michael
2357a7a750 dev: journal: ignore CLI flags in journal 2022-12-21 23:40:43 -10:00
Simon Michael
aa5323e6ed dev: journal: update ledger-unsupported, directives tests 2022-12-21 23:20:02 -10:00
Simon Michael
9bac3950af dev: make functest: exclude failing ledger compat tests 2022-12-21 23:09:00 -10:00
Simon Michael
abd104ccee imp: journal: ignore more ledger directives (ledger compat)
apply fixed, apply tag, assert, bucket, A, capture, check, define, expr

And reorder the directivep parsers.
2022-12-21 23:04:58 -10:00
Simon Michael
e09ab0936a imp: journal: accept @ as a prefix of directives (ledger compat) 2022-12-21 22:56:32 -10:00
Simon Michael
95d7679f6d imp: journal: accept year as a synonym for Y (ledger compat) 2022-12-21 22:27:08 -10:00
Simon Michael
826a7cfb2a imp: journal: ignore payee subdirectives 2022-12-21 22:09:15 -10:00
Simon Michael
bf6a2a7ccf imp: journal: ignore commodity subdirectives other than format 2022-12-21 22:08:54 -10:00
Simon Michael
a454b47ad9 ;dev: journal: better account subdirectives test 2022-12-21 22:01:40 -10:00
Simon Michael
befded96d2 ;dev: journal: test all h/ledger syntax by status: main, other, unsupported 2022-12-21 17:12:33 -10:00
Simon Michael
03d0799f2f ;doc: CREDITS: update for 2021q4/2022 2022-12-21 15:07:42 -10:00
Simon Michael
9149a9b0f3 ;doc: cli: cheatsheet: tweaks 2022-12-21 14:35:35 -10:00
Simon Michael
d3b99e9c95 ;doc: cli: cheatsheet: directives cleanup 2022-12-21 09:05:56 -10:00
Simon Michael
1003cdb142 ;doc: cli: cheatsheet: directives cleanup 2022-12-21 08:56:12 -10:00
Simon Michael
d97259b275 ;doc: cli: split journal syntax into "main" and "other"
This comes from a review of journal syntax, in preparation for
supporting more Ledger syntax.

To reduce overload for learners, I have trimmed the "main" feature
list, and de-emphasised a number of my not-so-favourite features by
moving them under "Other syntax", with downsides noted for good
measure. Secondary dates, balance assignments, and auto postings
are some of the de-emphasised features.
2022-12-21 08:11:08 -10:00
Simon Michael
704d52cfeb ;doc: cli: add a cheatsheet showing all the main journal syntax
This comes from a review of journal syntax, in preparation for
supporting more Ledger syntax. I think these are the most important
syntax features to teach. See next commit for a corresponding cleanup
of the docs.
2022-12-21 08:11:03 -10:00
Simon Michael
a65e601bcd ;dev: ledger compat tests: README 2022-12-18 12:25:52 -10:00
Simon Michael
c3e17db23e ;dev: ledger compat tests: improve org outline navigability
fixup:
2022-12-18 12:25:47 -10:00
Simon Michael
15646ab999 ;dev: convert ledger compat tests to individual shell tests
Also comment ledger's tests more robustly,
and log as an org outline.
2022-12-18 11:50:15 -10:00
Simon Michael
7195cebbb0 ;dev: cli: ledger-compat: ignore tests expecting failure 2022-12-18 08:32:27 -10:00
Simon Michael
b20c3e1036 ;doc: cli: add a BC anchor for #transaction-prices 2022-12-18 07:54:08 -10:00
Simon Michael
ccb553197f ;dev: cli: ledger tests: replace runner with shelltest 2022-12-18 01:33:38 -10:00
Simon Michael
688c56aa90 ;dev: cli: ledger tests: runner improvements 2022-12-18 01:33:10 -10:00
Simon Michael
470e906e97 ;dev: cli: ledger tests: summary, failures 2022-12-18 01:33:10 -10:00
Simon Michael
1b56687708 ;dev: cli: ledger tests: move test runner up, start collected tests 2022-12-18 01:33:10 -10:00
Simon Michael
370948a357 ;dev: cli: ledger tests: add a test runner 2022-12-18 01:33:10 -10:00
Simon Michael
5cc0080776 ;dev: cli: ledger tests: snapshot of ledger regress tests' data 2022-12-18 01:33:10 -10:00
Simon Michael
caffb22320 ;dev: cli: a snapshot of ledger's baseline functional tests' data
;dev: cli: ledger tests: comment out all but the sample data
2022-12-18 01:33:04 -10:00
Simon Michael
faa5f00f1a ;doc: cli: more guidance on comments 2022-12-17 07:53:58 -10:00
Simon Michael
40df381cb2 ;doc: cli: better directives quick link 2022-12-17 07:23:38 -10:00
Simon Michael
ae87b1efd5 fix: web: add form's typeahead now shows non-ascii text correctly (#1961)
(Fix contributed by Arsen Arsenović)
2022-12-16 12:48:42 -10:00
Simon Michael
331b419c97 ;doc: cli: improve Directives summaries 2022-12-16 12:48:42 -10:00
Simon Michael
9004372e3c ;doc: fix pandoc rendering issue caused by blank line in m4 file 2022-12-14 21:37:57 -10:00
Simon Michael
1ac5c0b03e ;doc: web: fix typo in macro 2022-12-14 21:26:23 -10:00
Simon Michael
f6c865bbab ;doc: cli: introduction improvements 2022-12-14 12:23:44 -10:00
Simon Michael
43023d3d86 ;doc: some changes to hledger and input files description macros 2022-12-14 12:23:10 -10:00
Simon Michael
5a8e63d24d ;fix: bal: add missing --layout=tidy to help 2022-12-14 12:21:35 -10:00
Simon Michael
e819e02372 ;doc: bal: more balance doc cleanups 2022-12-14 09:03:55 -10:00
Simon Michael
36a20b7dfd ;doc: update manuals 2022-12-14 07:53:09 -10:00
Simon Michael
cf607adfcf ;doc: update CLI usage texts 2022-12-14 07:53:03 -10:00
Simon Michael
2ba91b1195 ;doc: bal: clean up/reorder balance command doc 2022-12-14 07:52:53 -10:00
Simon Michael
2902769616 ;doc: cli, bal: cleanups 2022-12-14 06:36:28 -10:00
Simon Michael
919c6c1a57 ;doc: cli: fix duplicate market prices heading breaking info navigation 2022-12-14 06:36:04 -10:00
Simon Michael
7d4cdb4333 ;doc: cli: why are we shouting ? we don't need to shout so much 2022-12-14 06:08:06 -10:00
Simon Michael
16b7b924e0 ;dev: make man-watch 2022-12-14 05:55:44 -10:00
Simon Michael
64d29a3e68 doc: cli: document --infer-market-prices with signed costs (#1870) 2022-12-13 21:09:00 -10:00
Simon Michael
ea85faf0f0 dev: tests demonstrating signed costs and market price inference (#1870) 2022-12-13 20:56:51 -10:00
Simon Michael
e9064ac4d2 ;doc: cli: move file formats up for better sequencing
CONCEPTS -> REPORTING CONCEPTS
COST -> COST REPORTING
2022-12-13 06:34:17 -10:00
Simon Michael
96bbe4b24e ;doc: cli: cost tweaks 2022-12-13 05:46:30 -10:00
Simon Michael
260cfe4637 ;doc: cli: more mention of posting order effect on inferring cost (#1959) 2022-12-13 05:37:44 -10:00
Simon Michael
824aa77d49 ;doc: cli: reassurance 2022-12-11 15:49:35 -10:00
Simon Michael
600e263a9a ;doc: cli, ui, web: consistent boilerplate 2022-12-11 15:44:09 -10:00
Simon Michael
e07d290338 ;dev: tools: cleanup 2022-12-11 15:31:40 -10:00
Simon Michael
abab1a23e3 ;doc: cli, ui, web: fix some links 2022-12-11 15:22:46 -10:00
Simon Michael
de26e6b855 ;doc: cli: fix commands quick linke 2022-12-11 13:31:59 -10:00
Simon Michael
56d7b5f808 ;doc: cli: cleanup 2022-12-11 13:23:56 -10:00
Simon Michael
cf2c794c6e ;dev: tools/ciwatch: succeed if no runs are in progress 2022-12-11 13:07:20 -10:00
Simon Michael
c0b63c14e9 ;dev: tools/push improvements 2022-12-11 13:07:08 -10:00
Simon Michael
c50df8bee8 ;dev: tools/ciwatch fix 2022-12-11 13:00:53 -10:00
Simon Michael
b49968ee32 ;dev: extract tools/push 2022-12-11 11:49:27 -10:00
Simon Michael
76165f962d ;dev: tools/pushdocs 2022-12-11 11:04:25 -10:00
Simon Michael
4bd4f69c7e dev: tools/ciwatch 2022-12-11 11:04:10 -10:00
Simon Michael
87e372e38d ;doc: cli: update market price inference docs per sol 2022-12-11 09:52:17 -10:00
Simon Michael
c5b6b74a53 ;doc: cli: csv cleanups 2022-12-11 03:04:25 -10:00
Simon Michael
89d5f973f4 ;doc: cli: csv cleanups 2022-12-11 02:46:32 -10:00
Simon Michael
38f792677d ;doc: cli: move sections 2022-12-11 02:31:15 -10:00
Simon Michael
cb67c6b990 ;doc: cli: move budgeting, forecasting to CONCEPTS 2022-12-11 02:29:03 -10:00
Simon Michael
434d3b6ec4 ;doc: cli: flatten, clean up CSV sections 2022-12-11 02:15:03 -10:00
Simon Michael
985c15f039 ;doc: cli: clean up/rename directives sections 2022-12-11 01:59:26 -10:00
Simon Michael
fc5d1414f9 ;doc: cli: fix comment links, drop old doc 2022-12-11 01:24:10 -10:00
Simon Michael
a06b6219d5 ;doc: cli: fix link 2022-12-10 22:05:15 -10:00
Simon Michael
d2f154d966 ;doc: cli: other cost notation updates 2022-12-10 22:00:45 -10:00
Simon Michael
42659146af ;doc: cli: Beancount cost notation docs, improvements 2022-12-10 21:44:06 -10:00
Simon Michael
f0d2ec793c ;doc: cli: move stuff, split up journal comment docs 2022-12-10 20:20:22 -10:00
Simon Michael
52bb52712f ;doc: cli: new Ledger cost notation docs 2022-12-10 19:53:49 -10:00
Simon Michael
b73916323a ;dev: note transaction price deprecation in haddock 2022-12-10 19:01:48 -10:00
Simon Michael
ace185f7d2 ;doc: update old manual links 2022-12-10 18:56:47 -10:00
Simon Michael
474ad22b94 ;doc: officially rename "transaction prices" to "costs" in docs
(though not in code)
2022-12-10 18:50:45 -10:00
Simon Michael
6310df590d ;doc: cli: fix typo 2022-12-10 15:42:58 -10:00
Simon Michael
20b17a9108 ;doc: cli: move a few more things around 2022-12-10 15:29:30 -10:00
Simon Michael
dabcee45f1 ;doc: cli: intro/input/output cleanup 2022-12-10 14:23:59 -10:00
Simon Michael
cd0eb0fe91 ;doc: cli: more standard man page start, more useful first info page
And NAME and SYNOPSIS are now included in the web manuals, that's ok.
2022-12-10 12:17:22 -10:00
Simon Michael
8dfaf259d5 ;doc: update man pages template 2022-12-10 11:45:28 -10:00
Simon Michael
83e6cb615f ;doc: chunk hledger manual into parts, discuss formats before commands 2022-12-10 11:31:53 -10:00
Simon Michael
3698f8cf90 fix: balcmds: the table layout in HTML output with --layout=bare 2022-12-10 10:22:26 -10:00
Simon Michael
016b7759f4 ;doc: virtual postings: improve wording
per Robert Nielsen
2022-12-09 09:14:05 -10:00
Simon Michael
c4165c9a73 ;doc: cost: fix transaction prices link 2022-12-09 08:06:11 -10:00
Simon Michael
2eadd2497b ;doc: codes: improve example
suggested by Rob Nielsen
2022-12-09 07:57:10 -10:00
Simon Michael
4991135a10 ;doc: CONTRIBUTING: tweaks 2022-12-09 07:46:31 -10:00
Simon Michael
53ed194a12 ;doc: ISSUES etc: drop "topics", call them labels 2022-12-09 07:40:34 -10:00
Simon Michael
b609ba30ab ;doc: CONTRIBUTING: cleanups 2022-12-09 06:21:04 -10:00
Simon Michael
3f6ecd4b07 ;doc: FILES: tweak 2022-12-08 22:46:27 -10:00
Simon Michael
7bfdc2d67f ;doc: cli: move PIVOTING up, update 2022-12-08 20:42:27 -10:00
Simon Michael
4325102d2f ;doc: move some CONTRIBUTING content to faq 2022-12-08 20:14:38 -10:00
Simon Michael
b50d60cfea ;doc: csv, timeclock, timedot: clarify comment lines (#1953) 2022-12-06 10:38:50 -10:00
Simon Michael
b81e358163 ;doc: comments, tags: move down, improve sequencing 2022-12-06 10:10:49 -10:00
Simon Michael
b14f68d4d8 ;doc: tags: mention querying 2022-12-06 09:28:13 -10:00
Simon Michael
020f1d446c ;doc: tags: more updates, fixes 2022-12-06 09:07:27 -10:00
Simon Michael
e72350ae75 ;doc: tags: discuss multi-values/overriding (#1950) 2022-12-06 08:15:06 -10:00
Simon Michael
5e4e69f390 ;dev: make site-watch: fix runaway recursion, be more verbose 2022-12-06 07:10:39 -10:00
Simon Michael
99e8eb9a53 ;doc: tags: fix/clarify 2022-12-06 07:10:23 -10:00
Simon Michael
ecbfcd0e0d ;doc: FILES: updates 2022-12-05 09:50:07 -10:00
Simon Michael
6137f7003d ;doc: FILES: redo with gtree, add more 2022-12-05 09:35:37 -10:00
Simon Michael
688e392ce9 tools: gtree enhancement 2022-12-05 06:50:44 -10:00
Simon Michael
ad889065af tools: gtree 2022-12-04 17:47:48 -08:00
Simon Michael
934f0e3cd6 ;doc: REPOS, FILES 2022-12-04 12:16:53 -08:00
Simon Michael
5dee1fe78c ;doc: move most dev docs to doc/ 2022-12-04 11:22:05 -08:00
Simon Michael
e74854e5ef ;dev: stack9.4: update to latest snapshot 2022-12-04 05:21:07 -08:00
Simon Michael
952bd3d5d6 ;doc: Contributor Guide -> Contributor Quick Start, LINKS, ISSUES 2022-12-04 05:18:30 -08:00
Simon Michael
68a912286b ;doc: RELEASING updates 2022-12-01 13:12:06 -08:00
Simon Michael
a06fb83ba1 ;doc: mastodon, twitter announcement texts 2022-12-01 13:10:02 -08:00
Simon Michael
b627f020d1 ;doc: announce: tweak 2022-12-01 12:43:23 -08:00
Simon Michael
f3b0a1f513 ;doc: update manuals 2022-12-01 12:24:23 -08:00
Simon Michael
a5b4d80e24 ;doc: update CLI usage texts 2022-12-01 12:24:12 -08:00
Simon Michael
8da21f1195 ;cabal: update cabal files 2022-12-01 12:23:10 -08:00
Simon Michael
740ea50e4c ;pkg: bump version to 1.28.99 2022-12-01 12:23:10 -08:00
Simon Michael
cbbfb82474 doc: 1.28 changelog headings 2022-12-01 12:21:09 -08:00
Simon Michael
93a871c90d doc: announce 1.28 2022-12-01 12:20:47 -08:00
Simon Michael
fa8f6ae302 lib: Debug: breakpoint doesn't support windows yet, drop for now 2022-12-01 12:20:29 -08:00
Simon Michael
8fddc1e528 dev: tools/release: update for new "github" remote name 2022-12-01 12:20:27 -08:00
Simon Michael
dedb331845 imp: --version strings no longer show + for dirty repos as it's buggy 2022-12-01 12:20:23 -08:00
Simon Michael
a929f8ec8a dev: Cli: cleanup 2022-12-01 12:20:19 -08:00
root
e3ae1916f1 dev: make site: update 2022-12-01 11:53:30 -08:00
Simon Michael
5733b24cf4 imp: install: 1.28 2022-11-30 19:31:50 -05:00
Simon Michael
d76e47b586 ;doc: update changelogs 2022-11-30 17:13:09 -05:00
Simon Michael
f4831533b8 examples: Indian National Pension Service CSV rules (Pranesh Prakash)
slightly tweaked by SM
2022-11-30 16:51:38 -05:00
Felix Yan
66b51472f2 Allow megaparsec 9.3
Builds fine and all tests pass.
2022-11-30 05:12:04 -05:00
Patrick Fiaux
b3de7e59af fix: cli: updates hledger-git record command to use plain git
This fixes the issue in https://github.com/simonmichael/hledger/issues/1942.
Instead of relying on a `git record` alias being present `hledger git record`
uses only vanilla git.

The expected alias for record is:
```
record = ! sh -c '(git add -p -- $@ && git commit) || git reset' --
```

The removed `git record` is in the script is implemented using:
- `git commit` with the given messages (and additional arguments if given)
- `git reset` if the commit fails

`git add -p` isn't needed because the files are added already above. Also
this would be interactive which isn't the goal for this call.

The message still defaults to the date if not given, however I had to add
a check to only shift if arguments were passed in, otherwise shift fails.
2022-11-26 08:51:00 -05:00
Simon Michael
74f9cd866c dev: ui: commit missing change for brick 1.5 2022-11-26 08:50:28 -05:00
Simon Michael
5283c280bf ;cabal: update cabal files 2022-11-26 00:13:02 -05:00
Simon Michael
7bba7e79af dev: ui: support/require brick 1.5, as in latest stackage nightly 2022-11-26 00:12:28 -05:00
Simon Michael
3a6955d3e2 dev: add stack9.4.yaml for building with latest nightly/ghc 9.4.3 2022-11-25 23:45:17 -05:00
Simon Michael
ba773e3fe9 dev: bump to stackage lts-20.1 2022-11-25 23:44:46 -05:00
Simon Michael
d5682aa644 imp: print: --match now respects -o and -O 2022-11-24 19:50:47 -05:00
Simon Michael
4399076a0a ;doc: lib: update BalanceAssertion doc 2022-11-10 19:01:53 -10:00
Simon Michael
fc8c85931c bin: move: improve help 2022-11-10 19:01:41 -10:00
root
1591939074 ;doc: queries: fix formatting 2022-11-09 09:10:50 -10:00
Simon Michael
b67cb97fff ;doc: print: mention "fuzzy" for discoverability 2022-11-09 09:06:38 -10:00
Simon Michael
7997007dcf imp: print: a failed --match now returns a non-zero exit code 2022-11-09 08:56:48 -10:00
Simon Michael
e8302b0964 ;doc: cli: note the tricks for boolean queries 2022-11-09 08:27:17 -10:00
Simon Michael
0b9c01253b imp: ui: simplify screen names on menu screen 2022-11-08 12:39:20 -10:00
Simon Michael
a7620f3102 ;doc: ui, web: show smaller screenshot thumbnails 2022-11-08 11:55:09 -10:00
Simon Michael
c03bb48972 ;dev: make site-watch: convert to watchexec 2022-11-08 11:48:27 -10:00
Simon Michael
3724e77dad ;doc: ui: updates 2022-11-08 11:48:12 -10:00
Simon Michael
4a1d900c51 ;doc: update manuals 2022-11-07 17:04:05 -10:00
Simon Michael
1f385ae774 ;doc: ui: update navigation, clarify balances/changes 2022-11-07 17:03:48 -10:00
Simon Michael
a485a5ebe7 imp: ui: ENTER key is equivalent to RIGHT for navigation 2022-11-07 17:03:06 -10:00
Simon Michael
892eb06396 ;dev: ui: replace "curses interface" with TUI 2022-11-07 16:48:54 -10:00
Simon Michael
b36c35d477 ;dev: makefile comment 2022-11-07 16:37:00 -10:00
Simon Michael
479ef69d3f dev: ui: convert tests to markdown, update 2022-11-07 16:36:26 -10:00
Simon Michael
6e5c30ea1a ;doc: update manuals 2022-11-07 16:18:28 -10:00
Simon Michael
82aa8f1975 imp: ui: bs/is screens: clarify balance/changes in header/footer 2022-11-07 16:10:56 -10:00
Simon Michael
a726be0e28 imp: ui: add flags to select starting screen 2022-11-07 16:04:39 -10:00
Simon Michael
1a526b82c9 imp: ui: debug log startup args, debug level, initial screen stack 2022-11-07 14:52:42 -10:00
Simon Michael
da569e51e1 imp: ui: improve debug logging helpers, log screen stack on each event 2022-11-07 14:51:45 -10:00
Simon Michael
6d2687e67d fix: debug logging: fix non-logging ptrace*IO, dbg*IO 2022-11-07 14:50:13 -10:00
Simon Michael
05aeedf6c9 imp: ui: start on all accts scrn if no bs accts detected, or with an acct query 2022-11-07 09:42:21 -10:00
Simon Michael
1de60dd0c2 ;doc: update manuals 2022-11-06 09:39:22 -10:00
Simon Michael
b0966adc93 dev: debug logging: ".log" suffix instead of ",logging"; improve docs 2022-11-06 09:01:12 -10:00
Simon Michael
78771e900b dev: lib: support debug logging to file in a few more places for hledger-ui 2022-11-06 09:01:12 -10:00
Simon Michael
9a8a8a75a2 imp: ui: start on balance sheet screen: better initial screen stack 2022-11-06 07:59:45 -10:00
Simon Michael
06bc09a36f dev: comments 2022-11-06 07:59:45 -10:00
Simon Michael
4a35945a8f imp: ui: start on balance sheet accounts screen 2022-11-04 23:16:40 -10:00
Simon Michael
b079bbdb4e dev: lib: Hledger.Utils cleanup 2022-11-04 22:19:24 -10:00
Simon Michael
79047ccc43 dev: lib: consolidate some utils in Hledger.Utils.IO 2022-11-04 19:14:36 -10:00
Simon Michael
fc8aa5253a dev: lib: Hledger.Utils.Print -> Hledger.Utils.IO 2022-11-04 18:39:31 -10:00
Simon Michael
6fcd85aac3 dev: lib: Hledger.Utils cleanup, explicit exports 2022-11-04 12:59:10 -10:00
Simon Michael
7c8e241383 dev: make hoogle-setup, hoogle-serve: run a local hoogle 2022-11-04 10:45:57 -10:00
Simon Michael
80249c3e8a dev: lib: Utils cleanups 2022-11-04 09:51:25 -10:00
Simon Michael
5bc977442a dev: lib: remove NOINLINE pragmas HLS doesn't complain about 2022-11-03 17:58:32 -10:00
Simon Michael
0608a76243 dev: lib: extract progArgs, minimise unsafe IO
It is exported from the increasingly-inaccurately-named
Hledger.Utils.Print for now.
2022-11-03 17:58:13 -10:00
Simon Michael
32d7cb5287 doc: ui, web: mention debug output 2022-11-03 17:16:55 -10:00
Simon Michael
cc1ea894aa doc: ui: watch mode cleanup 2022-11-03 17:11:55 -10:00
Simon Michael
80eb461063 ;doc: update manuals 2022-11-03 16:07:55 -10:00
Simon Michael
14c31cc23d ;cabal: update cabal files 2022-11-03 16:07:55 -10:00
Simon Michael
988c164ec8 imp: debug logging improvements; hledger-ui logs to hledger-ui.log only
Hledger.Utils.Debug's "trace or log" functions are now controlled as
follows: to enable logging, append ",logging" to the program name at
startup (using withProgName). This also works when running in GHCI.
And they log to PROGNAME.log, not debug.log.

All (hopefully) debug logging in the hledger packages is now "trace or
log" capable.

This means that hledger-ui should now log all debug output to
./hledger-ui.log, with none of it appearing on the console.
2022-11-03 16:07:54 -10:00
Simon Michael
c25c5cef44 fix: make no-argument --debug flag work with ui & web also 2022-11-03 08:13:58 -10:00
Simon Michael
0bb83b5620 doc: cli: new "Debug output" section 2022-11-03 08:13:13 -10:00
Simon Michael
55dadce479 doc: cli: rename DATA FILES to INPUT, move OUTPUT below it 2022-11-03 08:13:13 -10:00
Simon Michael
a996078253 doc: cli: expand --debug help 2022-11-03 08:13:13 -10:00
Simon Michael
d95786d2f2 doc: web: clarify the run modes 2022-11-03 08:10:45 -10:00
Simon Michael
90a1b7ad20 dev: make man-watch-PROG 2022-11-03 08:10:45 -10:00
Simon Michael
25003d36e1 dev: bump minimum githash version to 0.1.6.2 2022-11-03 08:10:45 -10:00
Simon Michael
6504748b4f ;doc: ui: changelog 2022-10-31 13:36:34 -10:00
Simon Michael
3d26fc30eb ;doc: update changelogs 2022-10-31 13:18:36 -10:00
Simon Michael
9a9ebfc0e3 dev: ui: rename hledger-ui debug helpers 2022-10-31 12:42:09 -10:00
Simon Michael
603fae70c0 dev: lib: clean up/simplify debug helpers 2022-10-31 11:26:11 -10:00
Simon Michael
fbd2ed5a44 ;cabal: update cabal files 2022-10-29 13:04:58 -10:00
Simon Michael
ddb3ea777e imp: lib: move hledger-specific things out of Hledger.Utils.Debug
Moved from Hledger.Utils.Debug to Hledger.Utils.Parse:
traceParse
traceParseAt
dbgparse
2022-10-29 13:04:47 -10:00
Simon Michael
fd82fa48c9 imp: lib: separate Hledger.Utils.Print
Moved from Hledger.Utils.Debug to Hledger.Utils.Print:
pshow
pshow'
pprint
pprint'
colorOption
useColorOnStdout
useColorOnStderr
outputFileOption
hasOutputFile
2022-10-29 12:39:46 -10:00
Simon Michael
3a0473b5b4 fix: ui: fix regenerateScreens, it was not updating the journal
And add to test suite. Fixes unreleased code.
2022-10-28 23:03:12 -10:00
Simon Michael
778b660919 dev: ui: debug logging improvements, export screenRegisterDescriptions 2022-10-28 22:44:47 -10:00
Simon Michael
d948198303 dev: ui: cleanup 2022-10-28 17:16:45 -10:00
Simon Michael
52d7f99360 fix: ui: fix internal screen state when using --register
This seems not to have been user-visible.
2022-10-28 16:52:45 -10:00
Simon Michael
21c00f9ba2 imp: ui: improve --debug=2 debug.log logging 2022-10-28 16:51:55 -10:00
Simon Michael
020dec10a7 dev: ui: debug logging helpers
Hledger.UI.UIUtils
added:
dlogUiTraceIO
dlogUiScreenStack
mapScreens
screenId
2022-10-28 16:50:01 -10:00
Simon Michael
a6cc98521d feat: bin: watchaccounts 2022-10-27 11:24:45 -10:00
Simon Michael
d5fa141176 ;doc: update CLI usage texts 2022-10-08 13:18:29 -10:00
Simon Michael
ca5847fc08 imp: accounts: clarify flag help; prioritise flags in order of help 2022-10-08 13:18:29 -10:00
Simon Michael
4ecc57461a imp: accounts: -u, -d 2022-10-08 08:22:10 -10:00
Simon Michael
b16a02b2e6 imp: accounts: --unused 2022-10-08 08:16:07 -10:00
Simon Michael
25c9083d0d ;bin: move: docs fix 2022-10-07 14:45:44 -10:00
Simon Michael
8f06cefab4 bin: hledger-move, helps make subaccount/cost-preserving transfers 2022-10-07 14:28:04 -10:00
Simon Michael
7fd25809e8 dev: fix customErrorBundlePretty import warnings 2022-10-07 07:43:28 -10:00
Simon Michael
5c0baef9ae bin: hledger-addon-example: help text tips 2022-10-07 06:34:34 -10:00
Simon Michael
a759a6e02e dev: lib: note changed cost handling in amount arithmetic 2022-10-07 06:34:34 -10:00
Simon Michael
3a4f23df95 imp: lib: Hledger.Data.Amount: showMixedAmountOneLine now shows costs 2022-10-07 06:34:34 -10:00
Simon Michael
de5a97600c imp: lib: Hledger.Read.Common: rename/add amount parsing helpers
removed:
 amountp'
 mamountp'

added:
 parseamount
 parseamount'
 parsemixedamount
 parsemixedamount'
2022-10-07 06:34:34 -10:00
Simon Michael
82a503cbf5 imp: lib: Hledger.Utils.Parse: export customErrorBundlePretty
for pretty-printing hledger parse errors.
2022-10-07 06:34:34 -10:00
Simon Michael
33dba1945d dev: lib: Text.Megaparsec.Custom notes 2022-10-07 06:34:34 -10:00
Simon Michael
de7d0a38a2 ;doc: csv: clarify newest-first 2022-10-06 23:16:44 -10:00
Simon Michael
01387548e7 feat: csv: intra-day-reversed compensates when days' txns are reversed
As in eg vanguard CSV.
2022-10-06 22:21:55 -10:00
Simon Michael
360ef833ae ;doc: update CLI usage texts 2022-10-05 08:42:09 -10:00
Simon Michael
3e42851958 feat: accounts: add --undeclared and --find flags 2022-10-05 08:41:37 -10:00
Simon Michael
15b2e7d586 fix: csv: ignore extra whitespace in account rule when detecting virtual postings
Reported by CruxOfTheB in chat.
2022-10-03 07:50:23 -10:00
Simon Michael
c0c14e53f1 ;doc: csv: fix timezone example 2022-10-01 17:09:52 -10:00
Simon Michael
928cc6d615 ;doc: update manuals 2022-10-01 16:09:26 -10:00
Simon Michael
ae8d297396 ;doc: update CLI usage texts 2022-10-01 16:09:16 -10:00
Simon Michael
3b24d9465b imp: csv: new timezone rule; convert zoned date-times to local dates (#1936)
Previously, CSV date-times with a different time zone from yours
(with or without explicit timezones in the CSV) could give off-by-one
dates, because the CSV timezone was ignored.

Now,

1. you can use the `timezone` rule to indicate which other
   timezone a CSV is implicitly using

2. CSV date-times with a timezone - whether declared by rule or
   parsed with %Z - are localised to the system time zone
   (or another set with the TZ environment variable).
2022-10-01 14:50:35 -10:00
Simon Michael
7d1b1cadce fix: add: doc: update tutorial link 2022-09-27 13:40:40 -10:00
Simon Michael
130604a2e0 ;cabal: update cabal files; migrate to hpack 0.35/stack 2.9 2022-09-19 18:23:26 -10:00
Simon Michael
45ee5d125d imp: ui: support/require fsnotify 0.4.x 2022-09-19 18:18:50 -10:00
Simon Michael
f0b16f22a2 doc: RELEASING, CHANGELOGS 2022-09-18 10:03:44 -10:00
Simon Michael
a3c2e2c1ba doc: changelogs 2022-09-18 10:02:25 -10:00
Simon Michael
e7c8825984 install: 1.27.1 2022-09-18 08:51:30 -10:00
Simon Michael
a2be9a0bce ;doc: update changelogs 2022-09-18 08:28:03 -10:00
Simon Michael
65019f72b4 dev: cli: tests: fix fragile abbreviation 2022-09-14 17:27:55 -10:00
Simon Michael
d4a1718690 fix: balcmds: fix empty html columns fix (#1933) 2022-09-14 17:25:18 -10:00
Simon Michael
0a501941ee dev: lib: ReportTypes: hlint fix 2022-09-14 16:57:54 -10:00
Simon Michael
b9d2aa7b54 fix: balcmds: handle an empty totals column in html output (#1933) 2022-09-14 16:56:28 -10:00
Simon Michael
13f3c3ed64 dev: cli: update balance.test to v3 format 2022-09-14 16:36:10 -10:00
Simon Michael
5094596042 dev: web: start also tracking manual hledger-web tests
related: #1932
2022-09-14 08:30:05 -10:00
Simon Michael
07cb6bdc80 fix: web: add: don't fail when there's no file field (#1932) 2022-09-14 08:16:49 -10:00
Simon Michael
0017281a67 dev: ui: test updates 2022-09-11 14:36:42 -10:00
Simon Michael
e51d4059db feat: ui: add income statement accounts screen 2022-09-11 13:51:40 -10:00
Simon Michael
9fc92cefe4 imp: ui: at --debug 2+, also log events 2022-09-10 12:55:00 -10:00
Simon Michael
68b243e670 dev: ui: menu screen code cleanups 2022-09-10 12:44:27 -10:00
Simon Michael
0ba0a12cc0 dev: ui: add some commented debug logging of state 2022-09-10 12:44:27 -10:00
Simon Michael
96f42380e8 dev: ui: fix an unclear windows-conditional import 2022-09-10 12:44:21 -10:00
Simon Michael
5c14ed2ec9 dev: lib: clarify dlogAt's doc 2022-09-10 12:44:21 -10:00
Simon Michael
6f258b704a dev: ui: bs: reuse account screen's event handler 2022-09-09 16:11:00 -10:00
Simon Michael
3fbef8ab88 dev: ui: asHandle refactor, cleanup 2022-09-09 11:01:49 -10:00
Simon Michael
a3c0716133 dev: ui: as, bs: reuse update, draw code 2022-09-08 13:42:29 -10:00
Simon Michael
a3ea054028 dev: ui: bs: reuse AccountsScreenState 2022-09-08 12:46:02 -10:00
Simon Michael
90703dcd84 dev: ui: ms: cleanups 2022-09-08 12:38:50 -10:00
Simon Michael
93ce75d756 imp: dev builds with uncommitted changes now show + in --version 2022-09-08 12:23:59 -10:00
Simon Michael
fb0053c15f imp: ui: fix a probable bug with detecting date change while running 2022-09-08 12:23:59 -10:00
Simon Michael
b81c2395d5 dev: ui: fix warning 2022-09-08 12:23:59 -10:00
Simon Michael
6737bb3d38 imp: ui: mouse-clicking below the list no longer navigates back
I and mail list think it's too obtrusive, eg sometimes it navigates
when you just want to focus the window.
2022-09-08 12:23:59 -10:00
Simon Michael
975522e759 feat: ui: add balance sheet accounts screen 2022-09-08 12:23:59 -10:00
Simon Michael
75a19e8609 feat: ui: add top-level menu screen 2022-09-08 12:23:59 -10:00
Simon Michael
8f8fc7bf75 dev: ui: re-export new/update functions from screen modules 2022-09-07 14:17:49 -10:00
Simon Michael
a5f4d2fd6e dev: ui: refactor: simpler, more debuggable Screen type
Follow-on from the brick 1.0 migration work (#1889, #1919).

These new types aim to be more restrictive, allowing fewer invalid
states, and easier to inspect and debug. The screen types store only
state, not behaviour (functions), and there is no longer a circular
dependency between UIState and Screen.
2022-09-07 11:56:13 -10:00
Simon Michael
bc810063a5 dev: lib: improve ReportSpec doc 2022-09-07 09:53:11 -10:00
Simon Michael
3e4f5f0417 doc: RELEASING: updates 2022-09-02 11:54:51 -07:00
Simon Michael
38cb53d4f8 doc: RELEASING: updates 2022-09-01 18:51:23 -07:00
Simon Michael
2ef6055516 doc: cli: changelog: fixes 2022-09-01 18:50:04 -07:00
Simon Michael
427005037e cabal: update cabal files 2022-09-01 18:37:57 -07:00
Simon Michael
e5bb4f0b66 ;pkg: bump version to 1.27.99 2022-09-01 18:37:40 -07:00
Simon Michael
8172851572 doc: update github release links 2022-09-01 18:36:51 -07:00
Simon Michael
98abf3cd92 install: 1.27 2022-09-01 18:36:46 -07:00
Simon Michael
6a0235c708 ;doc: announce 2022-09-01 18:36:43 -07:00
Simon Michael
38ce19847b doc: update changelogs 2022-09-01 18:36:39 -07:00
Simon Michael
7631d0efa0 ;doc: update manuals 2022-09-01 18:36:34 -07:00
1360 changed files with 147377 additions and 56279 deletions

13
.ci
View File

@ -1,13 +0,0 @@
[test "website"]
command = ./Shake.hs && ./Shake Clean && ./Shake website
#TODO: update for new site
# trackedFiles = site/_site \
# site/csv.md \
# site/hledger-ui.md \
# site/hledger-web.md \
# site/hledger.md \
# site/journal.md \
# site/manual.md \
# site/timeclock.md \
# site/timedot.md
#

13
.ctags
View File

@ -1,14 +1,9 @@
--exclude=.build --exclude=.*
--exclude=.idea
--exclude=.shake
--exclude=.stack-work
--exclude=.vagrant
--exclude=.vscode
--exclude=_* --exclude=_*
--exclude=bin --exclude=bin
--exclude=doc/irc --exclude=doc/irc
--exclude=doc/profs --exclude=doc/profs
--exclude=dist --exclude=dist*
--exclude=examples --exclude=examples
--exclude=bootstrap* --exclude=bootstrap*
--exclude=excanvas* --exclude=excanvas*
@ -16,6 +11,6 @@
--exclude=jquery* --exclude=jquery*
--exclude=typeahead* --exclude=typeahead*
--exclude=old --exclude=old
--exclude=site/doc --exclude=site/out*
--exclude=site/files --exclude=site/src/1*
--exclude=hledger/test/addons/hledger-* --exclude=hledger/test/addons/hledger-*

13
.ghci
View File

@ -1,7 +1,13 @@
:set prompt "ghci> " :set prompt "ghci> "
import System.Environment
setEnv "NO_COLOR" "1"
-- TEMP
-- :m +*Hledger.Cli.Commands
-- https://github.com/cdepillabout/pretty-simple -- https://github.com/cdepillabout/pretty-simple
:set -package pretty-simple -- If not using a cabal environment file with pretty-simple added, this adds itK here:
:set -interactive-print=Text.Pretty.Simple.pPrint -- :set -package pretty-simple
:set -interactive-print=Text.Pretty.Simple.pPrintNoColor
-- ghci commands to be run once at ghci startup -- ghci commands to be run once at ghci startup
-- http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/ghci-commands.html -- http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/ghci-commands.html
@ -14,6 +20,9 @@
-- -- :reload and run commands in .ghci2 -- -- :reload and run commands in .ghci2
-- :def R \_ -> return ":reload\n:script .ghci2" -- :def R \_ -> return ":reload\n:script .ghci2"
-- Reload (to pick up code changes and flush cached unsafePerformIO values) and run main with the given args
:def! rmain \args -> return $ ":reload\n:main "<>args
-- -- run commands from a file, .ghci2 by default -- -- run commands from a file, .ghci2 by default
-- :def s \f -> readFile $ if null f then ".ghci2" else f -- :def s \f -> readFile $ if null f then ".ghci2" else f

2
.github/FUNDING.yml vendored
View File

@ -2,7 +2,7 @@
github: [simonmichael] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] github: [simonmichael] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
liberapay: simonmichael liberapay: simonmichael
patreon: simonmichael # Replace with a single Patreon username # patreon: simonmichael # Replace with a single Patreon username
open_collective: hledger # Replace with a single Open Collective username open_collective: hledger # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel

View File

@ -1,25 +1,30 @@
--- ---
name: A bug name: A bug
about: Any problem that seems to be an error or weakness in hledger's software, documentation, marketing, usability... about: A defect in the software, core documentation, user/developer experience, or project
labels: A BUG labels: A BUG
title: ''
assignees: ''
--- ---
Thank you for helping to make hledger better! Thanks for helping to make hledger better! Here's how to make a good bug report:
You can delete this template text before submitting.
Some things to check before reporting: 1. Check:
- If you're not sure this is a bug, or if some discussion would help, - `hledger --version` it's best if it's not very old
contact us on chat or the mail list first: https://hledger.org/support.html - https://hledger.org/install.html shows the current version and how to upgrade
- https://hledger.org/hledger.html the manual (choose your version at top of page)
https://hledger.org/hledger-ui.html
https://hledger.org/hledger-web.html
- https://hledger.org/relnotes.html recent fixes and upgrade notes
- https://bugs.hledger.org bugs already reported
- https://hledger.org/faq.html answers to common questions
- https://hledger.org/support.html if you have other questions
- Have you looked at (the right version of) the user manual ? 2. In your bug report, please include if possible:
Use `hledger help [--help]` to view the built-in manuals,
or view the hledger.org -> USER MANUALS and choose the right version
at the top of the page.
Things that can help us resolve your issue faster: - the output of `hledger --version` or (best) `hledger setup`
- which operating system you're running on
- a link to the most relevant doc that you found, if any
- a small reproducible example or instructions to reproduce.
- A small reproducible example (--anon can help anonymise data) 3. And remove this help text.
- The output of hledger --version
- What platform you're on
- Any related docs that you found

View File

@ -1,24 +1,25 @@
--- ---
name: A wish name: A wish
about: A request or proposal for improving hledger's software, documentation, marketing, usability... about: A proposal for improving hledger or the project
labels: A WISH labels: A WISH
title: ''
assignees: ''
--- ---
Thank you for helping to make hledger better! Thanks for contributing. But first:
You can delete this template text before submitting.
Some things to check before requesting: - Have you looked for related features in the hledger manual (latest version) ?
https://hledger.org/hledger.html
https://hledger.org/hledger-ui.html
https://hledger.org/hledger-web.html
- We try to not clutter the bug tracker with too many wishlist items. - Ideas are endless and developers are few, so we try to not clutter the bug tracker with wishes.
Often it's best to discuss and attract interest on chat or the mail list first; Often it's best to discuss them on chat/mail list/forum first:
use your best judgement. https://hledger.org/support.html https://hledger.org/support
- Have you looked for related features in (the right version of) the user manual ? - Concrete proposals with draft docs move forward more quickly. Consider adding:
Use `hledger help [--help]` to view the built-in manuals, - A draft of user manual changes
or view the hledger.org -> USER MANUALS and choose the proper version - A draft of command line help
at the top of the page. - A mockup of intended output or UI
Things that will move your request along faster: (Please remove all of this text before submitting.)
- A small example or mockup of your intended UI/output
- A rough draft of intended command line help/reference documentation

View File

@ -1,11 +1,18 @@
# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
blank_issues_enabled: false
blank_issues_enabled: true
contact_links: contact_links:
- name: Questions, Support
url: https://hledger.org/#help-feedback - name: (A website issue)
about: For questions and support, please use our Chat or Mail list. url: https://github.com/simonmichael/hledger_site/issues
# doesn't show, mailto: probably not supported about: Please use the hledger_site issue tracker
# - name: hledger project security issues
# url: mailto:simon@joyful.com - name: (A support request)
# about: Please report security vulnerabilities here. url: https://hledger.org/support
about: Please use chat, mail list or forum
- name: (A security issue)
url: https://joyful.com
about: Please contact Simon directly

View File

@ -4,8 +4,19 @@ If you're a new developer, FOSS contributor, or hledger contributor, welcome.
Much of our best design work and knowledge sharing happens during code review, Much of our best design work and knowledge sharing happens during code review,
so be prepared for more work ahead, especially if your PR is large. so be prepared for more work ahead, especially if your PR is large.
To minimise waste, and learn how to get hledger PRs accepted swiftly, To minimise waste, and get your hledger PRs accepted quickly,
please check the latest guidelines in the developer docs: please check the guidelines in the developer docs:
https://hledger.org/PULLREQUESTS.html https://hledger.org/PULLREQUESTS.html
https://hledger.org/COMMITS.html
You don't need to master our commit conventions, but do add at least one prefix and colon
to the commit message summary. The most common prefixes are:
- feat: for user-visible features
- fix: for user-visible fixes
- imp: for user-visible improvements
- ;doc: for documentation improvements (; at the start enables quicker/cheaper CI tests)
- dev: for internal improvements
--> -->

View File

@ -1,5 +1,8 @@
hledger github actions workflows. The hledger project's github actions workflows.
They have greppable one-line TRIGGER: and ACTION: comments near the top,
summarising their current intended behaviour.
These are carefully worded and should be kept up to date.
docs: docs:
@ -34,3 +37,5 @@ https://github.com/mxschmitt/action-tmate
https://kodimensional.dev/github-actions https://kodimensional.dev/github-actions
"Dead simple cross-platform GitHub Actions for Haskell" "Dead simple cross-platform GitHub Actions for Haskell"
https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images
https://github.com/actions/partner-runner-images/tree/main?tab=readme-ov-file#available-images

View File

@ -1,24 +1,17 @@
# Runs on any push to ci-linux-arm32v7. # This was once used for certain raspberry pi hardware, may need update.
# Produces optimised static arm32v7 linux binaries, # TRIGGER: Runs on any push to binaries-linux-arm32v7 branch.
# using GHC 8.10.4 and cabal. # ACTION: Builds and saves linux arm32v7 static binaries, using docker-arm32v7/Dockerfile and cabal and the ghc specified there.
# Currently runs no tests. # XXX Slow, may time out.
# Slow, will probably time out.
name: binaries-linux-arm32v7-static
name: binaries-linux-arm32v7
on: on:
push: push:
branches: [ binaries-linux-arm32v7-static ] branches: [ binaries-linux-arm32v7 ]
#tags:
# - '[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+-*'
# - '[0-9]+.[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
docker: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@ -30,24 +23,25 @@ jobs:
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
file: ./docker-static-arm32v7/Dockerfile file: ./docker-arm32v7/Dockerfile
platforms: linux/arm platforms: linux/arm
tags: hledger-linux-static-arm32v7:latest tags: hledger-linux-arm32v7:latest
load: true load: true
- name: Gather binaries from docker - name: Gather binaries from docker
run: | run: |
container_id=$(docker create hledger-linux-static-arm32v7:latest) container_id=$(docker create hledger-linux-arm32v7:latest)
docker cp $container_id:/root/hledger tmp docker cp $container_id:/root/hledger tmp
docker rm -v $container_id docker rm -v $container_id
cd tmp cd tmp
tar cvf hledger-linux-static-arm32v7.tar hledger hledger-ui hledger-web tar cvf hledger-linux-arm32v7.tar hledger hledger-ui hledger-web
# could add extras like hledger/shell-completion/hledger-completion.bash here
# upload-artifact loses execute permissions, so we tar the binaries to preserve them. # upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar. # github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar. # Unfortunately it means users must both unzip and untar.
- name: Upload binaries artifact - name: Upload binaries artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: hledger-linux-static-arm32v7 name: hledger-linux-arm32v7
path: tmp/hledger-linux-static-arm32v7.tar path: tmp/hledger-linux-arm32v7.tar

View File

@ -0,0 +1,207 @@
# TRIGGER: Runs on any push to binaries-linux-arm64-stack or binaries branches.
# ACTION: Builds, unit-tests and saves linux arm64 static binaries with stack and the resolver & ghc version below,
# in an Alpine linux container which provides the statically-linkable musl.
name: binaries-linux-arm64-stack
on:
push:
branches: [ binaries-linux-arm64-stack ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- name: Show platform info
run: |
arch
uname -a
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
# - name: Check embedded files
# run: |
# tools/checkembeddedfiles
# things to be cached/restored:
# - name: Cache - ghcup-installed tools
# id: ghcup
# uses: actions/cache@v4
# with:
# path: ~/.ghcup
# key: ${{ runner.os }}-ghcup-${{ hashFiles('**.yaml') }}
# restore-keys: |
# ${{ runner.os }}-ghcup
- name: Cache - stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-aarch64-stack-programs-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-stack-programs
- name: Cache - stack global package db
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-aarch64-stack-global-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-stack-global
- name: Cache - .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-aarch64-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-stack-work
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-aarch64-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-hledger-lib-stack-work
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-aarch64-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-hledger-stack-work
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-aarch64-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-hledger-ui-stack-work
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-aarch64-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-aarch64-hledger-web-stack-work
# actions:
# - name: Install general tools with system package manager
# run: |
# apk --no-cache add binutils-gold curl gcc g++ git ripgrep tar gmp-dev libffi-dev ncurses-dev ncurses-static zlib-dev zlib-static
# set HOME to /root for stack (do it here in case it matters for ghcup too). workaround from https://github.com/actions/runner/issues/863)
- name: Set $HOME to /root for stack
run: |
apk add sudo
echo "setting HOME=/root for stack"
echo HOME=/root | sudo tee -a $GITHUB_ENV
- name: Install System Dependencies
run: |
# Add dependencies GHC/Stack need for linking
apk add stack gmp-dev zlib-dev zlib-static libffi-dev ncurses-dev ncurses-static gcc make musl-dev xz ripgrep
- name: Configure stack.yaml for static linking
run: |
# Add the ghc-options section to stack.yaml, using "$all"
echo "ghc-options:" >> stack.yaml
echo ' "$all": -fPIC -static -pie -Werror' >> stack.yaml
echo "Applied new stack.yaml configuration:"
cat stack.yaml
# - name: Install haskell tools if needed
# run: |
# Try hard to persuade ghcup to install an aarch64 binary
#ghcup config set platform-override '{ "arch": "A_64", "platform": { "contents": "Alpine", "tag": "Linux" }, "version": "3.18" }'
# cat >~/.ghcup/config.yaml <<END
# platform-override:
# arch: A_64
# platform:
# contents: Alpine
# tag: Linux
# version: '3.18'
# END
# if [[ ! -x ~/.ghcup/bin/ghc-9.12.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.12.2 -u https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-aarch64-alpine3_18-linux.tar.xz && ~/.ghcup/bin/ghcup set ghc 9.12.2; fi; printf "ghc: "; ghc --version
# if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.14.2.0 && ~/.ghcup/bin/ghcup set cabal 3.14.2.0; fi; printf "cabal: "; cabal --version
# curl -sSL https://get.haskellstack.org/ | sh
# # cat > ~/.stack/global-project/stack.yaml << END
# # packages: []
# # resolver: nightly-2025-05-01
# # compiler: ghc-9.12.2
# # notify-if-ghc-untested: false
# # notify-if-cabal-untested: false
# # END
# stack --allow-different-user setup --install-ghc
# --allow-different-user is needed because of #863 above (or because stack didn't notice we're in a docker container)
- name: List dep versions
run: |
stack exec -- ghc-pkg list
- name: Build with stack and run unit tests
run: |
# stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger # || (echo "ERROR: building hledger failed"; false)
# stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
# stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
stack --allow-different-user install --test --ghc-options='-Werror' hledger # || (echo "ERROR: building hledger failed"; false)
# stack --allow-different-user install --test --ghc-options='-Werror' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
# stack --allow-different-user install --test --ghc-options='-Werror' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
# - name: Build static hledger binary
# run: |
# # --allow-different-user is needed because you are root in the container
# # It's good practice to clean after a major flag change.
# # stack --allow-different-user clean
# stack --allow-different-user build --test
- name: Verify the binary
run: |
# Find the built executable and check if it's a static binary
BINARY_PATH=$(stack --allow-different-user exec -- which hledger)
echo "Binary is at: $BINARY_PATH"
echo "Checking linkage:"
# The output of ldd should be "statically linked" or "not a dynamic executable"
ldd "$BINARY_PATH"
- name: Gather binaries
run: |
mkdir tmp
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
cd tmp
tar cvf hledger-linux-arm64.tar hledger hledger-ui hledger-web *.1 *.info hledger-completion.bash
./hledger --version
./hledger-ui --version
./hledger-web --version
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: hledger-linux-arm64
path: tmp/hledger-linux-arm64.tar

View File

@ -0,0 +1,141 @@
# TRIGGER: Runs on any push to binaries-linux-arm64 or binaries branches.
# ACTION: Builds, unit-tests and saves linux arm64 static binaries with cabal and the ghc version below,
# in an Alpine linux container which provides the statically-linkable musl.
name: binaries-linux-arm64
on:
push:
branches: [ binaries-linux-arm64 ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04-arm
# arch: arm64
# image: https://github.com/actions/partner-runner-images/blob/main/images/arm-ubuntu-24-image.md
# container: arm64v8/alpine:3.18
container:
# work around janky arm/alpine support, https://github.com/actions/runner/issues/801#issuecomment-2394425757
image: arm64v8/alpine:3.18
volumes:
- /:/host # Jailbreak!
steps:
- name: Patch native Alpine NodeJS into Runner environment
if: runner.os == 'Linux'
run: |
apk add nodejs
sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
cd /host/home/runner/runners/*/externals/
rm -rf node20/*
mkdir node20/bin
ln -s /usr/bin/node node20/bin/node
shell: sh # No bash in Alpine by default
# doesn't work. Other possible workarounds:
# https://github.com/userdocs/test/actions/runs/12828579208/workflow
# https://github.com/foxcpp/maddy/pull/758/files
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
# things to be cached/restored:
- name: Cache - ghcup-installed tools
id: ghcup
uses: actions/cache@v4
with:
path: ~/.ghcup
key: ${{ runner.os }}-ghcup-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-ghcup
- name: Cache - cabal-installed libs
id: cabal
uses: actions/cache@v4
with:
path: ~/.cabal
key: ${{ runner.os }}-cabal-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-cabal
# actions:
- name: Install general tools with system package manager
run: |
apk --no-cache add binutils-gold curl gcc g++ git tar gmp-dev libffi-dev ncurses-dev ncurses-static zlib-dev zlib-static
- name: Add .ghcup/bin to PATH
run: |
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
- name: Install haskell ghcup if needed
uses: haskell/ghcup-setup@v1
# with:
# config: |
# arch: "A_64"
# platform: { "contents": "Alpine", "tag": "Linux" }
# version: "3.18"
- name: Install haskell tools with ghcup if needed
run: |
# Try hard to persuade ghcup to install an aarch64 binary
#ghcup config set platform-override '{ "arch": "A_64", "platform": { "contents": "Alpine", "tag": "Linux" }, "version": "3.18" }'
# cat >~/.ghcup/config.yaml <<END
# platform-override:
# arch: A_64
# platform:
# contents: Alpine
# tag: Linux
# version: '3.18'
# END
# if [[ ! -x ~/.ghcup/bin/ghc-9.12.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.12.2 -u https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-aarch64-alpine3_18-linux.tar.xz && ~/.ghcup/bin/ghcup set ghc 9.12.2; fi; printf "ghc: "; ghc --version
if [[ ! -x ~/.ghcup/bin/ghc-9.12.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.12.2 && ~/.ghcup/bin/ghcup set ghc 9.12.2; fi; printf "ghc: "; ghc --version
if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.14.2.0 && ~/.ghcup/bin/ghcup set cabal 3.14.2.0; fi; printf "cabal: "; cabal --version
- name: Display GHCup logs on error
if: failure()
run: |
echo "GHCup installation failed. Displaying logs:"
cat ~/.ghcup/logs/*.log
- name: Update cabal package index
run: |
cabal update
- name: Build with cabal
run: |
cabal build --enable-executable-static --ghc-options=-Werror hledger || (echo "ERROR: building hledger failed"; false)
cabal build --enable-executable-static --ghc-options=-Werror hledger-ui || (echo "ERROR: building hledger-ui failed"; false)
cabal build --enable-executable-static --ghc-options=-Werror hledger-web || (echo "ERROR: building hledger-web failed"; false)
- name: Gather binaries
run: |
mkdir tmp
cp dist-newstyle/build/aarch64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp
cp dist-newstyle/build/aarch64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp
cp dist-newstyle/build/aarch64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
cd tmp
tar cvf hledger-linux-arm64.tar hledger hledger-ui hledger-web *.1 *.info hledger-completion.bash
./hledger --version
./hledger-ui --version
./hledger-web --version
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: hledger-linux-arm64
path: tmp/hledger-linux-arm64.tar

View File

@ -0,0 +1,146 @@
# Alternate binaries-linux workflow, using stack like the others for consistency. May not work.
# Currently the cabal-based binaries-linux-x64.yml is used instead, for cabal testing and for easier static building.
#
# TRIGGER: Runs on any push to binaries-linux-x64-stack branch.
# ACTION: Builds, unit-tests and saves mac x64 static binaries with stack and the default ghc,
# in an Alpine linux container which provides the statically-linkable musl.
name: binaries-linux-x64-_binaries
on:
push:
branches: [ binaries-linux-x64-stack ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
# arch: x64
# image: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
container: alpine:latest
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
# things to be cached/restored:
- name: Cache - stack global package db
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-20240417-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-20240417
- name: Cache - stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-20240417-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-20240417
- name: Cache - .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-20240417-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-20240417
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-20240417-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-20240417
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-20240417-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work-20240417
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-20240417-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-20240417
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-20240417-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work-20240417
# actions:
- name: Install general tools with system package manager
run: |
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev gmp-static ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
# needed by stack, at least; do it here in case it matters for ghcup too
- name: Fix $HOME for following steps (workaround from https://github.com/actions/runner/issues/863)
run: |
apk --no-cache add sudo
echo "setting HOME=/root"
echo HOME=/root | sudo tee -a $GITHUB_ENV
- name: Add .ghcup/bin to PATH for following steps
run: |
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
- name: Install haskell tools with ghcup if needed
run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version
if [[ ! -x ~/.ghcup/bin/stack ]]; then ~/.ghcup/bin/ghcup install stack 3.3.1 && ~/.ghcup/bin/ghcup set stack 3.3.1; fi; printf "stack: "; stack --version
# --allow-different-user is needed because of #863 above (or because stack didn't notice we're in a docker container)
- name: Install GHC with stack
run: |
stack --allow-different-user setup --install-ghc
- name: List dep versions
run: |
stack exec -- ghc-pkg list
- name: Build with stack and run unit tests
run: |
stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger # || (echo "ERROR: building hledger failed"; false)
stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
stack --allow-different-user build --test --ghc-options='-fPIC -optl-static -Werror' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
- name: Gather binaries
run: |
mkdir tmp
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
tar -C tmp cvf hledger-linux-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.tar

View File

@ -0,0 +1,147 @@
# TRIGGER: Runs on any push to binaries-windows-arm64 or binaries branches.
# ACTION: Builds, unit-tests and saves windows arm64 binaries with stack and the default ghc.
# XXX There's no windows ARM version of stack yet; the preinstalled stack,
# the one installed by ghcup, and the one installed by stack's installer are all x86_64.
# So currently this workflow just builds x86_64 hledger binaries, and is pointless.
name: binaries-windows-arm64
on:
push:
branches: [ binaries-windows-arm64 ] # binaries
workflow_dispatch:
jobs:
build:
runs-on: windows-11-arm
# arch: arm64
# image: https://github.com/actions/partner-runner-images/blob/main/images/arm-windows-11-image.md
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
# caching
# XXX Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
- name: Cache - stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
id: stack-programs-dir
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
# which files signal a change in stack's global db ?
# **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-local-programs-stack
- name: Cache - stack global dir
id: stack-global-package-db
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-roaming-stack
- name: Cache - ./.stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-lib-stack-work
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-ui-stack-work
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work
# actions
- name: Install haskell tools if needed
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
run: |
stack setup --install-ghc
- name: Install haskell deps
run: |
stack build --test --only-dependencies --dry-run
stack build --test --only-dependencies
- name: Build all hledger modules warning free, optimised and minimised
run: |
stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on windows, "too many sections"
# --pedantic
# - name: Install shelltestrunner
## - export PATH=~/.local/bin:$PATH
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.11; fi
# - shelltest --version
# run hledger-lib/hledger functional tests, skipping the ones for addons
## - export PATH=~/.local/bin:$PATH
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected
# artifacts:
- name: Gather binaries
run: |
mkdir tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-ui.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe tmp
strip tmp/hledger.exe
strip tmp/hledger-ui.exe
strip tmp/hledger-web.exe
tmp/hledger --version
tmp/hledger-ui --version
tmp/hledger-web --version
# Guessing these are not likely to be used on windows.
# cp hledger/embeddedfiles/*.1 tmp
# cp hledger/embeddedfiles/*.info tmp
# cp hledger/shell-completion/hledger-completion.bash tmp
- name: Create binaries artifact
uses: actions/upload-artifact@v4
with:
name: hledger-windows-arm64
path: |
tmp/hledger.exe
tmp/hledger-ui.exe
tmp/hledger-web.exe

56
.github/workflows/_docker.yml vendored Normal file
View File

@ -0,0 +1,56 @@
# TRIGGER: Runs on any push to the docker branch.
# ACTION: Generates docker images for linux x64 and arm64, and pushes them to Github's Container Registry.
# Experimental, see https://github.com/simonmichael/hledger/pull/2002.
name: docker
on:
push:
branches: [ docker ]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,102 +0,0 @@
# Runs on any push to ci-linux-x64.
# Produces optimised static x64 linux binaries,
# using the GHC version below (9.0.2) and cabal.
# Currently runs no tests.
# ghc 9.0 is used to avoid segfaults with the ghc 9.2 binaries on alpine, possibly https://gitlab.haskell.org/ghc/ghc/-/issues/20266
name: binaries-linux-x64-static
on:
push:
branches: [ binaries-linux-x64-static, binaries ]
#tags:
# - '[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+-*'
# - '[0-9]+.[0-9]+.[0-9]+'
# - '[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: alpine:edge
steps:
- name: Check out
uses: actions/checkout@v2
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
- name: Cache ghcup-installed tools
id: ghcup
uses: actions/cache@v2
with:
path: ~/.ghcup
key: ${{ runner.os }}-ghcup-20220829-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-ghcup-20220829
- name: Cache cabal-installed libs
id: cabal
uses: actions/cache@v2
with:
path: ~/.cabal
key: ${{ runner.os }}-cabal-20220829-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-cabal-20220829
- name: Install general tools with system package manager
run: |
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
- name: Add .ghcup/bin to PATH for following steps
run: |
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
- name: Install haskell tools with ghcup if needed
# originally based on fossas/haskell-static-alpine
run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then
mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup
fi
ghcup --version
if [[ ! -x ~/.ghcup/bin/ghc-9.0.2 ]]; then
~/.ghcup/bin/ghcup install ghc 9.0.2 && ~/.ghcup/bin/ghcup set ghc 9.0.2
fi
ghc --version
if [[ ! -x ~/.ghcup/bin/cabal-3.8.1.0 ]]; then
~/.ghcup/bin/ghcup install cabal 3.8.1.0 && ~/.ghcup/bin/ghcup set cabal 3.8.1.0
fi
cabal --version
- name: Update cabal package index
run: |
cabal update
- name: Build on alpine
run: |
cabal build --enable-executable-static hledger || (echo "ERROR: building hledger failed"; false)
cabal build --enable-executable-static hledger-ui || (echo "ERROR: building hledger failed"; false)
cabal build --enable-executable-static hledger-web || (echo "ERROR: building hledger-web failed"; false)
- name: Gather binaries
run: |
mkdir tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp
cd tmp
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.tar

138
.github/workflows/binaries-linux-x64.yml vendored Normal file
View File

@ -0,0 +1,138 @@
# TRIGGER: Runs on any push to binaries-linux-x64 or binaries branches.
# ACTION: Builds, unit-tests and saves linux x64 static binaries with cabal and the ghc version below,
# in an Alpine linux container which provides the statically-linkable musl.
name: binaries-linux-x64
on:
push:
branches: [ binaries-linux-x64, binaries ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
# arch: x64
# image: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
container: alpine:latest
env:
stack: stack
ghcid: 9.12.2
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
- name: Install general tools with system package manager
run: |
apk --no-cache add gmp-dev gmp-static libffi-dev zlib-dev zlib-static ncurses-dev ncurses-static binutils-gold curl gcc g++ git make xz tar perl
# CACHES
- name: Cache - ~/.ghcup
id: ghcup
uses: actions/cache@v4
with:
path: ~/.ghcup
key: ${{ runner.os }}-x64-ghcup-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-ghcup-${{ env.ghcid }}
- name: Cache - ~/.cabal/store
id: cabal-store
uses: actions/cache@v4
with:
path: ~/.cabal/store
key: ${{ runner.os }}-x64-cabal-store-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-cabal-store-${{ env.ghcid }}
- name: Cache - ~/.cabal (excluding store)
id: cabal-config
uses: actions/cache@v4
with:
path: |
~/.cabal
!~/.cabal/store
key: ${{ runner.os }}-x64-cabal-config-${{ env.ghcid }}-${{ hashFiles('cabal.project*') }}
restore-keys: |
${{ runner.os }}-x64-cabal-config-${{ env.ghcid }}
- name: Cache - dist-newstyle
uses: actions/cache@v4
with:
path: dist-newstyle
key: ${{ runner.os }}-x64-dist-newstyle-${{ env.ghcid }}-${{ hashFiles('**/*.cabal', 'cabal.project*') }}
restore-keys: |
${{ runner.os }}-x64-dist-newstyle-${{ env.ghcid }}
# actions:
# - name: Check tool versions
# run: |
# which ghcup; ghcup --version
# which stack; stack --version
# which cabal; cabal --version
# which ghc; ghc --version
# no preinstalled tools because using alpine container
# - name: Install haskell ghcup
# uses: haskell/ghcup-setup@v1
- name: Add .ghcup/bin to PATH
run: |
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
- name: Install haskell tools if needed
run: |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version
if [[ ! -x ~/.ghcup/bin/ghc-9.12.2 ]]; then ghcup install ghc 9.12.2 && ghcup set ghc 9.12.2; fi; printf "ghc: "; ghc --version
if [[ ! -x ~/.ghcup/bin/cabal ]]; then ghcup install cabal 3.14.2.0 && ghcup set cabal 3.14.2.0; fi; printf "cabal: "; cabal --version
- name: Update cabal package index
run: |
cabal update
- name: Build with cabal
run: |
cabal build --enable-executable-static --ghc-options=-Werror hledger --constraint 'haskeline>=0.8.4.1' || (echo "ERROR: building hledger failed"; false)
cabal build --enable-executable-static --ghc-options=-Werror hledger-ui --constraint 'brick==2.10' || (echo "ERROR: building hledger-ui failed"; false)
# temporary constraint to avoid https://github.com/jtdaugherty/brick/issues/539
cabal build --enable-executable-static --ghc-options=-Werror hledger-web || (echo "ERROR: building hledger-web failed"; false)
- name: Gather binaries
run: |
mkdir tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
cd tmp
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web *.1 *.info hledger-completion.bash
ldd hledger || true
ldd hledger-ui || true
ldd hledger-web || true
# file hledger
# file hledger-ui
# file hledger-web
./hledger --version
./hledger-ui --version
./hledger-web --version
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# https://github.com/actions/upload-artifact?tab=readme-ov-file#limitations
# In release workflows, we repack these using the platform's native compression scheme.
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.tar

176
.github/workflows/binaries-mac-arm64.yml vendored Normal file
View File

@ -0,0 +1,176 @@
# TRIGGER: Runs on any push to binaries-mac-arm64 or binaries branches.
# ACTION: Builds, tests and saves mac arm64 dynamic binaries with stack and the default ghc.
name: binaries-mac-arm64
on:
push:
branches: [ binaries-mac-arm64, binaries ]
workflow_dispatch:
jobs:
build:
runs-on: macos-14
# arch: arm64
# image: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
env:
stack: stack
ghcid: 9.12.2
steps:
- name: Show platform info
run: |
arch
uname -a
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
- name: Check embedded files
run: |
tools/checkembeddedfiles
# CACHES
- name: Cache - stack-installed ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-arm64-stack-programs-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-stack-programs-${{ env.ghcid }}
- name: Cache - ~/.stack
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-arm64-stack-global-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-stack-global-${{ env.ghcid }}
- name: Cache - ./.stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-arm64-stack-work-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-stack-work-${{ env.ghcid }}
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-arm64-hledger-lib-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-hledger-lib-stack-work-${{ env.ghcid }}
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-arm64-hledger-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-hledger-stack-work-${{ env.ghcid }}
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-arm64-hledger-ui-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-hledger-ui-stack-work-${{ env.ghcid }}
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-arm64-hledger-web-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-arm64-hledger-web-stack-work-${{ env.ghcid }}
# actions:
- name: Ensure ~/.local/bin exists and is in PATH
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin/" >> $GITHUB_PATH
- name: Install haskell tools if needed
run: |
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/osx-aarch64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
$stack setup --install-ghc --verbosity=error
- name: Install haskell deps
run: |
$stack build --test --only-dependencies --verbosity=error
- name: List dep versions
run: |
$stack exec -- ghc-pkg list
- name: Build hledger and test unit tests, doc tests
run: |
$stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on mac
# --pedantic
- name: Install shelltestrunner
run: |
export PATH=~/.local/bin:$PATH
# $stack update; $stack install --verbosity=error shelltestrunner-1.11
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install --verbosity=error shelltestrunner-1.11; fi
shelltest --version
- name: Test functional tests (excluding addons)
run: |
export PATH=~/.local/bin:$PATH
COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected # bin
# This is tested here rather than in the regular CI because it's slow,
# doesn't fail too often, and the cost of late detection and fixing is low.
- name: Test haddock generation
run: |
printf "haddock: "; stack exec -- haddock --version
time $stack build --fast --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs"
# --no-haddock-hyperlink-source is 25% faster
# --no-print-missing-docs is 600% quieter
# artifacts:
- name: Gather binaries
run: |
mkdir tmp
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
cd tmp
gtar cvf hledger-mac-arm64.tar hledger hledger-ui hledger-web *.1 *.info hledger-completion.bash
otool -L hledger
otool -L hledger-ui
otool -L hledger-web
./hledger --version
./hledger-ui --version
./hledger-web --version
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# https://github.com/actions/upload-artifact?tab=readme-ov-file#limitations
# In release workflows, we repack these using the platform's native compression scheme.
- name: Upload binaries artifact
uses: actions/upload-artifact@v4
with:
name: hledger-mac-arm64
path: tmp/hledger-mac-arm64.tar

View File

@ -1,197 +1,169 @@
# Runs on any push to ci-mac, and weekly on master. # TRIGGER: Runs on any push to binaries-mac-x64 or binaries branches.
# Produces optimised mac binaries and runs unit/doc/functional tests, # ACTION: Builds, tests and saves mac x64 dynamic binaries with stack and the default ghc.
# using the default stack.yaml's GHC version.
name: binaries-mac-x64 name: binaries-mac-x64
on: on:
schedule:
- cron: "0 07 * * 0" # sunday midnight pacific
push: push:
branches: [ binaries-mac-x64, binaries ] branches: [ binaries-mac-x64, binaries ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
runs-on: macos-latest runs-on: macos-15-intel
strategy: # arch: x64
fail-fast: false # image: somewhere near https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
matrix: # https://github.com/actions/runner-images/issues/13046
plan:
# - { ghc: "810" , stack: "stack --stack-yaml=stack8.10.yaml" } env:
# XXX func tests in bin should be run only with GHC 8.10 for now (see shelltest below) (?) stack: stack
# - { ghc: "90" , stack: "stack --stack-yaml=stack9.0.yaml" } ghcid: 9.12.2
- { ghc: "92" , stack: "stack --stack-yaml=stack.yaml" }
steps: steps:
- name: Show platform info
run: |
arch
uname -a
- name: Check out - name: Check out
uses: actions/checkout@v2 uses: actions/checkout@v4
# have to fetch everything for git describe for --version # have to fetch everything for git describe for --version
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Confirm all remaining steps should run - name: Check embedded files
run: echo "CONTINUE=true" >> $GITHUB_ENV run: |
tools/checkembeddedfiles
# things to be cached/restored: # CACHES
- name: Cache stack global package db - name: Cache - stack-installed ~/.local/bin
id: stack-global
uses: actions/cache@v2
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-from20220817-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-from20220817
if: env.CONTINUE
- name: Cache stack-installed programs in ~/.local/bin
id: stack-programs id: stack-programs
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: ~/.local/bin path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-from20220817-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-programs-from20220817 ${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache .stack-work - name: Cache - ~/.stack
uses: actions/cache@v2 id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-x64-stack-global-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-global-${{ env.ghcid }}
- name: Cache - ./.stack-work
uses: actions/cache@v4
with: with:
path: .stack-work path: .stack-work
key: ${{ runner.os }}-stack-work-from20220817-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-work-from20220817 ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-lib/.stack-work - name: Cache - hledger-lib/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-lib/.stack-work path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-from20220817-${{ hashFiles('hledger-lib/package.yaml') }} key: ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-from20220817 ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger/.stack-work - name: Cache - hledger/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger/.stack-work path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-from20220817-${{ hashFiles('hledger/package.yaml') }} key: ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-stack-work-from20220817 ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-ui/.stack-work - name: Cache - hledger-ui/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-ui/.stack-work path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-from20220817-${{ hashFiles('hledger-ui/package.yaml') }} key: ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-from20220817 ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-web/.stack-work - name: Cache - hledger-web/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-web/.stack-work path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-from20220817-${{ hashFiles('hledger-web/package.yaml') }} key: ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-web-stack-work-from20220817 ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}
if: env.CONTINUE
# actions: # actions:
- name: Install stack - name: Ensure ~/.local/bin exists and is in PATH
# run: |
# brew install haskell-stack
# $stack --version
run: | run: |
mkdir -p ~/.local/bin mkdir -p "$HOME/.local/bin"
export PATH=~/.local/bin:$PATH echo "$HOME/.local/bin/" >> $GITHUB_PATH
# brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi - name: Install haskell tools if needed
run: |
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version stack --version
if: env.CONTINUE $stack setup --install-ghc --verbosity=error
- name: Install GHC (with stack)
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack setup --install-ghc
if: env.CONTINUE
# - name: Install GHC (with ghcup)
# run: |
# mkdir -p ~/.ghcup/bin && curl -sL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup
# ~/.ghcup/bin/ghcup install --set ghc 9.2.4 # && ~/.ghcup/bin/ghcup install stack
# echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
# if: env.CONTINUE
# - name: Install GHC (from haskell.org)
# run: |
# curl -sL https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-x86_64-apple-darwin.tar.xz | tar xj && cd ghc-9.2.4-x86_64-apple-darwin && ./configure && make install
# ghc --version
# mkdir -p ~/.stack && printf "system-ghc: true\ninstall-ghc: false\n" >>~/.stack/config.yaml
# if: env.CONTINUE
- name: Install haskell deps - name: Install haskell deps
env:
stack: ${{ matrix.plan.stack }}
run: | run: |
$stack build --test --only-dependencies --dry-run $stack build --test --only-dependencies --verbosity=error
$stack build --test --only-dependencies
if: env.CONTINUE # - name: List dep versions
# run: |
# $stack exec -- ghc-pkg list
- name: Build hledger and test unit tests, doc tests - name: Build hledger and test unit tests, doc tests
env:
stack: ${{ matrix.plan.stack }}
run: | run: |
$stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror $stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on mac # --ghc-options=-split-sections doesn't work on mac
# --pedantic # --pedantic
if: env.CONTINUE
- name: Install shelltestrunner - name: Install shelltestrunner
env:
stack: ${{ matrix.plan.stack }}
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.9; fi # $stack update; $stack install --verbosity=error shelltestrunner-1.11
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install --verbosity=error shelltestrunner-1.11; fi
shelltest --version shelltest --version
if: env.CONTINUE
- name: Test functional tests (excluding addons) - name: Test functional tests (excluding addons)
env:
stack: ${{ matrix.plan.stack }}
run: | run: |
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons # bin COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected # bin
if: env.CONTINUE
# artifacts: # artifacts:
- name: Gather binaries - name: Gather binaries
run: | run: |
mkdir tmp mkdir tmp
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
cd tmp cd tmp
cp ~/.local/bin/hledger . gtar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web *.1 *.info hledger-completion.bash
cp ~/.local/bin/hledger-ui . otool -L hledger
cp ~/.local/bin/hledger-web . otool -L hledger-ui
strip hledger otool -L hledger-web
strip hledger-ui ./hledger --version
strip hledger-web ./hledger-ui --version
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web ./hledger-web --version
if: env.CONTINUE
# upload-artifact loses execute permissions, so we tar the binaries to preserve them. # upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar. # github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar. # https://github.com/actions/upload-artifact?tab=readme-ov-file#limitations
# In release workflows, we repack these using the platform's native compression scheme.
- name: Upload binaries artifact - name: Upload binaries artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: hledger-mac-x64 name: hledger-mac-x64
path: tmp/hledger-mac-x64.tar path: tmp/hledger-mac-x64.tar
if: env.CONTINUE

View File

@ -1,183 +1,137 @@
# Runs on any push to ci-windows, and weekly on master. # TRIGGER: Runs on any push to binaries-windows-x64 or binaries branches.
# Produces optimised windows binaries, # ACTION: Builds, unit-tests and saves windows x64 binaries with stack and the default ghc.
# using the default stack.yaml's GHC version.
# Currently runs no tests.
name: binaries-windows-x64 name: binaries-windows-x64
on: on:
schedule:
- cron: "0 07 * * 0" # sunday midnight pacific
push: push:
branches: [ binaries-windows-x64, binaries ] branches: [ binaries-windows-x64, binaries ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
runs-on: windows-latest runs-on: windows-latest
# arch: x64
# image:
defaults: defaults:
run: run:
shell: bash shell: bash
env:
# use preinstalled ghc 9.12.2
stack: stack --system-ghc --no-install-ghc --stack-yaml stack.yaml
ghcid: 9.12.2
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v2 uses: actions/checkout@v4
# have to fetch everything for git describe for --version # have to fetch everything for git describe for --version
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Confirm all remaining steps should run # CACHES
run: echo "CONTINUE=true" >> $GITHUB_ENV
# things to be cached/restored: # Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
# - name: Cache - stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
# id: stack-programs-dir
# uses: actions/cache@v4
# with:
# path: C:\Users\runneradmin\AppData\Local\Programs\stack\
# # which files signal a change in stack's global db ?
# # **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
# key: ${{ runner.os }}-x64-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
# restore-keys: |
# ${{ runner.os }}-x64-appdata-local-programs-stack
- name: Cache stack global package db - name: Cache - stack global dir
id: stack-global-package-db id: stack-global-package-db
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: C:\Users\runneradmin\AppData\Roaming\stack\ path: C:\Users\runneradmin\AppData\Roaming\stack\
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-x64-appdata-roaming-stack-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-appdata-roaming-stack ${{ runner.os }}-x64-appdata-roaming-stack-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2 - name: Cache - ./.stack-work
id: stack-programs-dir uses: actions/cache@v4
uses: actions/cache@v2
with:
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
# which files signal a change in stack's global db ?
# **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-appdata-local-programs-stack
if: env.CONTINUE
- name: Cache .stack-work
uses: actions/cache@v2
with: with:
path: .stack-work path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} key: ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-stack-work ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-lib/.stack-work - name: Cache - hledger-lib/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-lib/.stack-work path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }} key: ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-lib-stack-work ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger/.stack-work - name: Cache - hledger/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger/.stack-work path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }} key: ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-stack-work ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-ui/.stack-work - name: Cache - hledger-ui/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-ui/.stack-work path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }} key: ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-ui-stack-work ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}
if: env.CONTINUE
- name: Cache hledger-web/.stack-work - name: Cache - hledger-web/.stack-work
uses: actions/cache@v2 uses: actions/cache@v4
with: with:
path: hledger-web/.stack-work path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }} key: ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-hledger-web-stack-work ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}
if: env.CONTINUE
# - name: showStuff # actions
# run: |
# ls -lFRa /c/users/runneradmin/appdata/roaming/stack
# ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
# actions:
# - name: Add stack local bin to PATH
# run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin"
# - name: Install stack
# run: |
# mkdir -p ~/.local/bin
# export PATH=~/.local/bin:$PATH
# if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
# $stack --version
# env:
# stack: ${{ matrix.plan.stack }}
- name: Install stack
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# this step is needed to get stack.exe into PATH, for now
run: |
curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
7z x stack.zip stack.exe
which stack
stack --version
which ./stack
./stack --version
if: env.CONTINUE
- name: Install GHC
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
run: |
./stack --no-terminal setup --install-ghc
if: env.CONTINUE
# - name: Install shelltestrunner
## - export PATH=~/.local/bin:$PATH
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
# - shelltest --version
- name: Install haskell deps - name: Install haskell deps
run: | run: |
./stack --no-terminal build --only-dependencies --dry-run $stack build --test --only-dependencies
./stack --no-terminal build --only-dependencies
if: env.CONTINUE
# use whichever GHC is in default stack.yaml - name: List dep versions
run: |
$stack exec -- ghc-pkg list
- name: Build all hledger modules warning free, optimised and minimised - name: Build all hledger modules warning free, optimised and minimised
run: | run: |
./stack --no-terminal install --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror $stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
# --ghc-options=-split-sections doesn't work on windows, "too many sections" # --ghc-options=-split-sections doesn't work on windows, "too many sections"
# --pedantic
if: env.CONTINUE
# run hledger-lib/hledger functional tests, skipping the ones for addons
## - export PATH=~/.local/bin:$PATH
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons
# artifacts: # artifacts:
- name: Gather binaries - name: Gather binaries
run: | run: |
mkdir tmp mkdir tmp
cd tmp cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe . cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-ui.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe . cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe tmp
strip hledger.exe strip tmp/hledger.exe
strip hledger-web.exe strip tmp/hledger-ui.exe
if: env.CONTINUE strip tmp/hledger-web.exe
tmp/hledger --version
tmp/hledger-ui --version
tmp/hledger-web --version
# Guessing these are not likely to be used on windows.
# cp hledger/embeddedfiles/*.1 tmp
# cp hledger/embeddedfiles/*.info tmp
# cp hledger/shell-completion/hledger-completion.bash tmp
- name: Create binaries artifact - name: Create binaries artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: hledger-windows-x64 name: hledger-windows-x64
path: | path: |
tmp/hledger.exe tmp/hledger.exe
tmp/hledger-ui.exe
tmp/hledger-web.exe tmp/hledger-web.exe
if: env.CONTINUE

420
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,420 @@
# The main hledger continuous integration tests.
# Code must pass this successfully before it can be merged or pushed to master.
# https://github.com/simonmichael/hledger/settings/branch_protection_rules/17386787
# TRIGGER: Runs on any push to ci branch or any pull request against master.
# ACTION: Builds, tests and saves linux x64 dynamic binaries with stack and the default ghc.
name: ci
on:
# When manually triggered in github ui, it runs in master.
workflow_dispatch:
# When there's a push to the ci branch, it runs in that branch.
# After it passes, those commits can be merged/pushed to master.
# (Don't use these branches for pull requests, or it will run twice,
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/2)
push:
branches: [ ci ]
# When there's a pull request against master, it runs in the pull request's branch.
# After it passes, that branch can be merged/pushed to master.
pull_request:
branches: [ master ]
# Uncomment to run it only for changes to these paths: (but that could prevent merging)
# paths:
# - '.github/workflows/pushpull.yml'
# - 'stack*.yaml'
# - 'hledger-lib/**'
# - 'hledger/**'
# - 'hledger-ui/**'
# - 'hledger-web/**'
# - 'bin/*.hs'
# - 'examples/**'
# Or to ignore certain paths:
# # examples
# - '!**.journal'
# - '!**.j'
# - '!**.ledger'
# - '!**.csv'
# # docs
# - '!**.m4'
# - '!**.md'
# - '!**.1'
# - '!**.5'
# - '!**.info'
# - '!**.txt'
jobs:
ci:
runs-on: ubuntu-24.04
# arch: x64
# image: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
env:
stack: stack
ghcid: 9.10.1
cachedate: 20250615 # bump this when new caches are needed
# flag for skipping later steps, declared here to prevent "Context access might be invalid" warnings
do-all:
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for hledger's --version
with:
fetch-depth: 0
# - name: Print some context for troubleshooting
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo $GITHUB_CONTEXT
# # echo "$GITHUB_SHA"
# # echo "$GITHUB_REF"
# # echo "$GITHUB_HEAD_REF"
# # echo "$GITHUB_BASE_REF"
# # git log "$GITHUB_BASE_REF"..
# # tools/commitlint "$GITHUB_BASE_REF"..
# EARLY ACTIONS
- name: Check commit messages
# keep this step synced in all workflows which do it
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# 202310: we skip this check when we can't detect the commits, which happens in certain cases
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
# 202312: ignore this if it fails, it may be not worth the hassle
env:
BEFORE: ${{ github.event.before }}
# NUM: 5
shell: bash
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:-}
echo "debug: last 10 commits:"
echo "$(git log --format='%h -%d %s (%an, %ci)' -10)"
echo "debug: origin/master:"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 origin/master)"
echo "debug: BEFORE=$BEFORE"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 $BEFORE)"
echo "debug: GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 $GITHUB_HEAD_REF)"
echo "debug: RANGE=$RANGE"
echo "debug: commits to check:"
echo "$(git log --format='%h -%d %s (%an, %ci)' --abbrev-commit --date=relative --date-order $RANGE)"
if git rev-list --quiet $RANGE
then
tools/commitlint $RANGE || echo "commit lint failed, ignoring"
else
# echo "could not identify commits, checking last $NUM instead:"; tools/commitlint -$NUM
echo "could not identify commits, not checking them" # XXX
fi
- name: Skip remaining steps if the last commit message begins with ;
shell: bash
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
(git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog \
&& (grep -qE '^ *;' $$.gitlog || echo "do-all=true" >> $GITHUB_ENV)) \
|| ( echo "could not identify commit range, continuing CI steps"; echo "do-all=true" >> $GITHUB_ENV )
- name: Check embedded files
run: |
tools/checkembeddedfiles
if: env.do-all
# CACHES
# Remember, caches are immutable - created once and never updated.
# If a cache is used, a new version of it won't be created.
# It's probably right to use them for things which don't/needn't change between runs,
# including:
# - the package db containing the versions of our deps specified by the stackage snapshot
# (or by the build plan found by the first cabal run, if using cabal)
# - the local bin directory ? what's in there anyway ?
# - the per-project and per-package .stack-work directories ? these probably change a little on each run.
# presumably it's worthwhile to cache their first-run content, even if with every following run
# we end up having to rebuild more of that. The alternative is to always rebuild all of it.
- name: Cache - stack global package db
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
# XXX if stack.yaml is a symlink, this fails with
# Error: The template is not valid. .github/workflows/push.yml (Line: 103, Col: 14): hashFiles('**.yaml') failed.
# Fail to hash files under directory '/home/runner/work/hledger/hledger'
key: ${{ runner.os }}-x64-stack-global-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-global-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-work-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}-${{ env.cachedate }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}-${{ env.cachedate }}
if: env.do-all
# Ensure the ghc version we need is installed.
# The following stack path commands require it, so let's install it first, quietly if possible.
# Hopefully it will often be in our cached dirs, avoiding reinstall.
# Don't rely on the preinstalled ghc, it's too variable.
- name: Ensure ghc is installed
run: |
$stack setup --verbosity error
if: env.do-all
# - name: Show stack directories
# run: |
# printf "stack-root: \t"; $stack path --stack-root # Global Stack root directory
# printf "global-config: \t"; $stack path --global-config # Global Stack configuration file
# printf "project-root: \t"; $stack path --project-root # Project root (derived from stack.yaml file)
# printf "config-location: \t"; $stack path --config-location # Configuration location (where the stack.yaml file is)
# printf "bin-path: \t"; $stack path --bin-path # PATH environment variable
# printf "programs: \t"; $stack path --programs # Install location for GHC and other core tools (see 'stack ls tools' command)
# printf "compiler-exe: \t"; $stack path --compiler-exe # Compiler binary (e.g. ghc)
# printf "compiler-bin: \t"; $stack path --compiler-bin # Directory containing the compiler binary (e.g. ghc)
# printf "compiler-tools-bin: \t"; $stack path --compiler-tools-bin # Directory containing binaries specific to a particular compiler
# printf "local-bin: \t"; $stack path --local-bin # Directory where Stack installs executables (e.g. ~/.local/bin (Unix-like OSs) or %APPDATA%\local\bin (Windows))
# printf "extra-include-dirs: \t"; $stack path --extra-include-dirs # Extra include directories
# printf "extra-library-dirs: \t"; $stack path --extra-library-dirs # Extra library directories
# printf "snapshot-pkg-db: \t"; $stack path --snapshot-pkg-db # Snapshot package database
# printf "local-pkg-db: \t"; $stack path --local-pkg-db # Local project package database
# printf "global-pkg-db: \t"; $stack path --global-pkg-db # Global package database
# printf "ghc-package-path: \t"; $stack path --ghc-package-path # GHC_PACKAGE_PATH environment variable
# printf "snapshot-install-root: \t"; $stack path --snapshot-install-root # Snapshot installation root
# printf "local-install-root: \t"; $stack path --local-install-root # Local project installation root
# printf "snapshot-doc-root: \t"; $stack path --snapshot-doc-root # Snapshot documentation root
# printf "local-doc-root: \t"; $stack path --local-doc-root # Local project documentation root
# printf "local-hoogle-root: \t"; $stack path --local-hoogle-root # Local project documentation root
# printf "dist-dir: \t"; $stack path --dist-dir # Dist work directory, relative to package directory
# printf "local-hpc-root: \t"; $stack path --local-hpc-root # Where HPC reports and tix files are stored
# if: env.do-all
# Example output:
# stack-root: /home/runner/.stack
# global-config: /home/runner/.stack/config.yaml
# project-root: /home/runner/work/hledger/hledger
# config-location: /home/runner/work/hledger/hledger/stack.yaml
# bin-path: /home/runner/.stack/snapshots/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/bin:/home/runner/.stack/compiler-tools/x86_64-linux-tinfo6/ghc-9.10.1/bin:/home/runner/.stack/programs/x86_64-linux/ghc-tinfo6-9.10.1/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
# programs: /home/runner/.stack/programs/x86_64-linux
# compiler-exe: /home/runner/.stack/programs/x86_64-linux/ghc-tinfo6-9.10.1/bin/ghc-9.10.1
# compiler-bin: /home/runner/.stack/programs/x86_64-linux/ghc-tinfo6-9.10.1/bin
# compiler-tools-bin: /home/runner/.stack/compiler-tools/x86_64-linux-tinfo6/ghc-9.10.1/bin
# local-bin: /home/runner/.local/bin
# extra-include-dirs:
# extra-library-dirs:
# snapshot-pkg-db: /home/runner/.stack/snapshots/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/pkgdb
# local-pkg-db: /home/runner/work/hledger/hledger/.stack-work/install/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/pkgdb
# global-pkg-db: /home/runner/.stack/programs/x86_64-linux/ghc-tinfo6-9.10.1/lib/ghc-9.10.1/lib/package.conf.d
# ghc-package-path: /home/runner/work/hledger/hledger/.stack-work/install/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/pkgdb:/home/runner/.stack/snapshots/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/pkgdb:/home/runner/.stack/programs/x86_64-linux/ghc-tinfo6-9.10.1/lib/ghc-9.10.1/lib/package.conf.d
# snapshot-install-root: /home/runner/.stack/snapshots/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1
# local-install-root: /home/runner/work/hledger/hledger/.stack-work/install/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1
# snapshot-doc-root: /home/runner/.stack/snapshots/x86_64-linux-tinfo6/a475558d986419ca16855615e08d0a95545a229cfbd26fe42e916bee9b2277d3/9.10.1/doc
# local-doc-root: /home/runner/work/hledger/hledger/.stack-work/install/x86_64-linux-tinfo6/a475558d986419ca16855615e08d0a95545a229cfbd26fe42e916bee9b2277d3/9.10.1/doc
# local-hoogle-root: /home/runner/work/hledger/hledger/.stack-work/hoogle/x86_64-linux-tinfo6/a475558d986419ca16855615e08d0a95545a229cfbd26fe42e916bee9b2277d3/9.10.1
# dist-dir: .stack-work/dist/x86_64-linux-tinfo6/ghc-9.10.1
# local-hpc-root: /home/runner/work/hledger/hledger/.stack-work/install/x86_64-linux-tinfo6/640e58090350012aaeacf3bb95988ba08dbaab0ce8ce8d2cb4b2ea0c5e7dd47b/9.10.1/hpc
# ACTIONS
# in modular steps for faster & more focussed failures
# XXX slow, I feel this should happen less often
# - name: Update package index
# run: |
# $stack update
# if: env.do-all
- name: Build deps of hledger-lib
run: |
$stack build --test --bench hledger-lib --only-dependencies
if: env.do-all
- name: Build/test hledger-lib
run: |
$stack install --test --bench hledger-lib --fast --ghc-options=-Werror
if: env.do-all
- name: Build deps of hledger
run: |
$stack build --test --bench hledger --only-dependencies
if: env.do-all
- name: Build/test hledger
run: |
$stack install --test --bench hledger --fast --ghc-options=-Werror
if: env.do-all
- name: Build deps of hledger-ui
run: |
$stack build --test --bench hledger-ui --only-dependencies
if: env.do-all
- name: Build/test hledger-ui
run: |
$stack install --test --bench hledger-ui --fast --ghc-options=-Werror
if: env.do-all
- name: Build deps of hledger-web
run: |
$stack build --test --bench hledger-web --only-dependencies
if: env.do-all
- name: Build/test hledger-web
run: |
$stack install --test --bench hledger-web --fast --ghc-options=-Werror
if: env.do-all
- name: Install shelltestrunner
run: |
export PATH=~/.local/bin:$PATH
# $stack update; $stack install --verbosity=error shelltestrunner-1.11
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install --verbosity=error shelltestrunner-1.11; fi
shelltest --version
if: env.do-all
# Takes ~30s on a 2023 github worker.
- name: Test functional tests (excluding addons)
run: |
export PATH=~/.local/bin:$PATH
COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected
# XXX run the bin/ func tests corresponding to the GHC version enabled above, only
if: env.do-all
# Takes 1m+ on a 2023 github worker.
# Moved to binaries-mac-arm64 workflow instead;
# haddock breakage might not be found until release time but it's easy to fix.
# - name: Test haddock generation
# env:
# stack: ${{ matrix.plan.stack }}
# run: |
# printf "haddock version: "; haddock --version
# time $stack build --fast --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs" || echo "HADDOCK FAILED, IGNORING"
# # --no-haddock-hyperlink-source is 25% faster
# # --no-print-missing-docs is 600% quieter
# if: env.do-all
# ARTIFACTS
# not much needed, but relatively cheap to save and occasionally useful for troubleshooting ?
- name: Gather binaries
id: exes
run: |
mkdir tmp
cd tmp
cp -P ~/.local/bin/hledger .
cp -P ~/.local/bin/hledger-ui .
cp -P ~/.local/bin/hledger-web .
strip hledger
strip hledger-ui
strip hledger-web
if: env.do-all
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: hledger-linux-x64
path: |
tmp/hledger
tmp/hledger-ui
tmp/hledger-web
if: env.do-all
# SNIPPETS
# how to set a context variable, and an attempt to make a nice artifact version suffix:
# echo "::set-output name=version::$(git branch --show-current | sed 's/-.*//')-$(git rev-parse --short HEAD)"
# - name: show stuff
# run: |
# if [[ -e ~/.local/bin ]]; then ls -lFRa ~/.local/bin; fi
# inspect available context info, per
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions.
# sample output: https://github.com/simonmichael/hledger/runs/1619227104
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
# - name: Dump job context
# env:
# JOB_CONTEXT: ${{ toJson(job) }}
# run: echo "$JOB_CONTEXT"
# - name: Dump steps context
# env:
# STEPS_CONTEXT: ${{ toJson(steps) }}
# run: echo "$STEPS_CONTEXT"
# - name: Dump runner context
# env:
# RUNNER_CONTEXT: ${{ toJson(runner) }}
# run: echo "$RUNNER_CONTEXT"
# - name: Dump strategy context
# env:
# STRATEGY_CONTEXT: ${{ toJson(strategy) }}
# run: echo "$STRATEGY_CONTEXT"
# - name: Dump matrix context
# env:
# MATRIX_CONTEXT: ${{ toJson(matrix) }}
# run: echo "$MATRIX_CONTEXT"

View File

@ -1,46 +0,0 @@
# Runs on push of a [0-9]* or r[0-9]* tag (to any branch ?)
# Creates a draft github release.
# See https://github.com/actions/create-release, still pretty rough as of 20200609.
# see also: https://github.com/marketplace/actions/tag-release-on-push-action
name: create release
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
# also: "The action does not seem to work for tags created before the workflow."
on:
push:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+-*'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Create Release (actions/create-release)
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: X.Y
# release_name: X.Y
# body: |
# CHANGE 1; CHANGE 2.
# https://hledger.org/release-notes.html#hledger-X-Y
# draft: true
# prerelease: true
- name: Create Release (softprops/action-gh-release)
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

154
.github/workflows/oldest.yml vendored Normal file
View File

@ -0,0 +1,154 @@
# TRIGGER: Runs on any push to oldest branch.
# ACTION: Builds and tests with stack and the oldest supported ghc.
name: oldest
on:
# When there's a push to the oldest branch, it runs in that branch.
push:
branches: [ oldest ]
# If manually triggered in github ui, it runs in master.
workflow_dispatch:
jobs:
oldest:
runs-on: ubuntu-24.04
# arch: x64
# image: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
env:
stack: stack --stack-yaml=stack96.yaml
ghcid: 9.6.6
steps:
- name: Check out
uses: actions/checkout@v4
# have to fetch everything for git describe for hledger's --version
with:
fetch-depth: 0
# CACHES
- name: Cache - stack global package db
id: stack-global
uses: actions/cache@v4
with:
path: ~/.stack
# XXX if stack.yaml is a symlink, this fails with
# Error: The template is not valid. .github/workflows/push.yml (Line: 103, Col: 14): hashFiles('**.yaml') failed.
# Fail to hash files under directory '/home/runner/work/hledger/hledger'
key: ${{ runner.os }}-x64-stack-global-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-global-${{ env.ghcid }}
- name: Cache - stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v4
with:
path: ~/.local/bin
key: ${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-programs-${{ env.ghcid }}
- name: Cache - .stack-work
uses: actions/cache@v4
with:
path: .stack-work
key: ${{ runner.os }}-x64-stack-work-${{ env.ghcid }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-x64-stack-work-${{ env.ghcid }}
- name: Cache - hledger-lib/.stack-work
uses: actions/cache@v4
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-lib-stack-work-${{ env.ghcid }}
- name: Cache - hledger/.stack-work
uses: actions/cache@v4
with:
path: hledger/.stack-work
key: ${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-stack-work-${{ env.ghcid }}
- name: Cache - hledger-ui/.stack-work
uses: actions/cache@v4
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-ui-stack-work-${{ env.ghcid }}
- name: Cache - hledger-web/.stack-work
uses: actions/cache@v4
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-x64-hledger-web-stack-work-${{ env.ghcid }}
# ACTIONS
# in modular steps for faster & more focussed failures
- name: Install GHC
run: |
$stack setup --install-ghc
- name: Build deps of hledger-lib
run: |
$stack build --test --bench hledger-lib --only-dependencies
- name: Build/test hledger-lib
run: |
$stack install --test --bench hledger-lib --fast --ghc-options=-Werror
- name: Build deps of hledger
run: |
$stack build --test --bench hledger --only-dependencies
- name: Build/test hledger
run: |
$stack install --test --bench hledger --fast --ghc-options=-Werror
- name: Build deps of hledger-ui
run: |
$stack build --test --bench hledger-ui --only-dependencies
- name: Build/test hledger-ui
run: |
$stack install --test --bench hledger-ui --fast --ghc-options=-Werror
- name: Build deps of hledger-web
run: |
$stack build --test --bench hledger-web --only-dependencies
- name: Build/test hledger-web
run: |
$stack install --test --bench hledger-web --fast --ghc-options=-Werror
# XXX disable until this is fixed: shelltest.hs:125:20: error:
# shelltestrunner > Not in scope: configFailFast
# shelltestrunner > Perhaps you meant configFastFail (imported from Test.Hspec.Core.Runner)
# - name: Install shelltestrunner
# run: |
# export PATH=~/.local/bin:$PATH
# $stack update; $stack install --verbosity=error shelltestrunner-1.11
# if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install --verbosity=error shelltestrunner-1.11; fi
# shelltest --version
# - name: Test functional tests (excluding addons)
# run: |
# export PATH=~/.local/bin:$PATH
# COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected
# # XXX run the bin/ func tests corresponding to the GHC version enabled above, only

228
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,228 @@
# TRIGGER: Runs when a release tag like "1.*" is pushed to the repo.
# XXX Triggers too much, eg for 1.x.99 dev tags; those releases must be deleted manually.
# ACTION: Creates/updates a draft release with binaries from the latest successful binaries-* runs.
# The main binaries* workflows should be completed before triggering this.
name: release
on:
push:
tags:
- '1.*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get artifact from latest successful binaries-windows-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
# https://github.com/dawidd6/action-download-artifact v3.1.4, unverified so needs to be whitelisted in repo settings
with:
# all the settings, for reference. The other steps below will be more concise.
#
# Optional, GitHub token, a Personal Access Token with `public_repo` scope if needed
# Required, if the artifact is from a different repo
# Required, if the repo is private a Personal Access Token with `repo` scope is needed or GitHub token in a job where the permissions `action` scope set to `read`
# github_token: ${{secrets.GITHUB_TOKEN}}
# Optional, workflow file name or ID
# If not specified, will be inferred from run_id (if run_id is specified), or will be the current workflow
workflow: binaries-windows-x64.yml
# Optional, will use specified workflow run
# use ${{ github.event.workflow_run.id }} when your action runs in a workflow_run event
# and wants to download from the triggering workflow run
# run_id: 1122334455
# If no workflow is set and workflow_search set to true, then the most recent workflow matching
# all other criteria will be looked up instead of using the current workflow
workflow_search: false
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
# Optional, will get head commit SHA
# pr: ${{github.event.pull_request.number}}
# Optional, no need to specify if PR is
# commit: ${{github.event.pull_request.head.sha}}
# Optional, will use the specified branch. Defaults to all branches
# branch: binaries-linux-x64
# Optional, defaults to all types
# event: push
# Optional, run number from the workflow
# run_number: 34
# Optional, uploaded artifact name,
# will download all artifacts if not specified
# and extract them into respective subdirectories
# https://github.com/actions/download-artifact#download-all-artifacts
# is treated as a regular expression if input name_is_regexp is true
# will download only those artifacts with a name that matches this regular expression
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
# name: artifact_name
# Optional, name is treated as a regular expression if set true
# name_is_regexp: true
# Optional, a directory where to extract artifact(s), defaults to the current directory
path: artifacts
# Optional, defaults to current repo
# repo: ${{ github.repository }}
# Optional, check the workflow run to whether it has an artifact
# then will get the last available artifact from the previous workflow
# default false, just try to download from the last one
# check_artifacts: false
# Optional, search for the last workflow run whose stored an artifact named as in `name` input
# default false
# search_artifacts: false
# Optional, choose to skip unpacking the downloaded artifact(s)
# default false
# windows artifact is just zipped, no need to repack
skip_unpack: true
# Optional, choose how to exit the action if no artifact is found
# can be one of:
# "fail", "warn", "ignore"
# default fail
# if_no_artifact_found: fail
# Optional, allow forks when searching for artifacts
# default true
allow_forks: false
- name: Get artifact from latest successful binaries-linux-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-linux-x64.yml
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-arm64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-arm64.yml
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-x64.yml
allow_forks: false
path: artifacts
- name: Inspect artifacts
shell: bash
run: |
ls -lRFh artifacts
# The unix files were
# 1. tarred to protect their executable permissions,
# 2. mandatorily zipped by actions/upload-artifact,
# 3. unzipped by dawidd6/action-download-artifact.
# Now we 4. gzip them - to be more unix-standard ?
# And 5. softprops/action-gh-release will mandatorily zip them again.
- name: Repack unix artifacts with gz
shell: bash
run: |
cd artifacts
mv */*.tar .
gzip *.tar
- name: Inspect artifacts
shell: bash
run: |
ls -lRFh artifacts
- name: Generate github release notes
# ghrelnotes's argument should be the release's main tag name, eg "1.40".
# XXX Currently it is actually like "refs/tags/hledger-1.40.99", requiring manual fixup.
run: |
doc/ghrelnotes ${{ github.ref }} >ghrelnotes.md
- name: Create release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # https://github.com/softprops/action-gh-release 2.0.5
# permissions:
# contents: write
with:
# https://github.com/softprops/action-gh-release?tab=readme-ov-file#-customizing
# body String Text communicating notable changes in this release
# body_path String Path to load text communicating notable changes in this release
# draft Boolean Indicator of whether or not this release is a draft
# prerelease Boolean Indicator of whether or not is a prerelease
# files String Newline-delimited globs of paths to assets to upload for release
# name String Name of the release. defaults to tag name
# tag_name String Name of a tag. defaults to github.ref
# fail_on_unmatched_files Boolean Indicator of whether to fail if any of the files globs match nothing
# repository String Name of a target repository in <owner>/<repo> format. Defaults to GITHUB_REPOSITORY env variable
# target_commitish String Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch.
# token String Secret GitHub Personal Access Token. Defaults to ${{ github.token }}
# discussion_category_name String If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "Managing categories for discussions in your repository."
# generate_release_notes Boolean Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes. See the GitHub docs for this feature for more information
# append_body Boolean Append to existing body instead of overwriting it
# make_latest String Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Can be true, false, or legacy. Uses GitHub api defaults if not provided
#
body_path: ghrelnotes.md
files: |
artifacts/*.zip
artifacts/*.tar.gz
fail_on_unmatched_files: true
draft: true
# snippets
# body: |
# ${{ fromJSON(steps.<step-id>.outputs.assets)[0].browser_download_url }}
# if you intend to run workflows on the release event (on: { release: { types: [published] } }),
# you need to use a personal access token for this action, as the default secrets.GITHUB_TOKEN does not trigger another workflow.
# - name: Make tarball
# shell: bash
# run: |
# outdir="target/${{ matrix.target }}/release"
# staging="jj-${{ github.event.release.tag_name }}-${{ matrix.target }}"
# mkdir "$staging"
# cp {README.md,LICENSE} "$staging/"
# if [ "${{ matrix.os }}" = "windows-2022" ]; then
# cp "$outdir/jj.exe" "$staging/"
# cd "$staging"
# 7z a "../$staging.zip" .
# echo "ASSET=$staging.zip" >> $GITHUB_ENV
# else
# cp "$outdir/jj" "$staging/"
# tar czf "$staging.tar.gz" -C "$staging" .
# echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
# fi
# https://github.com/marketplace/actions/safe-download-workflow-artifact
# https://github.com/actions/upload-artifact/issues/89#issuecomment-1194408215
# https://www.eliostruyf.com/retrieving-artifact-previous-github-actions-workflow/
# We have two workflows, one for building and one for releasing built artifacts upon a tag release.
# They're both summoned from one push event, and the release job waits for the other job:
# https://github.com/dawidd6/action-download-artifact/issues/245
# - name: version
# run: echo "::set-output name=version::$(./bin/azblogfilter --version)"
# id: version
# - name: release
# uses: actions/create-release@v1
# id: create_release
# with:
# draft: false
# prerelease: false
# release_name: ${{ steps.version.outputs.version }}
# tag_name: ${{ github.ref }}
# body_path: CHANGELOG.md
# env:
# GITHUB_TOKEN: ${{ github.token }}

View File

@ -1,330 +0,0 @@
# The main hledger integration test workflow.
# Builds warning free and runs unit/doc/functional/haddock/bench tests,
# using the GHC version(s) enabled below.
# It also uploads the binaries as a downloadable artifact for testers,
# and because why not having done all the work.
# Merging to master requires that this workflow's jobs ("86" at least) have passed.
name: test-linux-x64
# This workflow runs...
on:
# On master, when manually triggered.
workflow_dispatch:
# On master, on this schedule:
# schedule:
# - cron: "0 07 * * 0" # sunday midnight pacific
# On these dev branches, when pushed.
# To avoid double workflow execution, don't use these branches for pull requests.
# (https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/2)
push:
branches: [ simon, simon2 ]
# On pull request branches against these branches, when pushed.
pull_request:
branches: [ master ]
# Uncomment to run it only for changes to these paths: (but that could prevent merging)
# paths:
# - '.github/workflows/pushpull.yml'
# - 'stack*.yaml'
# - 'hledger-lib/**'
# - 'hledger/**'
# - 'hledger-ui/**'
# - 'hledger-web/**'
# - 'bin/*.hs'
# - 'examples/**'
# Or to ignore certain paths:
# # examples
# - '!**.journal'
# - '!**.j'
# - '!**.ledger'
# - '!**.csv'
# # docs
# - '!**.m4'
# - '!**.md'
# - '!**.1'
# - '!**.5'
# - '!**.info'
# - '!**.txt'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plan: # at least the check(s) required by master should be enabled
- { ghc: "810", stack: "stack --stack-yaml=stack8.10.yaml" } # oldest supported ghc
# - { ghc: "90" , stack: "stack --stack-yaml=stack.yaml" }
# - { ghc: "92" , stack: "stack --stack-yaml=stack9.2.yaml" } # newest supported ghc
steps:
- name: Check out
uses: actions/checkout@v2
# have to fetch everything for git describe for --version
with:
fetch-depth: 0
- name: Print debug output
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo $GITHUB_CONTEXT
# echo "$GITHUB_SHA"
# echo "$GITHUB_REF"
# echo "$GITHUB_HEAD_REF"
# echo "$GITHUB_BASE_REF"
# git log "$GITHUB_BASE_REF"..
# tools/commitlint "$GITHUB_BASE_REF"..
# keep synced in all workflows which do this
- name: Check commit messages
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
# For a push it will be: $BEFORE..
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
env:
BEFORE: ${{ github.event.before }}
# NUM: 5
shell: bash
run: |
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:-}
echo "debug: last 10 commits:"
echo "$(git log --format='%h -%d %s (%an, %ci)' -10)"
echo "debug: origin/master:"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 origin/master)"
echo "debug: BEFORE=$BEFORE"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 $BEFORE)"
echo "debug: GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
echo "$(git log --format='%h -%d %s (%an, %ci)' -1 $GITHUB_HEAD_REF)"
echo "debug: RANGE=$RANGE"
echo "debug: commits to check:"
echo "$(git log --format='%h -%d %s (%an, %ci)' --abbrev-commit --date=relative --date-order $RANGE)"
if git rev-list --quiet $RANGE
then tools/commitlint $RANGE
else echo "could not identify commits, not checking them"
# echo "could not identify commits, checking last $NUM instead:"
# tools/commitlint -$NUM
fi
- name: Skip remaining steps if last commit message begins with ;
shell: bash
run: |
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
(git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog \
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)) \
|| ( echo "could not identify commit range, continuing CI steps"; echo "CONTINUE=true" >> $GITHUB_ENV )
# things to be cached/restored:
- name: Cache stack global package db
id: stack-global
uses: actions/cache@v2
with:
path: ~/.stack
# XXX if stack.yaml is a symlink, this fails with
# Error: The template is not valid. .github/workflows/push.yml (Line: 103, Col: 14): hashFiles('**.yaml') failed.
# Fail to hash files under directory '/home/runner/work/hledger/hledger'
key: ${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache .stack-work
uses: actions/cache@v2
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-work-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache hledger-lib/.stack-work
uses: actions/cache@v2
with:
path: hledger-lib/.stack-work
key: ${{ runner.os }}-hledger-lib-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('hledger-lib/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-lib-stack-work-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache hledger/.stack-work
uses: actions/cache@v2
with:
path: hledger/.stack-work
key: ${{ runner.os }}-hledger-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('hledger/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-stack-work-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache hledger-ui/.stack-work
uses: actions/cache@v2
with:
path: hledger-ui/.stack-work
key: ${{ runner.os }}-hledger-ui-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('hledger-ui/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-ui-stack-work-${{ matrix.plan.ghc }}
if: env.CONTINUE
- name: Cache hledger-web/.stack-work
uses: actions/cache@v2
with:
path: hledger-web/.stack-work
key: ${{ runner.os }}-hledger-web-stack-work-${{ matrix.plan.ghc }}-${{ hashFiles('hledger-web/package.yaml') }}
restore-keys: |
${{ runner.os }}-hledger-web-stack-work-${{ matrix.plan.ghc }}
if: env.CONTINUE
# actions:
- name: Install stack
run: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
stack --version
if: env.CONTINUE
- name: Install GHC
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack setup --install-ghc
if: env.CONTINUE
- name: Install haskell deps
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack build --test --bench --only-dependencies --dry-run
$stack build --test --bench --only-dependencies
if: env.CONTINUE
# - name: Build all hledger modules warning free, optimised and minimised, run unit/doc/bench tests
# env:
# stack: ${{ matrix.plan.stack }}
# run: |
# $stack install --test --bench --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --ghc-options=-split-sections --no-terminal
# # build quicker when tweaking ci: $stack install --ghc-options=-Werror --ghc-options=-split-sections --no-terminal
# # -split-sections shrinks binaries by 30% on average here
# # --pedantic --no-run-benchmarks
# if: env.CONTINUE
# Packages are built one at a time to fail faster on error.
# Note: doctests won't run if using GHC 9.0, see hledger-lib/package.yaml
- name: Build all hledger modules fast, warning free, run unit/doc/bench tests
env:
stack: ${{ matrix.plan.stack }}
run: |
$stack install --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --test --bench hledger-lib
$stack install --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --test --bench hledger
$stack install --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --test --bench hledger-ui
$stack install --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --test --bench hledger-web
# --ghc-options=-split-sections --no-terminal
if: env.CONTINUE
- name: Install shelltestrunner
env:
stack: ${{ matrix.plan.stack }}
run: |
export PATH=~/.local/bin:$PATH
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.9; fi
shelltest --version
if: env.CONTINUE
- name: Test functional tests (excluding addons)
env:
stack: ${{ matrix.plan.stack }}
run: |
export PATH=~/.local/bin:$PATH
COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons
# XXX run the bin/ func tests corresponding to the GHC version enabled above, only
if: env.CONTINUE
- name: Test haddock generation
env:
stack: ${{ matrix.plan.stack }}
run: |
time $stack build --fast --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs"
# --no-haddock-hyperlink-source is 25% faster
# --no-print-missing-docs is 600% quieter
if: env.CONTINUE
- name: Gather binaries
id: exes
run: |
mkdir tmp
cd tmp
cp -P ~/.local/bin/hledger .
cp -P ~/.local/bin/hledger-ui .
cp -P ~/.local/bin/hledger-web .
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
if: env.CONTINUE
# how to set a context variable, and an attempt to make a nice artifact version suffix:
# echo "::set-output name=version::$(git branch --show-current | sed 's/-.*//')-$(git rev-parse --short HEAD)"
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.tar
if: env.CONTINUE
# - name: show stuff
# run: |
# if [[ -e ~/.local/bin ]]; then ls -lFRa ~/.local/bin; fi
# inspect available context info, per
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions.
# sample output: https://github.com/simonmichael/hledger/runs/1619227104
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
# - name: Dump job context
# env:
# JOB_CONTEXT: ${{ toJson(job) }}
# run: echo "$JOB_CONTEXT"
# - name: Dump steps context
# env:
# STEPS_CONTEXT: ${{ toJson(steps) }}
# run: echo "$STEPS_CONTEXT"
# - name: Dump runner context
# env:
# RUNNER_CONTEXT: ${{ toJson(runner) }}
# run: echo "$RUNNER_CONTEXT"
# - name: Dump strategy context
# env:
# STRATEGY_CONTEXT: ${{ toJson(strategy) }}
# run: echo "$STRATEGY_CONTEXT"
# - name: Dump matrix context
# env:
# MATRIX_CONTEXT: ${{ toJson(matrix) }}
# run: echo "$MATRIX_CONTEXT"

162
.github/workflows/testbin.yml vendored Normal file
View File

@ -0,0 +1,162 @@
# TRIGGER: Runs when triggered manually.
# ACTION: Uploads binaries from the latest successful binaries-* runs to the current "testbin" prerelease.
# Should not change anything else about the prerelease.
name: testbin
on:
workflow_dispatch:
# push:
jobs:
publish-binaries:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Alternative:
# just ghruns-download
- name: Get artifact from latest successful binaries-windows-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
# https://github.com/dawidd6/action-download-artifact v3.1.4, unverified so needs to be whitelisted in repo settings
with:
workflow: binaries-windows-x64.yml
# Optional, will use specified workflow run
# use ${{ github.event.workflow_run.id }} when your action runs in a workflow_run event
# and wants to download from the triggering workflow run
# run_id: 1122334455
# If no workflow is set and workflow_search set to true, then the most recent workflow matching
# all other criteria will be looked up instead of using the current workflow
workflow_search: false
# Optional, the status or conclusion of a completed workflow to search for
# Can be one of a workflow conclusion:
# "failure", "success", "neutral", "cancelled", "skipped", "timed_out", "action_required"
# Or a workflow status:
# "completed", "in_progress", "queued"
# Use the empty string ("") to ignore status or conclusion in the search
workflow_conclusion: success
# Optional, will get head commit SHA
# pr: ${{github.event.pull_request.number}}
# Optional, no need to specify if PR is
# commit: ${{github.event.pull_request.head.sha}}
# Optional, will use the specified branch. Defaults to all branches
# branch: binaries-linux-x64
# Optional, defaults to all types
# event: push
# Optional, run number from the workflow
# run_number: 34
# Optional, uploaded artifact name,
# will download all artifacts if not specified
# and extract them into respective subdirectories
# https://github.com/actions/download-artifact#download-all-artifacts
# is treated as a regular expression if input name_is_regexp is true
# will download only those artifacts with a name that matches this regular expression
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
# name: artifact_name
# Optional, name is treated as a regular expression if set true
# name_is_regexp: true
# Optional, a directory where to extract artifact(s), defaults to the current directory
path: artifacts
# Optional, defaults to current repo
# repo: ${{ github.repository }}
# Optional, check the workflow run to whether it has an artifact
# then will get the last available artifact from the previous workflow
# default false, just try to download from the last one
# check_artifacts: false
# Optional, search for the last workflow run whose stored an artifact named as in `name` input
# default false
# search_artifacts: false
# Optional, choose to skip unpacking the downloaded artifact(s)
# default false
# windows artifact is just zipped, no need to repack
skip_unpack: true
# Optional, choose how to exit the action if no artifact is found
# can be one of:
# "fail", "warn", "ignore"
# default fail
# if_no_artifact_found: fail
# Optional, allow forks when searching for artifacts
# default true
allow_forks: false
- name: Get artifact from latest successful binaries-linux-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-linux-x64.yml
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-arm64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-arm64.yml
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-x64.yml
allow_forks: false
path: artifacts
- name: Inspect artifacts
shell: bash
run: |
ls -lRFh artifacts
# The unix files were
# 1. tarred to protect their executable permissions,
# 2. mandatorily zipped by actions/upload-artifact,
# 3. unzipped by dawidd6/action-download-artifact.
# Now we 4. gzip them.
- name: Gzip unix tarballs
shell: bash
run: |
cd artifacts
mv */*.tar .
gzip *.tar
- name: Inspect artifacts
shell: bash
run: |
ls -lRFh artifacts
# The testbin prerelease should already exist; this should only update its artifacts.
# Alternative:
# gh release upload {{ VER }} tmp/hledger-linux-x64.tar.gz
# gh release upload {{ VER }} tmp/hledger-mac-arm64.tar.gz
# gh release upload {{ VER }} tmp/hledger-mac-x64.tar.gz
# gh release upload {{ VER }} tmp/hledger-windows-x64.zip
- name: Upload artifacts to testbin prerelease
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # https://github.com/softprops/action-gh-release 2.0.5
# permissions:
# contents: write
with:
tag_name: testbin
files: |
artifacts/*.zip
artifacts/*.tar.gz
fail_on_unmatched_files: true
prerelease: true
# body_path: ghrelnotes-nightly.md
#
# https://github.com/softprops/action-gh-release?tab=readme-ov-file#-customizing
# body String Text communicating notable changes in this release
# body_path String Path to load text communicating notable changes in this release
# draft Boolean Indicator of whether or not this release is a draft
# prerelease Boolean Indicator of whether or not is a prerelease
# files String Newline-delimited globs of paths to assets to upload for release
# name String Name of the release. defaults to tag name
# tag_name String Name of a tag. defaults to github.ref
# fail_on_unmatched_files Boolean Indicator of whether to fail if any of the files globs match nothing
# repository String Name of a target repository in <owner>/<repo> format. Defaults to GITHUB_REPOSITORY env variable
# target_commitish String Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch.
# token String Secret GitHub Personal Access Token. Defaults to ${{ github.token }}
# discussion_category_name String If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "Managing categories for discussions in your repository."
# generate_release_notes Boolean Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes. See the GitHub docs for this feature for more information
# append_body Boolean Append to existing body instead of overwriting it
# make_latest String Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Can be true, false, or legacy. Uses GitHub api defaults if not provided

130
.gitignore vendored
View File

@ -1,9 +1,14 @@
# For troubleshooting: git check-ignore -v --no-index PATHS
# misc stuff # misc stuff
_* _*
*~ *~
*.o *.o
\#* \#*
.\#* .\#*
.trash
*.gz
*.zip
# dev stuff # dev stuff
.build .build
@ -14,30 +19,9 @@ _*
.vscode .vscode
tags tags
TAGS TAGS
/debug.log .obsidian
/tools/pandoc-demote-headers stylish-haskell.yaml
/tools/pandoc-drop-html-blocks *.m4-e
/tools/pandoc-drop-html-inlines
/tools/pandoc-drop-links
/tools/pandoc-drop-notes
/tools/pandoc-drop-toc
/tools/generatetimeclock
# Tricksy rules ignoring some typical temp files.
# For troubleshooting: git check-ignore --verbose PATHS...
# 1- or 2-character filenames, maybe with an extension; but not directories
[a-z0-9]
[a-z0-9].*
[a-z0-9][a-z0-9]
[a-z0-9][a-z0-9].*
![a-z0-9]/
![a-z0-9].*/
![a-z0-9][a-z0-9]/
![a-z0-9][a-z0-9].*/
# files/directories beginning with a number
/[0-9]*
*.j
*.sw[op]
# haskell stuff # haskell stuff
*.dyn_hi *.dyn_hi
@ -45,6 +29,7 @@ TAGS
*.hi *.hi
*.p_o *.p_o
*.hp *.hp
*.prof
package.yaml-e package.yaml-e
.cabal-sandbox/ .cabal-sandbox/
cabal-dev* cabal-dev*
@ -53,31 +38,35 @@ cabal.sandbox.config
dist/ dist/
dist-newstyle/ dist-newstyle/
.ghc.environment.* .ghc.environment.*
stack*.yaml.lock
.stack-work/
/Shake /Shake
/.shake.html /.shake.html
.stack-work/
/lsp/
Setup Setup
modules*.svg
packages*.svg
/*.packages
/headroom-templates
.headroom.yaml
# hledger stuff # ignore typical test file names (but not dirs)
old
/.old /[0-9]*
/log !/[0-9]*/
/profs/*
/*.prof.* [a-z0-9]
/bin/** ![a-z0-9]/
!/bin/*.hs
!/bin/*.sh [a-z0-9][a-z0-9]
!/bin/*.md ![a-z0-9][a-z0-9]/
/.latest.*
hledger/test/addons/hledger-* /[a-z0-9].*
tools/generatejournal ![a-z0-9].*/
tools/simplebench
/examples/[1-9]0*.journal /[a-z0-9][a-z0-9].*/
*.webmanual.md ![a-z0-9][a-z0-9].*/
*.m4-e
stack*.yaml.lock /test*
bench
# hledger-web stuff # hledger-web stuff
/config /config
@ -87,15 +76,48 @@ bench
hledger-web/static/tmp/ hledger-web/static/tmp/
hledger-web/yesod-devel/ hledger-web/yesod-devel/
.hledger-web_client_session_key.aes .hledger-web_client_session_key.aes
/hledger-web/demo/
# sandstorm stuff # hledger stuff
.vagrant #*.webmanual.md
*.spk old
.old
/log
*.log
/profs/*
/*.prof.*
/tmp
/bench*
# recent stuff #/bin - see bin/.gitignore
/commands
/.obsidian /examples
/.github/workflows/README #/examples/[1-9]*.journal
/hledger/test/cli/addons
/hledger/hledger.md
/hledger-ui/hledger-ui.md
/hledger-web/hledger-web.md
/tools/generatejournal
/tools/relnotes
/tools/simplebench
/tools/pandoc-demote-headers
/tools/pandoc-drop-html-blocks
/tools/pandoc-drop-html-inlines
/tools/pandoc-drop-links
/tools/pandoc-drop-notes
/tools/pandoc-drop-toc
/tools/generatetimeclock
/hledger-lib/test/doctests
/examples/edk-hledger-ui-mobile.gif
/examples/tty-ui-1.gif
/site/**
!/site/src/*.md
/finance
/examples/demo/
/doc/ghrelnotes.md
/doc/RELEASING2.md
/checks /checks
/headroom-templates /tools/docshelltest
.headroom.yaml .latest.*
.github/workflows/ci-arm.yml

182
.mailmap
View File

@ -1,14 +1,170 @@
Clint Adams <clint@softwarefreedom.org> <clint@debian.org> # sort -f
Marko Kocić <marko.kocic@gmail.com> Aerex <nanaus13@yahoo.com>
Marko Kocić <marko.kocic@gmail.com> <marko@euptera.com> afarrow <afarrow@users.noreply.github.com>
Michael Snoyman <michael@snoyman.com> agander <agander@gmail.com>
Nick Ingolia <nick@ingolia.org> Aiken Cairncross <acairncross@gmail.com>
Mykola Orliuk <virkony@gmail.com> Alan Young <harleypig@harleypig.com>
Oliver Braun <ob@obraun.net> Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Ryan Desfosses <ryan@desfo.org> <rdesfo@users.noreply.github.com> Aleksandar Dimitrov <git@aleks.bg>
Sergei Trofimovich <siarheit@google.com> <slyfox@community.haskell.org> Alex Chen <awchen@ucalgary.ca>
Thomas R. Koll <tomk32@gmail.com> <tomk32@tomk32.de> Alex Hirzel <alex@hirzel.us>
Tim Docker <tim@dockerz.net> Alvaro Fernando García <alvarofernandogarcia@gmail.com>
Trygve Laugstøl <trygvis@inamo.no> Amarandus <carl.schneider+github@ruhr-uni-bochum.de>
Xinruo Sun <xiaoruoruo@gmail.com> Amitai Burstein <amitai@gizra.com>
Andreas Pauley <andreas@pauley.org.za>
Andrew Jones <ascjones@gmail.com>
Andrew Lelechenko <andrew.lelechenko@gmail.com>
Andriy Mykhaylyk <erp.lsf@gmail.com>
aragaer <aragaer@gmail.com>
Arjen Langebaerd <alangebaerd@gmail.com>
Arnout Engelen <arnout@bzzt.net>
Arsen Arsenović <arsen@aarsen.me>
awjchen <awjchen@users.noreply.github.com>
Ben Boeckel <mathstuf@gmail.com>
Ben Creasy <ben@bencreasy.com>
bobobo1618 <bobobo1618@users.noreply.github.com>
Boyd Kelly <bkelly@coastsystems.net>
Brian Scott <briananthonyscott@gmail.com>
Brian Wignall <brianwignall@gmail.com>
Bryan Richter <bryan.richter@gmail.com>
Caleb Maclennan <caleb@alerque.com>
Carel Fellinger <cfellinger@users.noreply.github.com>
Carl Richard Theodor Schneider <carl.schneider@ruhr-uni-bochum.de>
Carlos Lopez-Camey <c.lopez@kmels.net>
Charlie Ambrose <C.Ambrose@iinet.net.au>
Charlotte Van Petegem <charlotte.vanpetegem@ugent.be>
charukiewicz <charukiewicz@protonmail.com>
Chris Lemaire <c.lemaire@student.tudelft.nl>
Christian G. Warden <cwarden@xerus.org>
Christoph Nicolai <mail@christoph-nicolai.de>
Clint Adams <clint@debian.org> <clint@softwarefreedom.org>
Colin Woodbury <colin@fosskers.ca>
crocket <748856+crocket@users.noreply.github.com>
Damien Cassou <damien@cassou.me>
Daniel Gröber <dxld@darkboxed.org>
David D Lowe <daviddlowe.flimm@gmail.com>
David Reaver <johndreaver@gmail.com>
David Zhang <crispgm@gmail.com>
Dmitry Astapov <dastapov@gmail.com>
Dominik Süß <dominik.suess@outlook.at>
Doug Goldstein <cardoe@cardoe.com>
Eli Flanagan <eli@typedspace.com>
Elijah Caine <elijahcainemv@gmail.com>
Eric Kow <eric.kow@gmail.com>
Eric Mertens <emertens@galois.com> <emertens@gmail.com>
Everett Hildenbrandt <hildenb2@illinois.edu>
Evilham <cvs@evilham.com>
Felix Van der Jeugt <felix.vanderjeugt@posteo.net>
Felix Yan <felixonmars@archlinux.org>
flip111 <flip101@gmail.com>
Fun Ilrys (Nissar Chababy) <contact@funilrys.com>
Gabriel Ebner <gebner@gebner.org>
Gaith Hallak <gaithhallak@gmail.com>
Garret McGraw <jetaimed@gmail.com>
Gergely Risko <errge@nilcons.com>
gwern <gwern@gwern.net> <gwern0@gmail.com> gwern <gwern@gwern.net> <gwern0@gmail.com>
Hans-Peter Deifel <hpd@hpdeifel.de>
Henning Thielemann <git@henning-thielemann.de>
Ilja Kocken <i.j.kocken@uu.nl>
Imuli <i@imu.li>
J. B. Rainsberger <me@jbrains.ca>
Jacek Generowicz <jacg@my-post-office.net>
Jacob Weisz <inbox@jacobweisz.com>
Jakob Schöttl <jschoett@gmail.com>
Jakub Zárybnický <kubaz@inuits.eu> <jakub.zarybnicky@inuits.eu>
Jan Zerebecki <jan@zerebecki.de>
Jay Neubrand <jneubrand@users.noreply.github.com>
Jeff Richards <jeff@jrichards.ca>
Jesse Rosenthal <jrosenthal@jhu.edu>
Joachim Breitner <mail@joachim-breitner.de>
Joaquin "Florius" Azcarate <j@florius.com.ar>
Joe Horsnell <github@joehorsnell.com>
Johann Klähn <kljohann@gmail.com>
Johannes Gerer <oss@johannesgerer.com>
John Wiegley <johnw@newartisans.com>
Jonathan Dowland <jon@dow.land>
Joseph Weston <joseph@weston.cloud>
Joshua Chia <joshchia@gmail.com>
Joshua Kehn <josh@kehn.us>
Judah Jacobson <judah.jacobson@gmail.com>
Julien Moutinho <julm+hledger@autogeree.net>
jungle-boogie <sean@jungleboogie.me>
Justin Le <mstksg@gmail.com> <justin@jle.im>
Kyle Marek-Spartz <kyle.marekspartz@govdelivery.com>
Lawrence Wu <lawrencejwu@gmail.com>
legrostdg <gueux+github@gueux.org>
Luca Molteni <volothamp@gmail.com>
Léo Gaspard <leo@gaspard.io>
M Parker <mparker17@users.noreply.github.com>
Malte Brandy <malte.brandy@maralorn.de>
Mark Hansen <mark@markhansen.co.nz>
Marko Kocić <marko@euptera.com>
Marko Kocić <marko@euptera.com> marko.kocic <marko.kocic@gmail.com>
Martin Michlmayr <tbm@cyrius.com>
Mateus Furquim <mfurquim@users.noreply.github.com>
Matthias Kauer <mk.software@zuez.org>
Max Bolingbroke <batterseapower@hotmail.com>
Max Thomas <max@maxthomas.io>
Michael Grünewald <mail@michaelgruenewald.eu>
Michael Kainer <kaini@pushrax.com>
Michael Snoyman <michael@snoyman.com>
Michael Walker <mike@barrucadu.co.uk>
Mick Dekkers <mickdekkersnl@gmail.com>
Mitchell Rosen <mitchellwrosen@gmail.com>
Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Mykola Orliuk <virkony@gmail.com>
Nadrieril <nadrieril@gmail.com>
Nicholas Niro <blowfist@xroutine.net>
Nick Ingolia <nick@ingolia.org>
Nicolas Wavrant <nicolas.wavrant@gmail.com>
Nikhil Jha <nikhiljha@users.noreply.github.com>
Nissar Chababy <contact@funilrys.com>
Nolan Darilek <nolan@thewordnerd.info>
ob <ob@obraun.net>
Omari Norman <omari@smileystation.com>
Patrick Fiaux <patrick@fiaux.dev>
Patrik Keller <git@pkel.dev>
Pavan Rikhi <pavan.rikhi@gmail.com>
Pavlo Kerestey <pavlo@kerestey.net>
Peter Sagerson <psagers@ignorare.net>
Peter Simons <simons@cryp.to>
Philipp Klocke <Phil_K97@gmx.de>
Pia Mancini <piamancini@gmail.com>
Pranesh Prakash <the.solipsist@gmail.com>
Rick Lupton <r.lupton@gmail.com>
Robert Nielsen <32415800+RobertNielsen1@users.noreply.github.com>
Roman Cheplyaka <roma@ro-che.info>
Rui Chen <chenrui333@gmail.com>
Ryan Desfosses <rdesfo@users.noreply.github.com>
Ryan Desfosses <ryan@desfo.org>
S. Zeid <s@zeid.me>
Sam Doshi <sam@metal-fish.co.uk>
Sam Jeeves <sam.jeeves@live.com>
Sam Jeeves <sam.jeeves@live.com>
Samuel May <ag.eitilt@gmail.com>
Sergei Trofimovich <slyfox@community.haskell.org> <siarheit@google.com>
Sergey Astanin <s.astanin@gmail.com>
ShrykeWindgrace <shryke.windgrace@gmail.com>
Shubham Lagwankar <shubhu105@gmail.com>
Simon Hengel <sol@typeful.net>
Sam Almahri <sam.salmahri@gmail.com>
Simon Michael <simon@joyful.com> <azure-pipelines[bot]@users.noreply.github.com>
Simon Michael <simon@joyful.com> <webmaster@joyful.com>
SpicyCat <yanglingit@outlook.com>
Stefano Rodighiero <stefano.rodighiero@gmail.com>
Stephen Morgan <morgan.stephen99@gmail.com> <Xitian9@users.noreply.github.com>
Steven R. Baker <steven@stevenrbaker.com>
TANIGUCHI Kohei <cohey@taniguchikohei-MacBook-Air.local>
Thomas R. Koll <tomk32@tomk32.de> <tomk32@gmail.com>
Tim Docker <tim@dockerz.net>
Timofey ZAKREVSKIY <timofey.zakrevskiy@3ds.com>
toonn <toonn@toonn.io>
Trevor Riles <trevor@riles.io>
Trygve Laugstøl <trygvis@inamo.no>
Vladimir Sorokin <vsorokin87@gmail.com>
Vladimir Zhelezov <zhelezov@gmail.com>
Wad <wad209@users.noreply.github.com>
Xinruo Sun <xiaoruoruo@gmail.com>
Yann Büchau <nobodyinperson@posteo.de>
Yehoshua Pesach Wallach <yehoshuapw@gmail.com>
zieone <42358507+zieone@users.noreply.github.com>

View File

@ -7,6 +7,6 @@
- Navigate your terminal to your local hledger repository folder - Navigate your terminal to your local hledger repository folder
- Run `vagrant-spk vm up` - Run `vagrant-spk vm up`
- Run `vagrant-spk dev` to run the app in Sandstorm dev mode - Run `vagrant-spk dev` to run the app in Sandstorm dev mode
- Visit http://local.sandstorm.io:6080 in your browser to see changes and test - Visit http://local.sandstorm.io:6090 in your browser to see changes and test
- Press Ctrl-C to exit dev mode - Press Ctrl-C to exit dev mode
- Run `vagrant-spk pack hledger.spk` to create the Sandstorm package file - Run `vagrant-spk pack hledger.spk` to create the Sandstorm package file

View File

@ -1,6 +1,8 @@
# -*- mode: ruby -*- # -*- mode: ruby -*-
# vi: set ft=ruby : # vi: set ft=ruby :
# CAUTION: DO NOT MAKE CHANGES TO THIS FILE. The vagrant-spk upgradevm process will overwrite it.
# Guess at a reasonable name for the VM based on the folder vagrant-spk is # Guess at a reasonable name for the VM based on the folder vagrant-spk is
# run from. The timestamp is there to avoid conflicts if you have multiple # run from. The timestamp is there to avoid conflicts if you have multiple
# folders with the same name. # folders with the same name.
@ -17,9 +19,10 @@ unless Vagrant::DEFAULT_SERVER_URL.frozen?
end end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Base on the Sandstorm snapshots of the official Debian 9 (stretch) box with vboxsf support. # Base on a 64-bit Debian box with vboxsf support (ex. contrib-buster64, bullseye64)
config.vm.box = "debian/contrib-stretch64" config.vm.box = "debian/bookworm64"
config.vm.box_version = "9.3.0" config.vm.post_up_message = "Your virtual server is running at: http://local.sandstorm.io:6090"
if Vagrant.has_plugin?("vagrant-vbguest") then if Vagrant.has_plugin?("vagrant-vbguest") then
# vagrant-vbguest is a Vagrant plugin that upgrades # vagrant-vbguest is a Vagrant plugin that upgrades
@ -28,12 +31,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# needs to know how to compile kernel modules, etc., and so # needs to know how to compile kernel modules, etc., and so
# we give it this hint about operating system type. # we give it this hint about operating system type.
config.vm.guest = "debian" config.vm.guest = "debian"
config.vbguest.auto_update = false
end end
# We forward port 6080, the Sandstorm web port, so that developers can # We forward port 6090, the vagrant-spk web port, so that developers can
# visit their sandstorm app from their browser as local.sandstorm.io:6080 # visit their Sandstorm app from their browser as local.sandstorm.io:6090
# (aka 127.0.0.1:6080). # (aka 127.0.0.1:6090).
config.vm.network :forwarded_port, guest: 6080, host: 6080, host_ip: "127.0.0.1" config.vm.network :forwarded_port, guest: 6090, host: 6090, host_ip: "127.0.0.1"
# Use a shell script to "provision" the box. This installs Sandstorm using # Use a shell script to "provision" the box. This installs Sandstorm using
# the bundled installer. # the bundled installer.
@ -58,12 +62,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
cpus = `nproc`.to_i cpus = `nproc`.to_i
total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i
elsif host =~ /mingw/ elsif host =~ /mingw/
# powershell may not be available on Windows XP and Vista, so wrap this in a rescue block cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
begin total_kB_ram = `powershell -Command "[math]::Round((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory)"`.to_i / 1024
cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024
rescue
end
end end
# Use the same number of CPUs within Vagrant as the system, with 1 # Use the same number of CPUs within Vagrant as the system, with 1
# as a default. # as a default.
@ -80,7 +80,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if total_kB_ram.nil? or total_kB_ram < 2048000 if total_kB_ram.nil? or total_kB_ram < 2048000
assign_ram_mb = 512 assign_ram_mb = 512
else else
assign_ram_mb = (total_kB_ram / 1024 / 2) assign_ram_mb = (total_kB_ram / 1024 / 4)
end end
# Actually apply these CPU/memory values to the providers. # Actually apply these CPU/memory values to the providers.
config.vm.provider :virtualbox do |vb, override| config.vm.provider :virtualbox do |vb, override|
@ -91,7 +91,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# /opt/app and /host-dot-sandstorm are used by vagrant-spk # /opt/app and /host-dot-sandstorm are used by vagrant-spk
override.vm.synced_folder "..", "/opt/app" override.vm.synced_folder "..", "/opt/app"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm" override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", mount_options: ["x-systemd.automount"]
# /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the # /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the
# line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want. # line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want.
override.vm.synced_folder "..", "/vagrant", disabled: true override.vm.synced_folder "..", "/vagrant", disabled: true

View File

@ -1,3 +1,8 @@
# V1.31 (2023-10-20)
* Upgrade to HLedger 1.31
* Add support for sharing permissions
# V1.9.2 (2018-06-05) # V1.9.2 (2018-06-05)
* Upgrade to HLedger 1.9.2 * Upgrade to HLedger 1.9.2

View File

@ -2,4 +2,4 @@ hledger (http://hledger.org) is a dependable, precise, cross-platform program fo
In double-entry accounting, each transaction must be balanced: An equal amount added to one account must be subtracted from another. You may wish to consult hledger documentation or other tutorials on the web to learn how to use double-entry accounting. In double-entry accounting, each transaction must be balanced: An equal amount added to one account must be subtracted from another. You may wish to consult hledger documentation or other tutorials on the web to learn how to use double-entry accounting.
Sandstorm users, thanks for your feedback. hledger's web UI is a simple one to fit current development resources, and I'm sorry that Sandstorm integration is lacking. Your help is needed. We have an open issue for this where you can add a bounty or contribute patches (https://github.com/simonmichael/hledger/issues/425). We also welcome bug reports with more detail (http://bugs.hledger.org/new), general hledger-web improvements, backers and sponsors (http://hledger.org). We welcome bug reports with more detail (http://bugs.hledger.org/new), general hledger-web improvements, backers and sponsors (http://hledger.org).

View File

@ -1,6 +1,9 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
# CAUTION: DO NOT MAKE CHANGES TO THIS FILE. The vagrant-spk upgradevm process will overwrite it.
# App-specific setup should be done in the setup.sh file.
# Set options for curl. Since we only want to show errors from these curl commands, we also use # Set options for curl. Since we only want to show errors from these curl commands, we also use
# 'cat' to buffer the output; for more information: # 'cat' to buffer the output; for more information:
# https://github.com/sandstorm-io/vagrant-spk/issues/158 # https://github.com/sandstorm-io/vagrant-spk/issues/158
@ -9,9 +12,13 @@ CURL_OPTS="--silent --show-error"
echo localhost > /etc/hostname echo localhost > /etc/hostname
hostname localhost hostname localhost
# Install curl that is needed below. # Grub updates don't silent install well
apt-mark hold grub-pc
apt-get update apt-get update
apt-get install -y curl apt-get upgrade -y
# Install curl needed below, and gnupg for package signing
apt-get install -y curl gnupg
# The following line copies stderr through stderr to cat without accidentally leaving it in the # The following line copies stderr through stderr to cat without accidentally leaving it in the
# output file. Be careful when changing. See: https://github.com/sandstorm-io/vagrant-spk/pull/159 # output file. Be careful when changing. See: https://github.com/sandstorm-io/vagrant-spk/pull/159
@ -27,7 +34,7 @@ if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then
fi fi
if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then
echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..." echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null bash /host-dot-sandstorm/caches/install.sh -d -e -p 6090 "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null
echo "...done." echo "...done."
fi fi
modprobe ip_tables modprobe ip_tables
@ -38,6 +45,10 @@ usermod -a -G 'sandstorm' 'vagrant'
sudo sed --in-place='' \ sudo sed --in-place='' \
--expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \ --expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
/opt/sandstorm/sandstorm.conf /opt/sandstorm/sandstorm.conf
# Force vagrant-spk to use the strict CSP, see sandstorm#3424 for details.
echo 'ALLOW_LEGACY_RELAXED_CSP=false' >> /opt/sandstorm/sandstorm.conf
sudo service sandstorm restart sudo service sandstorm restart
# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP # Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3) GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)

View File

@ -29,4 +29,4 @@ set -euo pipefail
mkdir -p /var/lib/hledger mkdir -p /var/lib/hledger
touch /var/lib/hledger/Ledger touch /var/lib/hledger/Ledger
cd /var cd /var
hledger-web --capabilities-header=X-Sandstorm-Permissions --serve --base-url='' -f /var/lib/hledger/Ledger --port 8000 hledger-web --allow=sandstorm --serve --base-url='' -f /var/lib/hledger/Ledger --port 8000

View File

@ -2,56 +2,37 @@
# This file is automatically updated and rewritten in sorted order every time # This file is automatically updated and rewritten in sorted order every time
# the app runs in dev mode. You may manually add or remove files, but don't # the app runs in dev mode. You may manually add or remove files, but don't
# expect comments or ordering to be retained. # expect comments or ordering to be retained.
bin/bash bin
bin/mkdir
bin/touch
etc/gai.conf etc/gai.conf
etc/ld.so.cache etc/ld.so.cache
etc/localtime etc/localtime
lib/terminfo/d/dumb lib
lib/x86_64-linux-gnu/ld-2.24.so lib64
lib/x86_64-linux-gnu/libc-2.24.so
lib/x86_64-linux-gnu/libc.so.6
lib/x86_64-linux-gnu/libdl-2.24.so
lib/x86_64-linux-gnu/libdl.so.2
lib/x86_64-linux-gnu/libgcc_s.so.1
lib/x86_64-linux-gnu/libm-2.24.so
lib/x86_64-linux-gnu/libm.so.6
lib/x86_64-linux-gnu/libncurses.so.5
lib/x86_64-linux-gnu/libncurses.so.5.9
lib/x86_64-linux-gnu/libnsl-2.24.so
lib/x86_64-linux-gnu/libnsl.so.1
lib/x86_64-linux-gnu/libnss_compat-2.24.so
lib/x86_64-linux-gnu/libnss_compat.so.2
lib/x86_64-linux-gnu/libnss_files-2.24.so
lib/x86_64-linux-gnu/libnss_files.so.2
lib/x86_64-linux-gnu/libnss_nis-2.24.so
lib/x86_64-linux-gnu/libnss_nis.so.2
lib/x86_64-linux-gnu/libpcre.so.3
lib/x86_64-linux-gnu/libpcre.so.3.13.3
lib/x86_64-linux-gnu/libpthread-2.24.so
lib/x86_64-linux-gnu/libpthread.so.0
lib/x86_64-linux-gnu/librt-2.24.so
lib/x86_64-linux-gnu/librt.so.1
lib/x86_64-linux-gnu/libselinux.so.1
lib/x86_64-linux-gnu/libtinfo.so.5
lib/x86_64-linux-gnu/libtinfo.so.5.9
lib/x86_64-linux-gnu/libutil-2.24.so
lib/x86_64-linux-gnu/libutil.so.1
lib/x86_64-linux-gnu/libz.so.1
lib/x86_64-linux-gnu/libz.so.1.2.8
lib64/ld-linux-x86-64.so.2
opt/app/.sandstorm/launcher.sh opt/app/.sandstorm/launcher.sh
proc/cpuinfo proc/cpuinfo
sandstorm-http-bridge sandstorm-http-bridge
sandstorm-http-bridge-config sandstorm-http-bridge-config
sandstorm-manifest sandstorm-manifest
usr/bin/bash
usr/bin/mkdir
usr/bin/touch usr/bin/touch
usr/lib/terminfo/d/dumb
usr/lib/x86_64-linux-gnu/gconv/UTF-32.so usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
usr/lib/x86_64-linux-gnu/libffi.so.6 usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
usr/lib/x86_64-linux-gnu/libc.so.6
usr/lib/x86_64-linux-gnu/libgmp.so.10 usr/lib/x86_64-linux-gnu/libgmp.so.10
usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2 usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
usr/lib/x86_64-linux-gnu/libm.so.6
usr/lib/x86_64-linux-gnu/libpcre2-8.so.0
usr/lib/x86_64-linux-gnu/libpcre2-8.so.0.11.2
usr/lib/x86_64-linux-gnu/libselinux.so.1
usr/lib/x86_64-linux-gnu/libtinfo.so.6
usr/lib/x86_64-linux-gnu/libtinfo.so.6.4
usr/lib/x86_64-linux-gnu/libz.so.1
usr/lib/x86_64-linux-gnu/libz.so.1.2.13
usr/lib64/ld-linux-x86-64.so.2
usr/local/bin/hledger-web usr/local/bin/hledger-web
usr/share/zoneinfo/Etc/UTC
usr/share/zoneinfo/GMT usr/share/zoneinfo/GMT
usr/share/zoneinfo/GMT+0 usr/share/zoneinfo/GMT+0

View File

@ -17,11 +17,11 @@ const pkgdef :Spk.PackageDefinition = (
# This manifest is included in your app package to tell Sandstorm # This manifest is included in your app package to tell Sandstorm
# about your app. # about your app.
appTitle = (defaultText = "HLedger Web"), appTitle = (defaultText = "Hledger Web"),
appVersion = 3, # Increment this for every release. appVersion = 5, # Increment this for every release.
appMarketingVersion = (defaultText = "1.9.2"), appMarketingVersion = (defaultText = "1.31"),
# Human-readable representation of appVersion. Should match the way you # Human-readable representation of appVersion. Should match the way you
# identify versions of your app in documentation and marketing. # identify versions of your app in documentation and marketing.
@ -48,13 +48,14 @@ const pkgdef :Spk.PackageDefinition = (
# https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp
icons = ( icons = (
# Various icons to represent the app in various contexts. # Various icons to represent the app in various contexts.
# XXX better to use the coins image from https://hledger.org probably. Must it be svg ?
appGrid = (svg = embed "appGrid.svg"), appGrid = (svg = embed "appGrid.svg"),
grain = (svg = embed "grain.svg"), grain = (svg = embed "grain.svg"),
market = (svg = embed "market.svg"), market = (svg = embed "market.svg"),
#marketBig = (svg = embed "path/to/market-big-300x300.svg"), #marketBig = (svg = embed "path/to/market-big-300x300.svg"),
), ),
website = "http://hledger.org", website = "https://hledger.org",
# This should be the app's main website url. # This should be the app's main website url.
codeUrl = "https://github.com/simonmichael/hledger", codeUrl = "https://github.com/simonmichael/hledger",
@ -92,7 +93,7 @@ const pkgdef :Spk.PackageDefinition = (
# Further details including how to set up GPG and how to use keybase.io can be found # Further details including how to set up GPG and how to use keybase.io can be found
# at https://docs.sandstorm.io/en/latest/developing/publishing-apps/#verify-your-identity # at https://docs.sandstorm.io/en/latest/developing/publishing-apps/#verify-your-identity
upstreamAuthor = "HLedger Team", upstreamAuthor = "Hledger Team",
# Name of the original primary author of this app, if it is different from the person who # Name of the original primary author of this app, if it is different from the person who
# produced the Sandstorm package. Setting this implies that the author connected to the PGP # produced the Sandstorm package. Setting this implies that the author connected to the PGP
# signature only "packaged" the app for Sandstorm, rather than developing the app. # signature only "packaged" the app for Sandstorm, rather than developing the app.
@ -204,41 +205,38 @@ const pkgdef :Spk.PackageDefinition = (
description = (defaultText = "grants ability to append transactions to the ledger"), description = (defaultText = "grants ability to append transactions to the ledger"),
), ),
( (
name = "manage", name = "edit",
title = (defaultText = "manage"), title = (defaultText = "edit"),
description = (defaultText = "grants ability to modify or replace the entire ledger"), description = (defaultText = "grants ability to modify transactions and directives or erase the entire ledger"),
), ),
], ],
roles = [ roles = [
# Roles are logical collections of permissions. For instance, your app may have # Roles are logical collections of permissions. For instance, your app may have
# a "viewer" role and an "editor" role # a "viewer" role and an "editor" role
( (
title = (defaultText = "manager"),
# Name of the role. Shown in the Sandstorm UI to indicate which users have which roles. # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.
title = (defaultText = "viewer"),
permissions = [true, true, true],
# An array indicating which permissions this role carries. # An array indicating which permissions this role carries.
# It should be the same length as the permissions array in # It should be the same length as the permissions array in
# viewInfo, and the order of the lists must match. # viewInfo, and the order of the lists must match.
permissions = [true, false, false],
verbPhrase = (defaultText = "has full access to the ledger"),
# Brief explanatory text to show in the sharing UI indicating # Brief explanatory text to show in the sharing UI indicating
# what a user assigned this role will be able to do with the grain. # what a user assigned this role will be able to do with the grain.
verbPhrase = (defaultText = "can view the ledger"),
description = (defaultText = "managers can modify the ledger in any way."),
# Prose describing what this role means, suitable for a tool tip or similar help text. # Prose describing what this role means, suitable for a tool tip or similar help text.
description = (defaultText = "viewers can only view the ledger."),
),
(
title = (defaultText = "adder"),
permissions = [true, true, false],
verbPhrase = (defaultText = "can append new transactions"),
description = (defaultText = "adders can view the ledger and add new transactions to it."),
), ),
( (
title = (defaultText = "editor"), title = (defaultText = "editor"),
permissions = [true, true, false], permissions = [true, true, true],
verbPhrase = (defaultText = "can append new transactions"), verbPhrase = (defaultText = "has full access to the ledger"),
description = (defaultText = "editors can view the ledger or append new transactions to it."), description = (defaultText = "editors can change or erase transactions and directives."),
),
(
title = (defaultText = "viewer"),
permissions = [true, false, false],
verbPhrase = (defaultText = "can view the ledger"),
description = (defaultText = "viewers can only view the ledger."),
), ),
], ],
), ),
@ -256,6 +254,7 @@ const myCommand :Spk.Manifest.Command = (
environ = [ environ = [
# Note that this defines the *entire* environment seen by your app. # Note that this defines the *entire* environment seen by your app.
(key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"), (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
(key = "HOME", value = "/var/lib/hledger"),
(key = "SANDSTORM", value = "1"), (key = "SANDSTORM", value = "1"),
# Export SANDSTORM=1 into the environment, so that apps running within Sandstorm # Export SANDSTORM=1 into the environment, so that apps running within Sandstorm
# can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use # can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use

View File

@ -22,4 +22,4 @@ set -euo pipefail
# By default, this script does nothing. You'll have to modify it as # By default, this script does nothing. You'll have to modify it as
# appropriate for your application. # appropriate for your application.
apt-get install -y libtinfo-dev apt-get install -y libtinfo-dev
curl -ssl https://get.haskellstack.org/ | sh curl -ssl -L https://get.haskellstack.org/ | sh

View File

@ -1 +1 @@
1.27.1 1.51.99

2
.vscode/notebooks/README.md vendored Normal file
View File

@ -0,0 +1,2 @@
Some VS Code notebooks. Viewing these requires VS Code and extensions
GitHub Issue Notebooks, REST Book.

File diff suppressed because one or more lines are too long

57
.vscode/notebooks/issues.github-issues vendored Normal file
View File

@ -0,0 +1,57 @@
[
{
"kind": 1,
"language": "markdown",
"value": "# hledger issues notebook\n\n- https://hledger.org/ISSUES.html\n\n<!-- -->\n- https://github.com/microsoft/vscode-github-issue-notebooks#readme\n- https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests\n- https://docs.github.com/en/search-github/getting-started-with-searching-on-github/sorting-search-results"
},
{
"kind": 1,
"language": "markdown",
"value": "## hledger repo"
},
{
"kind": 2,
"language": "github-issues",
"value": "$repo=repo:simonmichael/hledger\n$repo is:open sort:created-desc"
},
{
"kind": 1,
"language": "markdown",
"value": "## hledger_site repo"
},
{
"kind": 2,
"language": "github-issues",
"value": "repo:simonmichael/hledger_site is:open sort:created-desc"
},
{
"kind": 1,
"language": "markdown",
"value": "## hledger_finance repo"
},
{
"kind": 2,
"language": "github-issues",
"value": "repo:simonmichael/hledger_finance is:open sort:created-desc"
},
{
"kind": 1,
"language": "markdown",
"value": "## hledger mentions in other projects"
},
{
"kind": 2,
"language": "github-issues",
"value": "-repo:simonmichael/hledger -repo:simonmichael/hledger_site -repo:simonmichael/hledger_finance hledger is:open sort:created-desc"
},
{
"kind": 1,
"language": "markdown",
"value": "## other plaintextaccounting mentions in other projects\n(should exclude things already found by \"hledger\", doesn't)"
},
{
"kind": 2,
"language": "github-issues",
"value": "-repo:simonmichael/hledger -repo:simonmichael/hledger_site -repo:simonmichael/hledger_finance plaintextaccounting -hledger -repo:commercialhaskell/stack is:open sort:created-desc"
}
]

View File

@ -1,33 +0,0 @@
## Achievements
Some project achievements to unlock!
> *Being a software maintainer means unending toil in mostly-obscurity, so you've got to seek out the fun where you can!*
<!-- https://www.reddit.com/r/haskell/comments/eddwbu/top_nonprogrammingrelated_haskell_apps -->
- ~~1.0 release~~
- ~~packaged in major distros, binaries available~~
- ~~pretty good reference docs~~
- ~~100 committers~~
- ~~1k github stars~~
- ~~among top 50 starred haskell projects on github~~
- ~~discussed on Hacker News~~
- ~~match ledger IRC channel size~~
- ~~mentioned in "what good Haskell software exists" discussions~~
- ~~among top 40 starred haskell projects on github~~
- ~~multiple people providing support~~
- ~~pretty good tutorial docs~~
- ~~pretty good cookbook docs~~
- ~~100 IRC chatters~~
- ~~2k github stars~~
- **in top 30 github starred haskell projects**
- **match ledger speed**
- **match ledger committers**
- **200 committers**
- **[best in class for investment tracking](https://github.com/simonmichael/hledger/issues/1015)**
- **2.0 release**
- **in top 20 github starred haskell projects**
- **match ledger stars**
- **match beancount mail list**
- **match ledger mail list**
- **in top 10 github starred haskell projects**

View File

@ -1,365 +0,0 @@
* BACKLOG.org
#+OPTIONS: -:nil \n:t H:9
An efficient public store of tasks/changes/design notes, mostly from
SM's private backlog; things that I/we feel would be nice to have, or
investigate further.
Here, they all compost nicely in the sun.
Some items are out of date and just need to be re-tested and discarded.
All help is welcome.
See also:
- http://wishes.hledger.org and http://bugs.hledger.org
- https://hledger.org/mockups.html
- https://hledger.org/ROADMAP.html
Some items may render best when viewed in Emacs org mode.
# Dummy second level heading to ensure only the topics appear in site's page TOC:
** Topics:
*** wip
**** move items here from SM's private backlog
*** cli
**** help: clarify/improve the various kinds of command line help
***** survey/describe
Most of these are long, and best viewed with a pager, eg: hledger -h | less
****** Quick command line help:
#+begin_example
hledger -h|--help
hledger-ui -h|--help
hledger-web -h|--help
General usage and command line flags for the main hledger UIs.
hledger
hledger CLI's commands list.
hledger COMMAND -h|--help
COMMAND's usage, flags, and manual section.
#+end_example
****** User manuals:
#+begin_example
hledger help [-i|-m|-p] [TOPIC]
View hledger user manual with info, man or pager, positioned at TOPIC.
Good for jumping to a known (or guessed) topic.
Good for viewing the manual if you don't have info or man.
This is the main manual, covering the CLI, file formats, and concepts.
hledger --info
hledger-ui --info
hledger-web --info
hledger, hledger-ui or hledger-web's builtin user manual, viewed with info.
Best for exploring the topic tree.
hledger --man
hledger-ui --man
hledger-web --man
hledger, hledger-ui or hledger-web's builtin user manual, viewed with man.
Quick and searchable.
info hledger, man hledger
info hledger-ui, man hledger-ui
info hledger-web, man hledger-web
hledger, hledger-ui, or hledger-web installed user manuals.
Same as above, if the manuals are properly installed on your system.
https://hledger.org/hledger.html
https://hledger.org/hledger-ui.html
https://hledger.org/hledger-web.html
hledger, hledger-ui and hledger-web manuals, viewed on the web.
Best for comfortable viewing and navigation when online.
#+end_example
**** help improvements
***** auto pager
***** colour
***** show commands to get more detailed help
***** list output formats
***** list input formats
***** list runtime-detected input formats
***** more intro/manual in the main --help
***** commands list updates
Financial reports:
aregister (areg) show an account's transactions and running balance
register (reg) show postings in all/matched accounts and their total
balancesheet (bs) show assets, liabilities and net worth
balancesheetequity (bse) show assets, liabilities and equity
cashflow (cf) show changes in liquid assets
incomestatement (is) show revenues and expenses
balance (bal) show custom balance reports, budgets, gains..
roi show a return on investment report
***** --pivot: list possible arguments in help
**** --version: include latest commit date
**** --version: include git branch name if not master ?
**** disable colors when writing to .txt file ?
**** trailing colon makes alias ineffective
`--alias expenses:personal:=expenses:`
**** unclear error if a trailing slash is written after file name
shell completion might wrongly add a trailing slash, eg as with this symlink,
resulting in this unclear error:
~/notes$ stats -f current.journal/
hledger: SourcePos {sourceName = "/Users/simon/.sm/notes/current.journal/", sourceLine = Pos 9, sourceColumn = Pos 1} reading /Users/simon/.sm/notes/current.journal/2018.prices:
/Users/simon/current.journal/2018.prices: openFile: inappropriate type (Not a directory)
**** -h/--help should work even with unrecognised flags/missing args
***** hledger --help ui --watch
***** hledger ui --watch --help
***** hledger --nosuchflag --help
***** hledger nosuchcommand --help
****** not expected to work; hledger --help nosuchcommand does work
****** unify hledger --help & hledger COMMAND --help more ?
**** @ does not expand file names, eg @~/somefile
**** bad --width parse error
$ hledger -f examples/sample.journal reg -w 80,-1
hledger: could not parse width option: ParseErrorBundle {bundleErrors = TrivialError 3 (Just (Tokens ('-' :| ""))) (fromList [Label ('d' :| "igit")]) :| [], bundlePosState = PosState {pstateInput = "80,-1", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "(unknown)", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}} (use -h to see usage)
**** balance assertion error shows ugly transaction
hledger: balance assertion error in "/Users/simon/notes/2018.journal" (line 4949, column 54):
in transaction:
Transaction {tindex = 976, tsourcepos = JournalSourcePos "/Users/simon/notes/2018.journal" (4948,4950), tdate = 2018-09-01, tdate2 = Nothing, tstatus = *, tcode = "5VN72122C99690620", tdescription = "add funds to paypal", tcomment = "for:, time:06:53:51, type:Bank Deposit to PP Account , status:Pending, balance:6.99, gross:6.99, fee:0.00\n", ttags = [("for",""),("time","06:53:51"),("type","Bank Deposit to PP Account"),("status","Pending"),("balance","6.99"),("gross","6.99"),("fee","0.00")], tpostings = [PostingPP {pdate="Nothing", pdate2="Nothing", pstatus="", paccount="assets:personal:online:paypal", pamount=Mixed [Amount {acommodity = "$", aquantity = 6.99, aprice = NoPrice, astyle = AmountStylePP "L False 2 Just '.' Nothing..", amultiplier = False}], pcomment="", ptype=RegularPosting, ptags=[], pbalanceassertion=Just (Amount {acommodity = "$", aquantity = 6.99, aprice = NoPrice, astyle = AmountStylePP "L False 2 Just '.' Nothing..", amultiplier = False},GenericSourcePos "/Users/simon/notes/2018.journal" 4949 54), ptransaction=Just "<txn>", porigin=Nothing},PostingPP {pdate="Nothing", pdate2="Nothing", pstatus="", paccount="assets:personal:bank:wf:checking", pamount=Mixed [Amount {acommodity = "$", aquantity = -6.99, aprice = NoPrice, astyle = AmountStylePP "L False 2 Just '.' Nothing..", amultiplier = False}], pcomment="", ptype=RegularPosting, ptags=[], pbalanceassertion=Nothing, ptransaction=Just "<txn>", porigin=Nothing}], tpreceding_comment_lines = ""}
after posting:
assets:personal:online:paypal $6.99
balance assertion details:
date: 2018/09/01
account: assets:personal:online:paypal
commodity: $
calculated: $-93.01
asserted: $6.99 (difference: +$100.00)
**** color support like stack's (still a few things remaining)
***** http://no-color.org/ color should not be added by default if the `NO_COLOR` environment variable is present.
***** Existing global option `--color=WHEN` is now also available as a
non-project-specific yaml configuration parameter `color:`.
***** Adopt the standard proposed at http://no-color.org/, that color should
not be
added by default if the `NO_COLOR` environment variable is present.
***** New command `stack ls stack-colors` lists the styles and the associated
'ANSI'
control character sequences that stack uses to color some of its output.
See
`stack ls stack-colors --help` for more information.
***** New global option `--stack-colors=STYLES`, also available as a
non-project-specific yaml configuration parameter, allows a stack user to
redefine the default styles that stack uses to color some of its output.
See
`stack --help` for more information.
***** British English spelling of 'color' (colour) accepted as an alias for
`--color`, `--stack-colors`, `stack ls stack-colors` at the command line
and
for `color:` and `stack-colors:` in yaml configuration files.
**** generate commands list more dynamically from command docs
***** names, aliases, descriptions
**** inconsistent repeated options behaviour: -b 1/1 -b 2/1 should use the last date & be documented
**** pass -- -h/--help through to tasty
**** underquoted $ gives "empty list" error
$ bal --budget ^sm:exp date:jan -M cur:\$ --tree
Budget performance in 2019/01:
hledger: Prelude.maximum: empty list
**** 1275 drop/depth error message followup
Two commands:
$ hledger bal --drop '-999999999999999'
$ hledger bal --drop='-999999999999999'
Current output:
hledger: could not parse drop number: --depth=999999999999999 (use -h to see usage)
hledger: argument to drop must lie in the range 0 to 9223372036854775807, but is -999999999999999 (use -h to see usage)
My proposal would look like:
hledger: drop's argument '--depth=999999999999999' must be a positive integer less than 9223372036854775807
hledger: drop's argument '-999999999999999' must be a positive integer less than 9223372036854775807
Variations:
hledger: drop's argument '-999999999999999' must be a positive integer less than 2^63
hledger: drop's argument '-999999999999999' must between 0 and 2^63
hledger: drop's argument '-999999999999999' should be 0 <= N < 2^63
**
**** do recompile stack script addon if source is newer
ie, change:
$ hledger check-tag-files # compiles if there's no compiled version
**** drop abbreviation uniqueness requirement ?
**** get actions from https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46
**** group common options as in CliOptions.reportflags
**** hledger: "date:monday-" gave a date parse error ()
**** http://neilmitchell.blogspot.com/2020/07/automatic-uis-for-command-lines-with.html
**** improve error message:
hledger: balance assignments cannot be used with accounts which are
posted to by transaction modifier rules (auto postings).
Please write the posting amount explicitly, or remove the rule.
**** red color is bad on powershell navy background
```
Guest72
Hi, does anybody know how to change the negative value color in powershell. It's drakred and almost not readable on the dark blue background
f-a
not sure, but meanwhile using --color=never could help
Guest72
better than dark red ;)
```
**** show an extra newline after txt reports, for better display when showing one after another
**** show name of reader responsible for a parse error
**** ugly --alias parse error
$ bal --alias a
hledger: parse error at ParseErrorBundle {bundleErrors = TrivialError 1 (Just EndOfInput) (fromList [Tokens ('=' :| "")]) :| [], bundlePosState = PosState {pstateInput = "a", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "--alias a", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}}
**** ugly parse error from malformed --width argument
ghci> :main areg sm.*foo -w 350,50,50
Transactions in sm:assets:foo and subaccounts:
2020-01-01 *** Exception: could not parse width option: ParseErrorBundle {bundleErrors = TrivialError 6 (Just (Tokens (',' :| ""))) (fromList [Label ('d' :| "igit"),EndOfInput]) :| [], bundlePosState = PosState {pstateInput = "350,50,50", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "(unknown)", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}} (use -h to see usage)
**** non-empty standard input activates -f- if there is no explicit -f ?
**** --invert should be supported by all commands
**** --positive flips signs of normally negative accounts (liabilities, revenues, equity)
so eg both revenues and expenses sections of income statement are positive
**** --pivot should work with all hledger tools (ui, web, api..)
**** warn about missing command rather than "unknown flag"
~$ hledger-0.27.1 -f src/hledger/data/sample.journal -D date:2008/01
hledger-0.27.1: Unknown flag: -D
**** balance assertion error improvements
***** show assertions in transaction
2016/04/01 * refill negative budget envelopes (personal)
[assets:personal:bank:wf:checking:month:gifts] $69.56 = 0
[assets:personal:bank:wf:checking:month:food] $97.58 = 0
[assets:personal:bank:wf:checking:month:personal care] $80.00 = $1
[assets:personal:bank:wf:checking:available] $-247.14
***** show line/column number of assertion
***** show indication inline
2016/04/01 * refill negative budget envelopes (personal)
[assets:personal:bank:wf:checking:month:gifts] $69.56 = 0
[assets:personal:bank:wf:checking:month:food] $97.58 = 0 <- failed, calculated: $7.12 (difference: +$7.12)
[assets:personal:bank:wf:checking:month:personal care] $80.00 = $1
[assets:personal:bank:wf:checking:available] $-247.14
**** consistent/more headings for options
**** don't immediately convert auto-balancing amounts to the price's commodity
***** discuss on #ledger
***** example
1/1
a E4 @ $1
b ; <- should fill in -E4 @ $1 instead of -$4
**** ignore inapplicable common flags when harmless, eg --width
**** --help, --info after +RTS and/or -- should be passed through
**** --unreal opposite of --real
**** --pivot cleanups
https://github.com/simonmichael/hledger/pull/323#issuecomment-185631456
***** add --pivot to add-on option lists
***** move pivot example to its own section
**** reports should indicate whether each item has hidden subitems (and possibly include them in the report)
**** show abnormal-sign balances in red (rather than negative numbers)
**** split up output formats by command
**** html reports
***** add html output to other reports
****** register
****** postings
***** add --view to open browser ?
***** add detailed mode or report generating register for each cell
*** compat
**** compat: support reading with beancount2ledger when in PATH
**** compat: support reading with ledger2beancount & beancount2ledger when in PATH
*** doc
**** doc: quickstart: update download instructions, make maintainable
**** CONTRIBUTING: a github API script to generate the open issues table with issue counts
**** automate CREDITS updating
***** ./Shake credits
***** github commit links
***** github issue links
***** github images
**** a nice HISTORY page (higher level view of commits)
***** automate
****** ./Shake history
**** doc: house mortgage
Chris Leyon, Ledger list 2021:
The entry for my house purchase looks like this:
2014-12-18 Buy house
Assets:Fixed:House $445,000.00 ; Selling price of house
Assets:Current:XYZ Bank:Checking $455.76
Expenses:Interest:Mortgage Interest $390.60
Expenses:Taxes:Property Tax $282.49 ; Current qtr taxes
Expenses:Taxes:Property Tax $2,154.00 ; Next qtr taxes
Expenses:Utilities:Sewer $18.45 ; Current qtr sewer
Expenses:Utilities:Sewer $141.48 ; Next qtr sewer
Expenses:House:Warranty $32.10
Liabilities:Loans:Mortgage Principal $-427,750.00 ; PV of mortgage at t=0
Assets:Current:XYZ Bank:Savings $-20,500.00 ; Down payment
Assets:Current:AnAssetAccount $-5,001.37 ; More money down
Assets:Current:Escrow $960.49
Expenses:House:Settlement $440.00 ; Origination charges
Expenses:House:Settlement $325.00 ; Appraisal fee
Expenses:House:Settlement $75.00 ; Tax service
Expenses:House:Settlement $50.00 ; Appraisal management
Expenses:House:Settlement $2,301.00 ; Title services and lender's title insurance
Expenses:House:Settlement $105.00 ; Owner's title insurance
Expenses:House:Settlement $220.00 ; Government recording charge
Expenses:House:Settlement $300.00 ; Survey
This establishes the "Liabilities:Loans:Mortgage Principal" account which tracks the loan balance. "Assets:Fixed:House" can be used to calculate your equity (as in home equity, not an equity account type). Various charges need to be paid at closing time: title fees, current and next quarter taxes, utility services, etc. It also categorizes "Expenses:Interest:Mortgage Interest" as a separate category from other types of interest, for tax purposes. Finally, it also seeds the "Assets:Current:Escrow" account which is the source account for paying all sorts of property tax and insurance expenses.
A monthly mortgage payment might look like this:
2015-03-23=2015-04-01 (1000) Loan Servicing Company
Liabilities:Loans:Mortgage Principal $585.63
Liabilities:Loans:Mortgage Principal $100.00 ; Pay a little extra principal every month
Expenses:Interest:Mortgage Interest $909.08
Assets:Current:Escrow $1,024.48
Assets:Current:XYZ Bank:Checking $-2,619.19
This set up has tracked my mortgage payments and balances for several years, down to the penny.
**** hledger manual: toc: why are OUTPUT, PIVOTING not clickable ?
*** entry
**** entry command
***** a convenient non-interactive version of hledger add; and an extension point for data entry validations/automations
hledger entry [ONELINEENTRY]
***** ONELINEENTRY is a single argument, in quotes: a journal entry using double-space instead of newlines
hledger entry '2021-01-01 * (123) farmers market expenses:food $10 assets:checking ; date:1/3'
***** or with no argument, each line from standard input generates a journal entry
***** with -a|--add, appends to the journal, like add/import
***** if entry does not begin with a date, uses today's date
hledger entry 'farmers market expenses:food $10 assets:cash'
***** if any other required parts are omitted, they are filled from similar past transactions, like add
These will match the txn above, and make the postings shown:
hledger entry 'farmers' # expenses:food $10, assets:cash -$10
hledger entry 'farmers expenses:food $11' # expenses:food $11, assets:cash -$11
hledger entry 'farmers $11' # same
hledger entry 'farmers 11' # same
hledger entry 'farmers expenses:food 6 expenses:snacks 5' # expenses:food $6, expenses:snacks $5, assets:cash -$11
***** leaf names of known accounts will be expanded
hledger entry 'farmers food 6 snacks 5' # same
***** missing commodity symbol could also be inferred from source account's balance
***** or with a flag, missing required parts will give an error
****** --complete, --only, --standalone, --no-infer, --no-past, --no-journal
***** entry can run validation checks, including fancy ones like "asset accounts may not go negative"
*** ops
**** new hledger.org vps
*** pkg
**** need build-tools section in our package.yaml files to avoid build errors with happy etc. ?
cf https://github.com/haskell/cabal/issues/5867#issuecomment-967280170
*** process
**** refine RELEASING doc/process
**** automate changelog finalisation
**** automate release note generation
****
*** reports
**** reports: allow -c '0.%' to set style of -%
**** reports: relax the "whole subperiods" rule
***** when there's only one ?
bal -YH -e tomorrow would be titled with tomorrow's date instead of 12-31
***** when there's multiple, but no transactions before the begin date or after the end date ?
*** timeclock
**** timeclock: improve error message
hledger: clock-out time less than clock-in time in:
2021-09-17 * 12:00-06:00
(no-electronics) -6.00h
**** timeclock: ugly parse error
hledger: line 6: expected timeclock code o but got i
CallStack (from HasCallStack):
error, called at ./Hledger/Data/Timeclock.hs:85:32 in hledger-lib-1.22.99-HCWXy7WanhBI3o1AfvBpXy:Hledger.Data.Timeclock
*** timedot
**** timedot: more flexible parsing
***** ignore all preamble lines (before first date line)
***** ignore all amountless lines
***** ignore org list bullets/checkboxes
***** check timedotstrict: disables ignoring preamble/amountless lines
**** timedot: --alias doesn't work with timeclock, timedot ?

2
CHANGES Normal file
View File

@ -0,0 +1,2 @@
General project changes are in doc/CHANGES.md.
Package-specific changes are in hledger*/CHANGES.md.

View File

@ -1,248 +0,0 @@
# Contributor Guide
<div class=pagetoc>
<!-- toc -->
</div>
This doc is intended to become a focussed guide for new contributors.
If you are unexpectedly seeing this page after following a link,
the content probably moved to a separate page:
see the [Developer docs](dev.md).
## Quick Links
| | |
|-------------------------------|----------------------------------------------------------------------------
| Chat, Mail, Twitter, HN etc. | <https://hledger.org/support.html>
| hledger-web demo&nbsp;&nbsp; | [demo.hledger.org](https://demo.hledger.org)
| hledger GHCJS demo | <https://hledger.alhur.es>
| Trello | [old wishlist planning board](https://trello.hledger.org)
| Github | [simonmichael/hledger](https://github.com/simonmichael/hledger) (shortcut: code.hledger.org)<br> [commits](https://github.com/simonmichael/hledger/commits), <!-- [unreleased commits](https://github.com/simonmichael/hledger/compare/0.23...master), [release branch commits](https://github.com/simonmichael/hledger/compare/master...0.23), --> [COMMITS!](https://starlogs.net/#simonmichael/hledger) <br> [ci.hledger.org](http://ci.hledger.org) <br> [open bugs](http://bugs.hledger.org), [open wishes](http://wishes.hledger.org), [open unknowns](https://github.com/simonmichael/hledger/issues?utf8=✓&q=is%3Aissue%20is%3Aopen%20-label%3A%22A%20BUG%22%20-label%3A%22A%20WISH%22%20), [open pull requests](http://prs.hledger.org), [draft open pull requests](http://draftprs.hledger.org), [ready open pull requests](http://readyprs.hledger.org), [all issues](https://github.com/simonmichael/hledger/issues?q=) <br> [issues with bounty tag](https://github.com/simonmichael/hledger/issues?q=label:bounty), [bountysource bounties](https://github.com/simonmichael/hledger/issues?q=%22Add%20to%20the%20bounty%20at%20Bountysource%22%20OR%20%22claim%20the%20bounty%20on%20Bountysource%22%20OR%20%22bounty%20on%20this%20issue%20has%20been%20claimed%20at%20Bountysource%22%20), [codemill bounties](https://github.com/simonmichael/hledger/issues?q=codemill), [codefund bounties](https://github.com/simonmichael/hledger/issues?utf8=✓&q=codefund) <br> [projects.hledger.org](http://projects.hledger.org) <br> [stars.hledger.org](http://stars.hledger.org): <a class="github-button" href="https://github.com/simonmichael/hledger" data-icon="octicon-star" data-count-href="/simonmichael/hledger/stargazers" data-count-api="/repos/simonmichael/hledger#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star simonmichael/hledger on GitHub"></a> our rank among starred haskell projects:<br>2016: #71, 2017: #54, 2018: #53, 2020: #36, 2022: #34
| Hackage | <a name=hackage></a>packages: [hledger-lib](https://hackage.haskell.org/package/hledger-lib), [hledger](https://hackage.haskell.org/package/hledger), [hledger-ui](https://hackage.haskell.org/package/hledger-ui), [hledger-web](https://hackage.haskell.org/package/hledger-web), [hledger-diff](https://hackage.haskell.org/package/hledger-diff), [hledger-iadd](https://hackage.haskell.org/package/hledger-iadd), [hledger-interest](https://hackage.haskell.org/package/hledger-interest), [hledger-irr](https://hackage.haskell.org/package/hledger-irr), [\*hledger\*](https://hackage.haskell.org/packages/search?terms=hledger) <!-- [![...](https://img.shields.io/hackage/v/hledger.svg?label=current+release)](https://hackage.haskell.org/package/hledger) --> <br> diffs: [hledger-lib](https://hdiff.luite.com/cgit/hledger-lib/diff), [hledger](https://hdiff.luite.com/cgit/hledger/diff), [hledger-ui](https://hdiff.luite.com/cgit/hledger-ui/diff), [hledger-web](https://hdiff.luite.com/cgit/hledger-web/diff) <br> build status: [hledger-lib](https://matrix.hackage.haskell.org/package/hledger-lib), [hledger](https://matrix.hackage.haskell.org/package/hledger), [hledger-ui](https://matrix.hackage.haskell.org/package/hledger-ui), [hledger-web](https://matrix.hackage.haskell.org/package/hledger-web) <br> reverse deps: [hledger-lib](https://packdeps.haskellers.com/reverse/hledger-lib), [hledger](https://packdeps.haskellers.com/reverse/hledger), [hledger-ui](https://packdeps.haskellers.com/reverse/hledger-ui), [hledger-web](https://packdeps.haskellers.com/reverse/hledger-web) <br> [![on hackage](https://img.shields.io/hackage/v/hledger.svg?label=hackage&colorB=green)](https://hackage.haskell.org/package/hledger) <br> [![...](https://img.shields.io/hackage-deps/v/hledger-lib.svg?label=hledger-lib+bounds)](https://packdeps.haskellers.com/feed?needle=hledger-lib) [![...](https://img.shields.io/hackage-deps/v/hledger.svg?label=hledger+bounds)](https://packdeps.haskellers.com/feed?needle=hledger) <br> [![...](https://img.shields.io/hackage-deps/v/hledger-ui.svg?label=hledger-ui+bounds)](https://packdeps.haskellers.com/feed?needle=hledger-ui) [![...](https://img.shields.io/hackage-deps/v/hledger-web.svg?label=hledger-web+bounds)](https://packdeps.haskellers.com/feed?needle=hledger-web)
| Stackage | [build-constraints.yaml](https://github.com/fpco/stackage/blob/master/build-constraints.yaml) <br> [open hledger-related issues](https://github.com/fpco/stackage/search?q=hledger+is%3Aopen&type=Issues) <br> packages: [hledger-lib](https://www.stackage.org/package/hledger-lib), [hledger](https://www.stackage.org/package/hledger), [hledger-ui](https://www.stackage.org/package/hledger-ui), [hledger-web](https://www.stackage.org/package/hledger-web)<br> versions: [hledger-lib](https://www.stackage.org/package/hledger-lib/snapshots), [hledger](https://www.stackage.org/package/hledger/snapshots), [hledger-ui](https://www.stackage.org/package/hledger-ui/snapshots), [hledger-web](https://www.stackage.org/package/hledger-web/snapshots) <br> [![](https://repology.org/badge/version-for-repo/stackage_lts/hledger.svg)](https://repology.org/metapackage/hledger) [![...](https://repology.org/badge/version-for-repo/stackage_nighly/hledger.svg)](https://repology.org/metapackage/hledger)
| Repology | [quick hledger packaging status](https://repology.org/metapackage/hledger/badges), [detailed hledger packaging status](https://repology.org/project/hledger/versions), [all \*hledger\* packages](https://repology.org/metapackages/?search=hledger)
| Debian | source packages: [haskell-hledger-lib](https://tracker.debian.org/pkg/haskell-hledger-lib), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=haskell-hledger-lib), [haskell-hledger](https://tracker.debian.org/pkg/haskell-hledger), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=haskell-hledger), [haskell-hledger-ui](https://tracker.debian.org/pkg/haskell-hledger-ui), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=haskell-hledger-ui), [haskell-hledger-web](https://tracker.debian.org/pkg/haskell-hledger-web), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=haskell-hledger-web) <br>stable: [hledger](https://packages.debian.org/stable/hledger), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger;dist=stable), [hledger-ui](https://packages.debian.org/stable/hledger-ui), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-ui;dist=stable), [hledger-web](https://packages.debian.org/stable/hledger-web), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-web;dist=stable) <br>testing: [hledger](https://packages.debian.org/testing/hledger), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger;dist=testing), [hledger-ui](https://packages.debian.org/testing/hledger-ui), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-ui;dist=testing), [hledger-web](https://packages.debian.org/testing/hledger-web), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-web;dist=testing) <br>unstable: [hledger](https://packages.debian.org/unstable/hledger), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger;dist=unstable), [hledger-ui](https://packages.debian.org/unstable/hledger-ui), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-ui;dist=unstable), [hledger-web](https://packages.debian.org/unstable/hledger-web), [bugs](https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=hledger-web;dist=unstable) <br>all: [\*hledger\*](https://packages.debian.org/search?searchon=names&keywords=hledger) <br> popcon sampled install stats: [haskell-hledger](https://qa.debian.org/popcon.php?packages=haskell-hledger), [hledger](https://qa.debian.org/popcon.php?packages=hledger), [hledger-ui](https://qa.debian.org/popcon-graph.php?packages=hledger-ui), [hledger-web](https://qa.debian.org/popcon-graph.php?packages=hledger-web)
| Ubuntu | source packages: [haskell-hledger-lib](https://launchpad.net/ubuntu/+source/haskell-hledger-lib), [bugs](https://bugs.launchpad.net/ubuntu/+source/haskell-hledger-lib), [haskell-hledger](https://launchpad.net/ubuntu/+source/haskell-hledger), [bugs](https://bugs.launchpad.net/ubuntu/+source/haskell-hledger), [haskell-hledger-ui](https://launchpad.net/ubuntu/+source/haskell-hledger-ui), [bugs](https://bugs.launchpad.net/ubuntu/+source/haskell-hledger-ui), [haskell-hledger-web](https://launchpad.net/ubuntu/+source/haskell-hledger-web), [bugs](https://bugs.launchpad.net/ubuntu/+source/haskell-hledger-web) <br> binary packages: [\*hledger\*](https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=hledger)
| Gentoo | [hledger](https://gpo.zugaina.org/dev-haskell/hledger), [hledger-web](https://gpo.zugaina.org/dev-haskell/hledger-web), [\*hledger\*](https://gpo.zugaina.org/Search?search=hledger)
| Fedora | [hledger](https://apps.fedoraproject.org/packages/hledger), [\*hledger\*](https://apps.fedoraproject.org/packages/s/hledger), [hledger (package db)](https://admin.fedoraproject.org/pkgdb/package/hledger/), [Haskell SIG](https://fedoraproject.org/wiki/Haskell_SIG)
| Void Linux | [package search](https://voidlinux.org/packages/) -> hledger
| Nix | [\*hledger\*](https://hydra.nixos.org/search?query=hledger)
| Homebrew | [hledger](https://formulae.brew.sh/formula/hledger) <br> our 1-year homebrew rank: <br>2020: [#1520 of 10000 on mac](https://formulae.brew.sh/analytics/install-on-request/365d), [#762 of 8288 on linux](https://formulae.brew.sh/analytics-linux/install-on-request/365d/)
| Sandstorm | [hledger web app & reviews](https://apps.sandstorm.io/app/8x12h6p0x0nrzk73hfq6zh2jxtgyzzcty7qsatkg7jfg2mzw5n90), [issues](https://github.com/simonmichael/hledger/issues?utf8=✓&q=label%3A%22platform%3A%20sandstorm%22%20)
| Reference | [fosskers GHC compatibility chart](https://www.fosskers.ca/en/blog/base)
<!-- | hledger-api demo | [api-demo.hledger.org/api/v1/accounts](https://api-demo.hledger.org/api/v1/accounts), [api-demo.hledger.org/swagger.json](https://api-demo.hledger.org/swagger.json), [in swagger editor](https://editor2.swagger.io/#/?import=api-demo.hledger.org/swagger.json&no-proxy) <br> [unfinished angular sample app](https://api-demo.hledger.org) ([code](https://github.com/simonmichael/hledger/tree/master/hledger-api/examples/angular)) -->
<!--
| Travis CI | [![...](https://api.travis-ci.org/simonmichael/hledger.svg?branch=master)](https://travis-ci.org/simonmichael/hledger/builds)
| Appveyor CI | [![...](https://ci.appveyor.com/api/projects/status/5vejw0w5n5igdr42?svg=true)](https://ci.appveyor.com/project/simonmichael/hledger/history)
| Azure CI | <a href="https://dev.azure.com/simonmic/hledger/_build"><img src="https://dev.azure.com/simonmic/hledger/_apis/build/status/simonmichael.hledger?branchName=master" alt="..."></a>
-->
<!-- list the debian packages for clarity:
3 source:
haskell-hledger-lib
haskell-hledger
haskell-hledger-web
8 binary:
hledger
hledger-web
libghc-hledger-dev
libghc-hledger-doc
libghc-hledger-prof
libghc-hledger-lib-dev
libghc-hledger-lib-doc
libghc-hledger-lib-prof
-->
## Open issues
An overview of hledger's [issue tracker](https://github.com/simonmichael/hledger/issues).
A good place to start looking for something to work on.
<!--
This table doesn't have to be aligned, but it helps.
Editing it may require editor support, search/replace etc.
Syntax: https://www.pandoc.org/MANUAL.html#tables -> pipe_tables
-->
| COMPONENT/TOPIC [*](#topics) | BUGS | WISHES | PRS | OTHER
|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------
| [all](https://github.com/simonmichael/hledger/issues?q=is:open) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22)
| **Tools:**
| [install](https://github.com/simonmichael/hledger/issues?q=is:open+label:install) (hledger-install.sh) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:install) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:install)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:install)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:install)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:install) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:install) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:install)
| [cli](https://github.com/simonmichael/hledger/issues?q=is:open+label:cli) (hledger) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:cli) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:cli)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:cli)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:cli)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:cli) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:cli) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:cli)
| [ui](https://github.com/simonmichael/hledger/issues?q=is:open+label:ui) (hledger-ui) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:ui) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:ui)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:ui)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:ui)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:ui) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:ui) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:ui)
| [web](https://github.com/simonmichael/hledger/issues?q=is:open+label:web) (hledger-web) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:web) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:web)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:web)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:web)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:web) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:web) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:web)
| **Input/Output Formats:**
| [journal](https://github.com/simonmichael/hledger/issues?q=is:open+label:journal) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:journal) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:journal)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:journal)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:journal)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:journal) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:journal) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:journal)
| [timeclock](https://github.com/simonmichael/hledger/issues?q=is:open+label:timeclock) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:timeclock) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:timeclock)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:timeclock)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:timeclock)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:timeclock) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:timeclock) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:timeclock)
| [timedot](https://github.com/simonmichael/hledger/issues?q=is:open+label:timedot) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:timedot) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:timedot)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:timedot)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:timedot)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:timedot) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:timedot) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:timedot)
| [csv](https://github.com/simonmichael/hledger/issues?q=is:open+label:csv) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:csv) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:csv)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:csv)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:csv)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:csv) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:csv) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:csv)
| [json](https://github.com/simonmichael/hledger/issues?q=is:open+label:json) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:json) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:json)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:json)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:json)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:json) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:json) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:json)
| [html](https://github.com/simonmichael/hledger/issues?q=is:open+label:html) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:html) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:html)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:html)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:html)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:html) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:html) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:html)
| **Commands:**
| [accounts](https://github.com/simonmichael/hledger/issues?q=is:open+label:accounts) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:accounts) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:accounts)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:accounts)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:accounts)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:accounts) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:accounts) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:accounts)
| [activity](https://github.com/simonmichael/hledger/issues?q=is:open+label:activity) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:activity) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:activity)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:activity)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:activity)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:activity) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:activity) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:activity)
| [add](https://github.com/simonmichael/hledger/issues?q=is:open+label:add) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:add) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:add)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:add)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:add)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:add) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:add) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:add)
| [balcmds](https://github.com/simonmichael/hledger/issues?q=is:open+label:balcmds) (bal/bs/bse/cf/is/...) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:balcmds) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:balcmds)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:balcmds)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:balcmds)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:balcmds) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:balcmds) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:balcmds)
| [balance](https://github.com/simonmichael/hledger/issues?q=is:open+label:balance) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:balance) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:balance)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:balance)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:balance)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:balance) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:balance) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:balance)
| [balancesheet](https://github.com/simonmichael/hledger/issues?q=is:open+label:balancesheet) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:balancesheet) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:balancesheet)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:balancesheet)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:balancesheet)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:balancesheet) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:balancesheet) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:balancesheet)
| [cashflow](https://github.com/simonmichael/hledger/issues?q=is:open+label:cashflow) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:cashflow) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:cashflow)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:cashflow)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:cashflow)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:cashflow) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:cashflow) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:cashflow)
| [checkdates](https://github.com/simonmichael/hledger/issues?q=is:open+label:checkdates) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:checkdates) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:checkdates)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:checkdates)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:checkdates)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:checkdates) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:checkdates) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:checkdates)
| [checkdupes](https://github.com/simonmichael/hledger/issues?q=is:open+label:checkdupes) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:checkdupes) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:checkdupes)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:checkdupes)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:checkdupes)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:checkdupes) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:checkdupes) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:checkdupes)
| [close](https://github.com/simonmichael/hledger/issues?q=is:open+label:close) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:close) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:close)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:close)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:close)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:close) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:close) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:close)
| [import](https://github.com/simonmichael/hledger/issues?q=is:open+label:import) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:import) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:import)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:import)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:import)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:import) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:import) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:import)
| [incomestatement](https://github.com/simonmichael/hledger/issues?q=is:open+label:incomestatement) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:incomestatement) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:incomestatement)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:incomestatement)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:incomestatement)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:incomestatement) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:incomestatement) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:incomestatement)
| [prices](https://github.com/simonmichael/hledger/issues?q=is:open+label:prices) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:prices) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:prices)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:prices)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:prices)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:prices) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:prices) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:prices)
| [print](https://github.com/simonmichael/hledger/issues?q=is:open+label:print) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:print) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:print)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:print)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:print)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:print) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:print) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:print)
| [printunique](https://github.com/simonmichael/hledger/issues?q=is:open+label:printunique) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:printunique) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:printunique)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:printunique)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:printunique)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:printunique) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:printunique) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:printunique)
| [register](https://github.com/simonmichael/hledger/issues?q=is:open+label:register) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:register) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:register)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:register)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:register)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:register) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:register) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:register)
| [registermatch](https://github.com/simonmichael/hledger/issues?q=is:open+label:registermatch) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:registermatch) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:registermatch)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:registermatch)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:registermatch)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:registermatch) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:registermatch) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:registermatch)
| [rewrite](https://github.com/simonmichael/hledger/issues?q=is:open+label:rewrite) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:rewrite) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:rewrite)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:rewrite)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:rewrite)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:rewrite) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:rewrite) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:rewrite)
| [roi](https://github.com/simonmichael/hledger/issues?q=is:open+label:roi) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:roi) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:roi)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:roi)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:roi)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:roi) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:roi) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:roi)
| [stats](https://github.com/simonmichael/hledger/issues?q=is:open+label:stats) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:stats) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:stats)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:stats)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:stats)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:stats) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:stats) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:stats)
| [tags](https://github.com/simonmichael/hledger/issues?q=is:open+label:tags) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:tags) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:tags)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:tags)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:tags)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:tags) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:tags) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:tags)
| **Miscellaneous:**
| [budget](https://github.com/simonmichael/hledger/issues?q=is:open+label:budget) (budgeting) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:budget) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:budget)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:budget)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:budget)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:budget) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:budget) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:budget)
| [packaging](https://github.com/simonmichael/hledger/issues?q=is:open+label:deps) (packaging, dependencies) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:deps) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:deps)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:deps)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:deps)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:deps) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:deps) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:deps)
| [doc](https://github.com/simonmichael/hledger/issues?q=is:open+label:doc) (documentation, help) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:doc) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:doc)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:doc)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:doc)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:doc) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:doc) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:doc)
| [periodexpressions](https://github.com/simonmichael/hledger/issues?q=is:open+label:periodexpressions) (-b, -e, -p, date:) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:periodexpressions) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:periodexpressions)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:periodexpressions)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:periodexpressions)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:periodexpressions) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:periodexpressions) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:periodexpressions)
| [site](https://github.com/simonmichael/hledger/issues?q=is:open+label:site) (website, web presence) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:site) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:site)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:site)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:site)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:site) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:site) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:site)
| [tools](https://github.com/simonmichael/hledger/issues?q=is:open+label:tools) (dev tools, infrastructure)   | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:tools) ([first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:tools)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:tools)/[neither](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:tools)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:tools) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:tools) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:tools)
## About the project
### Mission
Why was hledger created ?
Mainly:
- to provide a more usable, robust, documented, cross-platform-installable version of Ledger for users
- to provide a more maintainable and hackable version of Ledger for developers
Also:
- to provide a useful library and toolbox for finance-minded haskell programmers
- to explore the suitability of Haskell for such applications
- to experiment with building a successful time-and-money-solvent project in a thriving ecosystem of financial software projects
What is the hledger project's current mission ?
1. Provide peace of mind: bring clarity, relief, and peace of mind to folks stressed, confused, overwhelmed by finances.
2. Educate and empower: help individuals and communities achieve clarity, accountability and mastery with money and time.
### Roles and activities
- newcomer/potential user
- user
- library user
- field tester
- bug wrangler
- support
- documentor
- qa
- developer
- packager
- communicator
- project manager
## Getting started
New contributors are always welcome in the hledger project.
Jump in! Or [ask us](support.html) to help you find a task.
### Funder
Become a financial backer to
sustain and grow this project,
increase your influence,
express gratitude,
build prosperity consciousness,
and help transform world finance!
- Use the donate links on the [home page](https://hledger.org)
- Configure a recurring donation
- Contribute or pledge bounties on issues you care about
- Ask your organization to contribute
- Work on project sustainability, accountability, fundraising
### Tester
- Test installation on platforms you have access to
- Test examples, advice, and links in the docs
- Run the latest release or developer build in daily use
- Run [tests](#run-package-tests)
- Run [benchmarks](#run-package-benchmarks)
- Report packaging, documentation, UX, functional, performance issues
- Report and help analyse problems via irc/mail list/bug tracker
When reporting bugs, don't forget to search the tracker for a similar bug report.
Otherwise, open a new bug by clicking "New issue", or <http://bugs.hledger.org/new>.
Enhancement requests are sometimes added to the tracker,but for these consider using
the IRC channel and mail list (see [Getting help](index.html#getting-help)).
Both are archived and linkable, so the idea won't be lost.
There is also a collection of wishes at the old [trello board](http://trello.hledger.org).
### Technical Writer
- get familiar with the website and documentation online, review and test
- get familiar with the site/doc source files (see [Shake.hs](#shake))
- get the latest hledger source
- send patches with names prefixed with "doc: " (or "site: ")
### Graphics Designer
- more/better logos & graphics
- illustrations and diagrams
- web design mockups for home page, site, hledger-web UI
<!-- ### Product Designer -->
### Communicator
Marketing and market understanding is vital.
- clarify project goals, value proposition, brand, mission, story
- monitor product-market fit
- identify new opportunities
- influence developer priorities
- spread the word!
### Maintainer
#### Help with issue management
- watch tracker activity, report status
- apply/update labels where needed
- follow up on dormant issues
- facilitate a consistently good bug-reporting & PR-contributing experience
#### Help with packaging
- package hledger for linux distros, macports, etc.
- develop mac/windows installers
- find and assist distro packagers/installer developers
#### Help with project management
- clarify/update goals and principles
- monitor, report on project progress and performance
- research, compare and report on successful projects, related projects
- identify collaboration opportunities
- marketing, communication, outreach
- release management, roadmap planning
### Developer
See [Developer workflows](WORKFLOWS.md#developer-workflows).

154
DOCS.md
View File

@ -1,154 +0,0 @@
# Docs
<div class=pagetoc>
<!-- toc -->
</div>
## Four kinds of documentation
<div style="margin:1em 2em; font-style:italic;">
"There is a secret that needs to be understood in order to write good
software documentation: there isnt one thing called documentation,
there are four. They are: tutorials, how-to guides, explanation and
technical reference. They represent four different purposes or
functions, and require four different approaches to their creation."
--[Daniele Procida] (https://news.ycombinator.com/item?id=21289832)
</div>
## hledger's documentation structure
2019: out of date, needs update.
Project documentation lives in a number of places:
- `site/*.md` is the hledger.org website content, which is generated with hakyll[-std] and pandoc
- haddock documentation in the code appears on Hackage
- short blurbs: cabal files, module headers, HCAR, GSOC project, ..
- `doc/notes.org` has some old developer notes
- developer reports (profiles, benchmarks, coverage..) in doc/profs, sometimes published at hledger.org/profs
- https://github.com/simonmichael/hledger/tree/master/doc
site/ is now a symlink to the separate hledger_site repo.
See also Shake.hs.
hledger doc files can be divided into several groups:
1. Project admin/dev notes not published on the website.
These are kept in this directory (doc/). They include:
```
doc/finance/ project finances
doc/hcar/ Haskell Community and Activities Report entries
doc/lib.m4 common macros used in package manuals
doc/manpage.* misc. templates for rendering package manuals
doc/mockups/ exploratory developer mockups
doc/profs/ a place for long-term profiling/performance data
```
2. Project doc files required to be in the top directory:
```
README.md the main project readme, displayed on github
LICENSE the default project license
```
3. Code/API docs in haskell source files as haddock comments:
```
hledger*/**/*.hs haddock module and function docs in most source files
```
4. Per-package descriptions, readmes, changelogs, and reference manuals.
These are in the respective package directories:
```
hledger*/package.yaml source for package metadata (description, etc.)
hledger*/README package readme, displayed on hackage
hledger*/CHANGES package changelog, displayed on hackage
hledger*/hledger*.m4.md package manual source file(s)
```
5. The project website and additional docs - home page, FAQ, tutorials,
how-tos, developer guide, etc. These are in the site directory:
```
site/ hledger.org website content, templates, assets
```
## Workflows
The manuals and website are rendered from the top directory,
primarily using Shake. First, build Shake:
```
$ make Shake
```
Then render the per-package manuals from markdown-m4 source files (*.m4.md)
to text, man, info, and markdown formats. This requires some unix tools
such as m4:
```
$ ./Shake manuals
```
The text/man/info manuals are embedded in the hledger executable, so a
rebuild of that now will pick up the latest manuals:
```
$ stack build hledger
```
The website uses the markdown manuals. This copies them into the
website, edits them for web display, concatenates them to form the
one-page manual, and runs pandoc to render everything as html,
adding tables of contents and the site header/footer.
```
$ ./Shake website
```
## 201901 docs reorg (#920, WIP)
https://groups.google.com/forum/#!topic/hledger/t2nVr3zER8Q/discussion
> > On Oct 26, 2018, at 1:47 PM, Simon Michael <simon@joyful.com> wrote:
> >
> > A quick heads-up: I am feeling like stepping back from github wiki, and reorganising our docs like so:
> >
> > Two repos:
> >
> > 1. hledger - code and hard docs
> >
> > - code and code docs (haddock docs & doctest examples)
> > - developer docs (READMEs in md or org format)
> > - product manuals (hledger*/hledger*.m4.md)
> > - release notes and announcements
> > - HCAR entries
> >
> > 2. hledger-site - website and soft docs
> >
> > - hledger.org content, resources, site infrastructure
> > - user cookbook, how-tos, articles
> > - links to blog posts, discussions etc.
> > - other resources relating to our web presence/marketing
> >
> > If you disagree, let's discuss. Some quick considerations:
> >
> > - moving docs to the wiki hasn't affected the contribution rate
> > - using the wiki increases our dependence on github and makes our work less self-contained and future-proof
> > - the wiki docs don't look great, aren't very flexible, & don't integrate well with our site & static docs
> > - using two docs systems increases complexity
> > - dev docs in the wiki are too far from the code, and compete with READMEs
>
> PS:
>
> - Why not go back to just one repo for everything ? Or if two repos, why not put all docs in one of them ?
>
> Dev docs are most discoverable and maintainable right there in the main repo, ie as READMEs. Likewise for API docs (haddocks) and the reference manuals (hledger*/hledger*m4.md). We want all of these updated in lock step with code/tooling changes.
>
> Other ("soft") docs are needed, but these have a more relaxed process, schedule, and scope (eg bookkeeping advice). They occasionally generate a lot of noise in the commit log, and I think it's a good to keep that out of the code history. The website (home and other pages, site design, site infrastructure) generates similar commit storms and is somewhat independent of code, so it goes in the soft docs repo too.
>
> These are my thoughts, but I have an open mind if you see a better way.
>
> me (Simon Michael (sm) change)
> 10/27/18
> Still plenty of time to discuss and reconsider, but see also
> https://github.com/simonmichael/hledger/issues/920
> https://github.com/simonmichael/hledger/issues/921
>
> I'll probably make a start on the first one (consolidating dev docs in main repo).

View File

@ -1,4 +1,4 @@
FROM haskell as dev FROM haskell:9.12.2 AS dev
RUN mkdir /root/hledger RUN mkdir /root/hledger
WORKDIR /root/hledger WORKDIR /root/hledger
@ -21,11 +21,11 @@ RUN stack install
FROM debian:stable-slim FROM debian:stable-slim
RUN apt-get update && apt-get install libtinfo5 libgmp10 && rm -rf /var/lib/apt/lists RUN apt-get update && apt-get -y install libtinfo6 libgmp10 && rm -rf /var/lib/apt/lists
COPY --from=dev /root/.local/bin/hledger* /usr/bin/ COPY --from=dev /root/.local/bin/hledger* /usr/bin/
ENV LC_ALL C.UTF-8 ENV LC_ALL=C.UTF-8
RUN mkdir /data && touch /data/hledger.journal RUN mkdir /data && touch /data/hledger.journal
VOLUME /data VOLUME /data

View File

@ -1,61 +0,0 @@
# Finance
<div class=pagetoc>
<!-- toc -->
</div>
<https://hledger.org/finance> this page
<https://github.com/simonmichael/hledger_finance> finance repo
Old:
## Funding
My vision for the hledger project has always been for it to be "accountable" and "self-sustaining", possibly through new forms of incentivisation.
Classic non-monetary FOSS communities are a beautiful and precious thing.
Adding money can change their dynamic.
Yet, we would enjoy having a lot more issues resolved, and a faster rate of progress.
So we experiment, gently.
Currently we use bounties as a way to encourage resolution of issues.
There are a few ways to do this:
1. You or your organisation can offer a bounty simply by saying so on the issue.
2. You can use Bountysource. A few hledger bounties have been completed there.
3. You can use the new Open Collective process below.
Issues with bounties of any kind are marked with the `bounty` label.
The Bounty Manager is @simonmichael.
## New bounty process
It currently looks like this, and will evolve:
- Issues are marked as bounties by @simonmichael. Feel free to suggest additional issues which should receive the bounty label.
- Bounties are paid from the hledger project's public Open Collective fund.
By contributing to the fund as an individual or organisation, you enable more bounties.
- These OC bounties (unlike 1 and 2 above) have standard amounts.
These may be adjusted over time, depending eg on the state of our funds.
Our current bounty amounts are
- level 1: 10 USD
- level 2: 25 USD
- level 3: 50 USD
- When you complete a bounty, submit an expense to Open Collective,
for whichever of the above bounty amounts you think appropriate,
based eg on time or expertise spent, how much you need it,
how much remains in our fund for other bounties, etc.
This will be reviewed by OC and (maybe ?) @simonmichael.
Successful claims, like donations, will appear in our public OC ledger.
Our bounty amounts are small, and nothing like professional rates in most countries,
but they still establish a principle of sustainability,
and help us to experiment.
You are encouraged to claim your bounties,
though you can also choose to transfer them to a new issue of your choice.

View File

@ -1,97 +0,0 @@
# Issues
<div class=pagetoc>
<!-- toc -->
</div>
The hledger project\'s issue tracker is on github. It contains:
- BUG issues - failures in some part of the hledger project (the main
hledger packages, docs, website..)
- WISH issues - feature proposals, enhancement requests
- uncategorised issues - we don\'t know what these are yet
- pull requests - proposed changes to code and docs
Issues are also labelled according to their [topics](#topics), for organisation.
Some loose conventions:
- In bug titles, mention the hledger version in which the bug first appeared
(and avoid mentioning version numbers otherwise).
This allows searches like
[new issues in 1.22](https://github.com/simonmichael/hledger/issues?q=in%3Atitle+1.22+)
and
[regressions in 1.22](https://github.com/simonmichael/hledger/issues?q=in%3Atitle+1.22+label%3Aregression%21)
## Issue Urls
- <http://bugs.hledger.org> - show open BUG issues
- <http://wishes.hledger.org> - show open WISH issues
- <http://issues.hledger.org> - show all issues, open or closed
- <http://prs.hledger.org> - show open pull requests
- <http://bugs.hledger.org/new> - create a new issue
## Labels
Labels are used to categorise:
- the issue\'s type: \"A BUG\" or \"A WISH\", in shades of red (The A
makes it appear as first label)
- relevant subsystems/topics, in light blue. More about this below.
- relevant platforms, in light purple
- resolution if not fixed:
\"closed:cant-reproduce/duplicate/invalid/wont-fix\", in dark grey
- \"bounty\", in bright yellow: issues with bountysource funding
- \"easy?\", in dim yellow: issues which are probably relatively easy
to fix
- \"imported\" etc., in white: miscellaneous information
## Topics
Short topic names, corresponding to hledger commands, input formats, output formats and other common themes,
are used to organise things in the hledger project. In particular,
- They are used as space saving descriptive prefixes for [commit messages](#commit-messages)
- They can be used as prefixes for issue/PR titles
- Issues and PRs are labelled with them (the light blue labels).
A more or less complete list can be seen at [open issues](#open-issues)
or in the issue tracker's labels list.
## Custodians
If you are interested in helping with a particular component for a
while, please add yourself as a custodian in Open Issues table above.
A custodian\'s job is to help manage the issues, rally the troops, and
drive the open issue count towards zero. The more custodians, the
better! By dividing up the work this way, we can scale and make forward
progress.
## Milestones and Projects
Milestones are used a little bit to plan releases. In 2017 we
experimented with projects, but in 2018 milestones are in favour again..
## Estimates
You might see some experiments in estimate tracking, where some issue
names might have a suffix noting estimated and spent time. Basic format:
\[ESTIMATEDTOTALTASKTIME\|TIMESPENTSOFAR\]. Examples: \`\`\` \[2\] two
hours estimated, no time spent \[..\] half an hour estimated (a dot is
\~a quarter hour, as in timedot format) \[1d\] one day estimated (a day
is \~4 hours) \[1w\] one week estimated (a week is \~5 days or \~20
hours) \[3\|2\] three hours estimated, about two hours spent so far
\[1\|1w\|2d\] first estimate one hour, second estimate one week, about
two days spent so far \`\`\` Estimates are always for the total time
cost (not time remaining). Estimates are not usually changed, a new
estimate is added instead. Numbers are very approximate, but better than
nothing.
## Trello
The [trello board](http://trello.hledger.org) (trello.hledger.org) is an
old collection of wishlist items. This should probably be considered
deprecated.

1747
Justfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html>.

40
MAKE.md
View File

@ -1,40 +0,0 @@
# Make
A Makefile is provided to make common developer tasks easy to remember,
and to insulate us a little from the ever-evolving Haskell tools ecosystem.
Using it is entirely optional, but recommended.
You'll need [GNU Make](https://www.gnu.org/software/make) installed.
The Makefile contains a fair amount of obsolete cruft and needs cleanup. Some tasks (docs, website) are now handled by the [Shake](#shake) file instead.
The Makefile is self-documenting. Run `make` to see a list of the main make rules:
```shell
$ make
Makefile:37: -------------------- hledger make rules --------------------
Makefile:39: make [help] -- list documented rules in this makefile. make -n RULE shows more detail.
Makefile:204: (INSTALLING:)
Makefile:206: make install -- download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack)
Makefile:231: (BUILDING:)
Makefile:235: make build -- download dependencies and build hledger executables (with stack)
Makefile:304: make hledgerdev -- quickly build the hledger executable (with ghc and -DDEVELOPMENT)
...
```
To see what a make rule will do without actually doing it, use the `-n` flag:
```shell
$ make build -n
stack build
```
```shell
$ make test -n
(stack test \
&& echo pkgtest PASSED) || echo pkgtest FAILED
(stack exec hledger test \
&& echo builtintest PASSED) || echo builtintest FAILED
(COLUMNS=80 PATH=`pwd`/bin:/home/simon/src/hledger/bin:/home/simon/.local/bin:/home/simon/.cabal/bin:/opt/ghc/7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/var/lib/gems/1.9.1/bin stack exec -- shelltest --execdir -- -j16 --hide-successes tests \
&& echo functest PASSED) || echo functest FAILED
```

1170
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,24 @@
[![on hackage](https://img.shields.io/hackage/v/hledger.svg?label=hackage&colorB=green)](https://hackage.haskell.org/package/hledger) [![on hackage](https://img.shields.io/hackage/v/hledger.svg?label=hackage&colorB=green)](https://hackage.haskell.org/package/hledger)
[![](https://repology.org/badge/version-for-repo/stackage_nighly/hledger.svg)](https://repology.org/metapackage/hledger) [![](https://repology.org/badge/version-for-repo/stackage_nighly/hledger.svg)](https://repology.org/metapackage/hledger)
[![](https://repology.org/badge/version-for-repo/stackage_lts/hledger.svg)](https://repology.org/metapackage/hledger) [![](https://repology.org/badge/version-for-repo/stackage_lts/hledger.svg)](https://repology.org/metapackage/hledger)
[![github issues](https://img.shields.io/github/issues/simonmichael/hledger.svg)](http://bugs.hledger.org) \
[![Repo Health](https://api.gitscope.dev/api/badges/simonmichael/hledger/health.svg "Overall repository health score from 0-100%. Calculated from activity, maintenance, community engagement, and issue management.")](https://gitscope.dev/docs/badges)
[![Maintained](https://api.gitscope.dev/api/badges/simonmichael/hledger/maintained.svg "Maintenance status: very active, active, maintained, or stale based on recent commit and issue activity.")](https://gitscope.dev/docs/badges)
[![Response Time](https://api.gitscope.dev/api/badges/simonmichael/hledger/response-time.svg "Average time maintainers take to respond to new issues.")](https://gitscope.dev/docs/badges)
[![Contributors](https://api.gitscope.dev/api/badges/simonmichael/hledger/contributors.svg "Total number of unique contributors to the repository. The true number as of 2025 is 185+.")](https://hledger.org/CREDITS.html)
\
[![Documentation](https://api.gitscope.dev/api/badges/simonmichael/hledger/docs.svg "Documentation quality indicator based on README completeness, wiki presence, and linked documentation.")](https://hledger.org/doc.html)
[![Open issues, all kinds](https://img.shields.io/github/issues/simonmichael/hledger.svg "Open issues, all kinds.")](https://github.com/simonmichael/hledger/issues?q=is:issue+state:open)
[![Open bugs](https://api.gitscope.dev/api/badges/simonmichael/hledger/label/A-BUG.svg "Open bugs")](https://github.com/simonmichael/hledger/issues?q=is:issue+label:A-BUG+state:open)
[![Open wishes](https://api.gitscope.dev/api/badges/simonmichael/hledger/label/A-WISH.svg "Open wishes")](https://github.com/simonmichael/hledger/issues?q=is:issue+label:A-WISH+state:open)
[![Issues Resolved](https://api.gitscope.dev/api/badges/simonmichael/hledger/resolved.svg "Percentage of issues resolved/closed during last N days. Higher is better. Click to see closed bugs.")](https://github.com/simonmichael/hledger/issues?q=is:issue+state:closed)
Welcome! This a brief intro to hledger. For a more detailed version, see the home page: **<https://hledger.org>** <!--
[![Contributor Friendly](https://api.gitscope.dev/api/badges/simonmichael/hledger/contributor-friendly.svg "Does the project welcome new contributors based on good first issues, contributing guides, and response patterns.")](https://hledger.org/CONTRIBUTING.html)
[![Issues Welcome](https://api.gitscope.dev/api/badges/simonmichael/hledger/issues.svg "Does the project actively accept and respond to issue reports.")](https://hledger.org/ISSUES.html)
-->
Welcome! This is a brief intro to hledger. For a more detailed version, see the home page: **<https://hledger.org>**
hledger is lightweight, cross platform, multi-currency, double-entry accounting software. hledger is lightweight, cross platform, multi-currency, double-entry accounting software.
It lets you track money, investments, cryptocurrencies, invoices, time, inventory and more, It lets you track money, investments, cryptocurrencies, invoices, time, inventory and more,
@ -34,7 +49,7 @@ More features:
- Inspired by and partly compatible with Ledger CLI; interconvertible with Beancount - Inspired by and partly compatible with Ledger CLI; interconvertible with Beancount
- Scriptable by CLI, HTTP or API, with plenty of examples - Scriptable by CLI, HTTP or API, with plenty of examples
- Clean Haskell codebase, continually improved since 2007, with $100 regression bounties - Clean Haskell codebase, continually improved since 2007, with $100 regression bounties
- Free software licensed under GPLv3+. - Free software licensed under GNU General Public License v3.0 or later.
## Examples ## Examples
@ -113,7 +128,7 @@ More examples and screenshots: <https://hledger.org/#how-to-get-started>
hledger is brought to you by hledger is brought to you by
[Simon Michael](http://joyful.com), [Simon Michael](http://joyful.com),
[140+ contributors](CREDITS.md), [140+ contributors](doc/CREDITS.md),
and the generous financial sponsors below. and the generous financial sponsors below.
After enjoying some personal or organisational success with hledger, After enjoying some personal or organisational success with hledger,
@ -144,6 +159,17 @@ It's easy! Please see <https://hledger.org/sponsor.html> for details.
<a href="https://opencollective.com/hledger/organization/17/website"><img src="https://opencollective.com/hledger/organization/17/avatar.svg?avatarHeight=200"></a> <a href="https://opencollective.com/hledger/organization/17/website"><img src="https://opencollective.com/hledger/organization/17/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/18/website"><img src="https://opencollective.com/hledger/organization/18/avatar.svg?avatarHeight=200"></a> <a href="https://opencollective.com/hledger/organization/18/website"><img src="https://opencollective.com/hledger/organization/18/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/19/website"><img src="https://opencollective.com/hledger/organization/19/avatar.svg?avatarHeight=200"></a> <a href="https://opencollective.com/hledger/organization/19/website"><img src="https://opencollective.com/hledger/organization/19/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/20/website"><img src="https://opencollective.com/hledger/organization/20/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/21/website"><img src="https://opencollective.com/hledger/organization/21/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/22/website"><img src="https://opencollective.com/hledger/organization/22/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/23/website"><img src="https://opencollective.com/hledger/organization/23/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/24/website"><img src="https://opencollective.com/hledger/organization/24/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/25/website"><img src="https://opencollective.com/hledger/organization/25/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/26/website"><img src="https://opencollective.com/hledger/organization/26/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/27/website"><img src="https://opencollective.com/hledger/organization/27/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/28/website"><img src="https://opencollective.com/hledger/organization/28/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/29/website"><img src="https://opencollective.com/hledger/organization/29/avatar.svg?avatarHeight=200"></a>
<a href="https://opencollective.com/hledger/organization/30/website"><img src="https://opencollective.com/hledger/organization/30/avatar.svg?avatarHeight=200"></a>
### Individual sponsors ### Individual sponsors
@ -187,5 +213,16 @@ It's easy! Please see <https://hledger.org/sponsor.html> for details.
<a href="https://opencollective.com/hledger/individual/37/website"><img src="https://opencollective.com/hledger/individual/37/avatar.svg?avatarHeight=100"></a> <a href="https://opencollective.com/hledger/individual/37/website"><img src="https://opencollective.com/hledger/individual/37/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/38/website"><img src="https://opencollective.com/hledger/individual/38/avatar.svg?avatarHeight=100"></a> <a href="https://opencollective.com/hledger/individual/38/website"><img src="https://opencollective.com/hledger/individual/38/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/39/website"><img src="https://opencollective.com/hledger/individual/39/avatar.svg?avatarHeight=100"></a> <a href="https://opencollective.com/hledger/individual/39/website"><img src="https://opencollective.com/hledger/individual/39/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/40/website"><img src="https://opencollective.com/hledger/individual/40/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/41/website"><img src="https://opencollective.com/hledger/individual/41/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/42/website"><img src="https://opencollective.com/hledger/individual/42/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/43/website"><img src="https://opencollective.com/hledger/individual/43/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/44/website"><img src="https://opencollective.com/hledger/individual/44/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/45/website"><img src="https://opencollective.com/hledger/individual/45/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/46/website"><img src="https://opencollective.com/hledger/individual/46/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/47/website"><img src="https://opencollective.com/hledger/individual/47/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/48/website"><img src="https://opencollective.com/hledger/individual/48/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/49/website"><img src="https://opencollective.com/hledger/individual/49/avatar.svg?avatarHeight=100"></a>
<a href="https://opencollective.com/hledger/individual/50/website"><img src="https://opencollective.com/hledger/individual/50/avatar.svg?avatarHeight=100"></a>
If your logo/avatar needs to be added, [let me know](mailto:webmaster@hledger.org)! <!-- (If your logo/avatar isn't appearing here, eg because you didn't use Open Collective, please [let me know](mailto:webmaster@hledger.org).) -->

View File

@ -1,407 +0,0 @@
# Releasing
<div class=pagetoc>
<!-- toc -->
</div>
Notes for hledger release managers and maintainers.
## Goals
### 2022
- Update/consolidate release process docs
- Establish routine monthly release cadence
- Make releasing easy
## Release types
| | Major&nbsp;release<br>A.B | Bugfix&nbsp;release<br>A.B.C | Fixup&nbsp;release<br>A.B.C.D | Preview&nbsp;release<br>A.B.99.D |
|-----------------------|--------------------------------|------------------------------|----------------------------------------------|------------------------------------------|
| **Contains:** | New features, breaking changes | Only bug fixes | Trivial packaging fixes, no software changes | Early snapshot of the next major release |
| **When:** | Third month of quarter: March, June, September, December | When needed | Never | First & second months of quarter |
| | | | | |
| **Deliverables:** | | | | |
| Changelogs | ✓ | ✓ | ✓ | ✓ |
| Github release | ✓ | ✓ | ✓ | ✓ |
| Binaries | ✓ | ✓ | ✓ | ✓ |
| Hackage release | ✓ | ✓ | ✓ | |
| Install page | ✓ | ✓ | ✓ | |
| hledger-install | ✓ | ✓ | ✓ | |
| [Regression bounty] | ✓ | ✓ | ✓ | |
| Release notes | ✓ | ✓ | | |
| Web manuals | ✓ | | | |
| Announcements | ✓ | | | |
[Regression bounty]: http://hledger.org/regressionbounty
hledger major releases happen in the third month of each quarter, normally at or close to the start of the month.
Preview releases happen in the other months, if needed.
Here's the ideal release schedule:
| Q1 | Q2 | Q3 | Q4 |
|------------------|------------------|------------------|------------------|
| Jan 1: preview 1 | Apr 1: preview 1 | Jul 1: preview 1 | Oct 1: preview 1 |
| Feb 1: preview 2 | May 1: preview 2 | Aug 1: preview 2 | Nov 1: preview 2 |
| Mar 1: major | Jun 1: major | Sep 1: major | Dec 1: major |
## Glossary
Here are some definitions, useful eg when executing or automating release procedures.
| | |
|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| | **General concepts** |
| *release* | A snapshot of the software and related artifacts like executable binaries, which is named, tagged, documented, announced, and usually picked up by packaging systems on various platforms. |
| *version control system, VCS* | A tool used for storing and sharing and viewing the history and different lines of development of a software project, or other set of files. hledger uses Git. |
| *repository, repo* | A set of files being stored and managed by a VCS. Often published on a *repository hosting service*, such as Github. |
| *working copy, clone* | A local copy of a repository's files. Typically each developer has one or more of these, and can share changes easily with the official public repository. |
| *branch* | Some VCS's, including Git, can store multiple branching lines of development within one repository. A working copy can be quickly switched to a different branch to show its content. |
| *master, main* | The main branch in a repo, usually named `master` or `main`. Pull requests are usually relative to this. |
| *pull request, PR* | A request to merge a development branch with master, and any related discussion. On Github, these are kept alongside issues in the issue tracker. |
| *continuous integration, CI* | Automated actions that run when new code is pushed to a shared repo, such as running tests or producing binaries. On Github this is called Github Actions and action scripts are called *workflows*. |
| | **hledger concepts** |
| *package* | A releasable unit of Haskell software. hledger has several core packages usually released together: hledger-lib, hledger, hledger-ui, hledger-web. |
| *hledger version number* | A 2-4 part dotted number naming a hledger release or hledger package version: `MA.JOR[.MINOR[.FIXUP]]` or `MA.JOR.99[.PREVIEW]` where 99 means "unreleased (MAJOR+1)". See examples below. |
| *hledger version string* | A line of text describing a hledger binary, shown by `--version`. It contains program name, version number, commit hash and date, machine architecture etc. Eg: `hledger 1.24.1-g7799d526b-20211210, mac-x86_64` |
| *Complete, partial, mixed releases* | A release of all the core hledger packages (hledger-lib, hledger, hledger-ui, hledger-web) is called *complete*. A release of only some of the core packages is called *partial*. A release where some packages have different versions (because of a previous partial release) is called *mixed*. Major and preview releases are always complete, bugfix and fixup releases can be partial and/or mixed. |
| *changelog* | A CHANGES.md file listing the release history and the changes in each release. There is one for each hledger package and one for the hledger project as a whole. |
| *release notes* | The Release Notes page on the hledger website: the combined release history of the core hledger packages, showing user visible changes only. |
| | **hledger release/build types** |
| *Major release* | Major releases include new features and incompatible API changes, and normally happen at the start of each quarter's third month (3/1, 6/1, 9/1, 12/1). Example version number: `1.25` |
| *Bugfix release* | Bugfix releases include only bug fixes, without API changes. These happen when needed, to fix significant bugs in the previous major release. Example version number: `1.25.2` (*"second bugfix release for 1.25"*) |
| *Fixup release* | Fixup releases fix packaging errors, with no changes to the hledger software. These should be rare. Example version number: `1.25.0.1` or `1.25.2.1` (*"first fixup release for 1.25 / 1.25.2"*) |
| *Preview release* | A preview of the upcoming major release for testers/early adopters, and a test of the release process, published on Github. Not a formal hledger release, eg not published on Hackage, usually not packaged, no bugfix releases, no regression bounties, not shown in release notes. These typically appear in the quarter's first and second month if needed. Example version number: `1.25.99.1` (*"preview 1 of 1.26"*) |
| *CI binaries* | Temporary downloadable binaries produced by a run of the `linux`/`mac`/`windows` workflows in the hledger repo. This may happen periodically, eg weekly. Downloading requires a Github login. |
| *Dev build* | A local developer build of unreleased code. This is typically in `master` or a development/PR branch. Example version number: `1.25.99` (*"unreleased 1.26-dev"*) |
| | **hledger repos and branches** |
| *hledger repo* | The `hledger` git repository, containing the hledger software, reference manuals, and developer docs. <https://github.com/simonmichael/hledger> |
| *site repo* | The `hledger_website` git repository, containing most of the hledger website which appears at <https://hledger.org>. Usually checked out under the hledger repo as `site/`. <https://github.com/simonmichael/hledger_website> |
| *master* | The branch named `master` in the hledger repo; the main line of hledger development. Pull requests are usually relative to this. |
| *release&nbsp;branch* | Branches named `MA.JOR-branch` in the hledger repo, eg `1.25-branch`. Releases and release previews are always made from a release branch. |
## Activities
Release manager activities/responsibilities include:
- **Software** - selecting changes, packages, release dates; coordinating contributions; ensuring release readiness
- **Branch Management** - coordinating main and release branch, local and remote repos, CI branches
- **Version Bumping** - choosing and applying new version numbers and related things like tags, github releases, urls, ghc and dep versions, stackage resolvers, everywhere needed
- **Docs** - command help, manuals, changelogs, release notes, github release notes, install page, install scripts, announcements, process docs
- **Testing** - local testing, CI testing, extra release-specific testing
- **Artifacts** - generating binaries, zip files, github releases etc.
- **Publishing** - uploading, pushing, making visible, finalising
- **Announcing** - various announcement stages and channels
These have complex interdependencies and sequencing constraints. Chunk, separate, routinise, document and automate them as far as possible.
## General tips
- Update changelogs early and often, eg during/after a PR, to spread the work.
See also [CHANGELOGS](CHANGELOGS.html).
- Release (or practice releasing) often.
- Follow RELEASING.md's procedures if helpful. Update a copy (RELEASING2.md) while releasing.
- The release process continually evolves. Don't document procedures in too much detail / prematurely.
- Make things a little better each time through: simpler, more reliable, better documented, more automated, easier, faster, cheaper, higher quality.
- Make releases from a release branch, not from master. Use the tools/release script.
- Before publishing a github release: prepare binaries, release notes, announcements, and tag.
- Before tagging: make binaries for all platforms, from the same commit.
- Before making binaries: do all possible pre-tagging steps and try to get everything finalised. (Binaries' --version shows their git hash, and this should match the release tag.)
## Procedures
### Do a release
- save RELEASING.md as RELEASING2.md
- [check release readiness](#check-release-readiness)
- start making draft binaries: push to `origin/binaries`, resolve failures
- update changelogs: see CHANGELOGS.md
- [make release notes](#make-release-notes)
- choose version: MA.JOR, MA.JOR.MINOR, or MA.JOR.MINOR.FIXUP
- [prepare release branch](#prepare-release-branch) (preview/major release)
or cherry pick changes from master (bugfix/fixup release)
- [make new manuals](#make-new-manuals) (major release)
- [update hledger-install](#update-hledger-install) (major/bugfix/fixup release)
- [update install page](#update-install-page) (major/bugfix/fixup release)
- [make announcement](#make-announcement) (major/bugfix release)
- [tag the release](#tag-the-release)
- [make release binaries](#make-release-binaries)
- [make github release](#make-github-release) draft
- upload to hackage: `make hackageupload` (major/bugfix/fixup release)
- publish github release
- publish website changes: manuals, release notes, install page
- [announce release](#announce-release) (major/bugfix release)
- move RELEASING2 updates back to RELEASING, commit
- [cherry-pick release branch to master](#cherry-pick-release-branch-to-master)
- bump master to next version: `./Shake setversion A.BB.99` (major release)
#### Check release readiness
- master's changelogs are up to date (see [CHANGELOGS](CHANGELOGS.html))
- master or release branch is ready for release
- clean and synced working copy
- no pending release-blocking issues/prs
- tests pass
- Shake is up to date
- uses same resolver as stack.yaml
- uses any required workarounds in stack.yaml
- binary is up to date (`./Shake.hs`)
- commit any changes (msg: `tools: shake`)
- appropriate timing, release manager availability
#### Make release notes
In site repo:
- update `src/release-notes.md`
- copy template, uncomment
- replace date
- replace XX with NEW
- add new changelog sections, excluding hledger-lib
- remove any empty sections
- add contributors, `git shortlog -sn OLD..NEW`
- add summary (major release) or remove it (bugfix release)
- check preview in vs code
- commit: `relnotes: NEW`
#### Prepare release branch
- `PAUSE=1 ECHO=1 tools/release prep MA.JOR[.99.PREVIEWNUM]` (eg 1.24.99.1 for 1.25 preview 1)
(XXX seems to go wrong without PAUSE`)
- cherry pick changes from master
- list changes in three side-by-side magit windows
- 1. NEW IN MASTER: `l o MAJORVER-branch..master`, `M-x magit-toggle-buffer-lock`, `M-x toggle-window-dedicated` (`C-c D`)
- 2. HEAD: regular magit status view
- 3. RELEASE BRANCH: `l o MAJORVER-branch`, `M-x magit-toggle-buffer-lock`, `M-x toggle-window-dedicated`
- in master window, working from bottom upward, cherry-pick all non-conflicting changes
- skip changes already in release branch
- skip changelog, command help, and manuals updates
- `./Shake cmdhelp -c`
- `./Shake manuals -c`
- update release changelogs (see [CHANGELOGS](CHANGELOGS.html))
- release branch testing
- `stack build --test`
- `make functest`
- `stack exec -- hledger --version`, check version
- `stack exec -- hledger help | tail`, check version & date
#### Make new manuals
In site repo:
- js/site.js: add NEW, update currentrelease
- Makefile: add NEW, two places
- make snapshot-NEW (after ensuring main repo has been release-tagged)
- commit: `current, makefile, site.js: NEW`
- push
#### Update hledger-install
- update `hledger-install/hledger-install.sh`
- HLEDGER_INSTALL_VERSION
- RESOLVER
- HLEDGER_*_VERSION
- EXTRA_DEPS
- test ? `cd; bash ~/src/hledger/hledger-install/hledger-install.sh`
- commit: `install: NEW`
#### Update install page
In site repo:
- update `install.md`
- query-replace OLD -> NEW in
- "current hledger release"
- CI binaries badges/links, including linux-static-arm32v7 if built
- "building from source"
- stack install command
- cabal install command
- query-replace OLD-brightgreen -> OLD-red
- only after release binaries are built (preferably after release is published):
update --version outputs (search: hledger --version)
- final output line from `hledger test` (run in terminal for normal speed)
- Total count from `make functest`
- commit: `download: NEW`
#### Make announcement
In release branch:
- update `doc/ANNOUNCE` (major release)
- summary, contributors from release notes
- any other edits
- commit: `;doc: announce`
#### Tag the release
- `make tag`
#### Make release binaries
- `tools/release bin`
- get all platforms built on the same commit
- download binary artifact zip files
#### Make github release
- `git push origin MA.JOR-branch && git push --tags` (or magit `P p`, `P t`)
- copy text from previous similar release, https://github.com/simonmichael/hledger/releases
- create new release, https://github.com/simonmichael/hledger/releases/new
- select release tag (MA.JOR[...])
- set title (MA.JOR[...])
- paste & replace with new release notes
- upload CI binaries
- save as draft
- github release testing: preview on github, upload to hackage
- publish
#### Announce release
- pause; take a break afk; check time and energy
- push main repo
- push site repo
- deploy site changes
On hledger.org:
- in /etc/caddy/hledger.org:
- @oldmanpath: add `path` for NEW
- @unversionedmanpath: update to NEW
- `systemctl reload caddy`
- in main repo, `./Shake webmanuals` to update dev manuals
- in site repo, `make`
- things to try if site doesn't seem to update ?
- make clean all
- purge cloudflare cache
- browsers might still require shift-reload for a while to see new manuals (safari)
- share release notes link and markdown content in #hledger chat
- send ANNOUNCE as email announcement
- major release: `ANN: hledger NEW` to hledger@googlegroups.com, haskell-cafe@googlegroups.com
- bugfix release: brief announcement to hledger@googlegroups.com
- condense & tweet at https://twitter.com/simonkwmichael
- update last release date on plaintextaccounting.org
<!-- - toot at https://fosstodon.org/web/accounts/106304084994827771 ? -->
#### Cherry-pick release branch to master
- switch back to master
- update master changelogs, merging final release changelog entries (see [CHANGELOGS](CHANGELOGS.html))
- cherry-pick other useful changes, such as `;doc: ANNOUNCE`
- after a major release: bump master to new dev version (`./Shake setversion -c A.B.99`)
### Do post-release followup
- monitor packaging status, update install page
- docker - expect/merge PR
- homebrew - expect badge to update soon
- nix - expect `make nix-hledger-version` to update after a few days, find and update to that commit hash
- linux distros - once in a while, follow the links & search for newer versions, update
- provide support, monitor issues
- prepare followup releases if needed
- update process docs and tools
### Update packaging
#### Update homebrew formula
1. ref
1. helpers: chenrui & stack issue commenters on github, Athas on
#haskell
2. <https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request>
3. doc
If a URL is specified, the SHA-256 checksum of the new download
should also be specified. A best effort to determine the SHA-256
and formula name will be made if either or both values are not
supplied by the user.
If a tag is specified, the Git commit revision corresponding to
that tag must also be specified.
Note: this command cannot be used to transition a formula from a
URL-and-SHA-256 style specification into a tag-and-revision
style specifi- cation, nor vice versa. It must use whichever
style specification the for- mula already uses.
2. update homebrew working copy
1. cd \~/src/DEVTOOLS/homebrew-core
2. git reset --hard HEAD\~1 && git fetch origin && git merge
origin/master && git push -f
3. get release tarball checksums
export V=X.Y; for P in -lib \"\" -ui -web; do curl -sO
<https://hackage.haskell.org/package/hledger$P-$V/hledger$P-$V.tar.gz>;
done && shasum -a256 \*.gz
4. update Formula/hledger.rb
1. update tarball urls, shas
2. update other version references
3. maybe update stackage snapshot
4. possible new process, see:
<https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request#create-your-pull-request-from-a-new-branch>
5. test (if possible without too many mac/brew hassles)
1. brew audit --strict Formula/hledger.rb \# some tests are
post-install, try also after brew upgrade
2. brew upgrade Formula/hledger.rb -s -n -v \# \[scrub download
cache, dry run, verbose\]
1. super slow, how to speed up ?
1. comment out stack update
2. add , \"--stack-root=/Users/simon/.stack\" to stack
install \# fails on permissions
3. brew test Formula/hledger.rb
6. commit with name \"hledger X.Y\" and description \"Update to
hledger X.Y.\"
5. get merged
1. git push -f simonmichael
2. gh pr create -f
3. monitor: PR CI, PR merge,
<https://formulae.brew.sh/formula/hledger> page
4. ping brew contributors/maintainers if necessary: @chenrui,
@carlocab, @SMillerDev
#### Update nix install command
1. Wait for the new hledger version to land in nixpkgs
1. make nix-hledger-version
2. Find the nixpkgs haskell-packages commit post-dating the hledger
release:
1. make nix-view-commits \#
<https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/haskell-modules/hackage-packages.nix>
3. Test the nix-env install command with that commit hash
1. if it fails with \"SSL peer certificate or SSH remote key was
not OK\"
1. . *Users/simon*.nix-profile/etc/profile.d/nix.sh
2. or re-install:
1. curl -sO <https://nixos.org/nix/install>
2. less install
3. sh install
4. . *Users/simon*.nix-profile/etc/profile.d/nix.sh
2. on linux
3. on mac
#### Update stackage
1. update
<https://github.com/fpco/stackage/blob/master/build-constraints.yaml>
if needed
2. monitor for new package versions in nightly: check
<https://www.stackage.org/package/hledger>

View File

@ -1,72 +0,0 @@
* ROADMAP.org
#+OPTIONS: -:nil
Ideas about where the hledger project should be going next. Being
listed here suggests a bit of commitment, perhaps even a schedule.
** Targets
*** Next Targets
*** Past Targets
**** hledger 1.19, 2020-09-01
account transactions register, stricter/more correct handling of
unbalanced multicommodity transactions (#1177), Track & show deposited
lots (#1022), Report unrealized capital gains/losses (#1029)
**** hledger 1.18, 2020-06-01
more effective CI setup, updated home page, quickstart, tutorials
etc., negative matching in CSV rules,
**** hledger 1.17, 2020-03-01
field matching in CSV rules, reduce install hassles with terminfo C
lib (?), more import/export options, simple console charts, refreshed
home page, faq, tutorials, manuals,
**** hledger 1.16, 2019-12-01
ghc 8.8 support, more powerful CSV conversion, updated home page, faq,
manuals, reduce install hassles with terminfo C lib
** 2020 Priorities
*** Documentation
Improve the docs.
- home & faq
- manuals (more discoverable structure of web manuals)
- cookbook docs (survey, plan, update)
- contrib guide (update, build from readmes)
*** Effectiveness
Improve getting-started experience, just-works quality, practicality,
real-world usefulness.
- ghc 8.8, get back in stackage nightly
- install issues (C libs..)
- more powerful CSV conversion
- fill out holes in feature matrix
*** Investment
Improve suitability for investment tracking
([[https://github.com/simonmichael/hledger/issues/1015][#1015]])
- market price inference from transactions
- easy market price fetching
- lot tracking
- capital gains reporting
*** Charts
Add charts and more visual appeal.
- console charts, basic bar charts
- clarify architecture/UI for charts
- graphical charts using Chart/matplotlib/hvega
- review/design/add more attractive/colourful output (see eg
taskwarrior)
*** Correctness
More support for enforcing correctness & accounting rules.
- account names
- commodity symbols
- payees
- notes/descriptions ?
- account lifetimes ?
- account balance conditions ?
- transaction templates ?

View File

@ -1,13 +0,0 @@
# Shake
`Shake.hs` in the top directory complements the Makefile; it is used for some more complex tasks, such as building documentation and the web site.
Compile it:
./Shake.hs # or, make Shake
See help:
./Shake

439
Shake.hs
View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack script --resolver nightly-2022-09-01 --compile {- stack script --resolver nightly-2025-09-30 --compile
--extra-include-dirs /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/ffi --extra-include-dirs /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/ffi
--package base-prelude --package base-prelude
--package directory --package directory
@ -14,25 +14,15 @@
-- add this to see packages being installed instead of a long silence: -- add this to see packages being installed instead of a long silence:
--verbosity=info --verbosity=info
This is one of two collections of maintainer/developer scripts; Makefile is the other. Heavy project scripts, with file dependencies, using https://shakebuild.com.
This one, based on shake, provides a stronger programming language and See also justfile, Makefile.
more platform independence. It requires stack and will auto-install Also uses tools like:
the haskell packages above when needed.
Some of the commands below require additional command-line tools, including:
- hpack (same version that's in current stack release) - hpack (same version that's in current stack release)
- GNU date (on mac: brew install coreutils) - GNU date (on mac, get it with brew install coreutils)
- groff - pandoc, groff, m4, makeinfo, sed, mv, cat, rm
- m4
- makeinfo
- pandoc
- sed
- mv
- cat
- rm
Some things that may be useful when working on this: Some things that may be useful when working on this:
- https://docs.haskellstack.org/en/stable/GUIDE/#script-interpreter - https://docs.haskellstack.org/en/stable/topics/scripts
- watch Shake.hs for compile errors: make ghcid-shake - watch Shake.hs for compile errors: make ghcid-shake
- load Shake.hs in GHCI: make ghci-shake - load Shake.hs in GHCI: make ghci-shake
- rebuild things when files change with entr (file watcher), eg: - rebuild things when files change with entr (file watcher), eg:
@ -60,13 +50,14 @@ import "safe" Safe
import "shake" Development.Shake import "shake" Development.Shake
import "shake" Development.Shake.FilePath import "shake" Development.Shake.FilePath
import "time" Data.Time import "time" Data.Time
-- import Debug.Trace
-- import "hledger-lib" Hledger.Utils.Debug -- import "hledger-lib" Hledger.Utils.Debug
usage = usage =
let scriptname = "Shake" in replaceRe [re|/Shake|] ('/':scriptname) $ let scriptname = "Shake" in replaceRe [re|/Shake|] ('/':scriptname) $
unlines unlines
---------------------------------------79-------------------------------------- ---------------------------------------79--------------------------------------
["hledger developer scripts. See also: make help" ["Shake: for heavier project scripting. See also Justfile"
,"Usage:" ,"Usage:"
,"./Shake.hs [CMD [ARGS]] run CMD, compiling this script first if needed" ,"./Shake.hs [CMD [ARGS]] run CMD, compiling this script first if needed"
,"./Shake [CMD [ARGS]] run CMD, using the compiled version of this script" ,"./Shake [CMD [ARGS]] run CMD, using the compiled version of this script"
@ -75,10 +66,11 @@ usage =
,"./Shake setversion [VER] [PKGS] [-c]" ,"./Shake setversion [VER] [PKGS] [-c]"
," update versions in source files to */.version or VER" ," update versions in source files to */.version or VER"
," and update */*.cabal files" ," and update */*.cabal files"
,"./Shake cmdhelp [-c] update hledger CLI commands' help texts" ,"./Shake hledger-install-version update some version strs in hledger-install"
,"./Shake mandates update the date shown in some manual formats" ,"./Shake cmddocs [-c] update all hledger's COMMAND.md and COMMAND.txt files,"
,"./Shake manuals [-c] update all packages' txt/man/info/web manuals" ," used for --help, manuals etc. (run after changing"
-- ,"./Shake webmanuals update just the web manuals" ," COMMAND.md or command options or general options)"
,"./Shake manuals [-c] update the packages' embedded info/man/txt manuals"
,"./Shake changelogs [-c] [-n/--dry-run]" ,"./Shake changelogs [-c] [-n/--dry-run]"
," update CHANGES.md files, adding new commits & headings" ," update CHANGES.md files, adding new commits & headings"
,"./Shake docs [-c] update all program docs (CLI help, manuals, changelogs)" ,"./Shake docs [-c] update all program docs (CLI help, manuals, changelogs)"
@ -92,8 +84,10 @@ usage =
,"" ,""
,"See comments in Shake.hs for more detailed descriptions." ,"See comments in Shake.hs for more detailed descriptions."
,"Add -c/--commit to have commands commit their changes." ,"Add -c/--commit to have commands commit their changes."
,"Add -V/-VV/-VVV to see more verbose output." ,"Add -B (on its own) to force rebuilding."
,"Add -B, with nothing immediately after it, to force rebuilding." ,"Add -V/-VV/-VVV/-VVVV to see more verbose output."
,"Add --skip-commands to try to avoid running external commands"
,"(not a true dry run; some cmd calls may still run, code may do IO, etc)."
] ]
-- TODO -- TODO
-- ,"./Shake releasebranch create a new release branch, bump master to next dev version (.99)" -- ,"./Shake releasebranch create a new release branch, bump master to next dev version (.99)"
@ -103,9 +97,8 @@ usage =
-- groff = "groff -c" ++ " -Wall" -- see "groff" below -- groff = "groff -c" ++ " -Wall" -- see "groff" below
m4 = "m4 -P" m4 = "m4 -P"
makeinfo = "makeinfo --no-split --force --no-warn --no-validate" -- silence makeinfo warnings, comment these to see them makeinfo = "makeinfo -cASCII_PUNCTUATION=1 --no-split --force --no-warn --no-validate" -- silence makeinfo warnings, comment these to see them
pandoc = "pandoc --strip-comments" pandoc = "pandoc --strip-comments"
gitcommit = "git commit --allow-empty"
-- We should work with both BSD and GNU sed. Tips: -- We should work with both BSD and GNU sed. Tips:
-- use [a-z] [0-9] instead of \w \d etc. -- use [a-z] [0-9] instead of \w \d etc.
@ -152,9 +145,11 @@ main = do
-- hledger manual also includes the markdown files from here: -- hledger manual also includes the markdown files from here:
let commandsdir = "hledger/Hledger/Cli/Commands" let commandsdir = "hledger/Hledger/Cli/Commands"
commandmds <- commandmds <-
filter (not . ("README." `isPrefixOf`) . takeFileName) . filter (".md" `isSuffixOf`) . map (commandsdir </>) sort . filter (not . ("README." `isPrefixOf`) . takeFileName) . filter (".md" `isSuffixOf`) . map (commandsdir </>)
<$> S.getDirectoryContents commandsdir <$> S.getDirectoryContents commandsdir
let commandtxts = map (-<.> "txt") commandmds let
commandmdsnew = map (<.> "new") commandmds
commandtxts = map (-<.> "txt") commandmds
-- Run the shake rule selected by the first command line argument. -- Run the shake rule selected by the first command line argument.
-- Other arguments and some custom flags are set aside for the rule -- Other arguments and some custom flags are set aside for the rule
@ -199,7 +194,7 @@ main = do
pkgdirs = packages pkgdirs = packages
pkgandprojdirs = "" : pkgdirs pkgandprojdirs = "" : pkgdirs
cabalfiles = [p </> p <.> "cabal" | p <- packages] cabalfiles = [p </> p <.> "cabal" | p <- packages]
changelogs = map (</> "CHANGES.md") pkgandprojdirs changelogs = map (</> "CHANGES.md") pkgdirs ++ ["doc/CHANGES.md"]
packagemanversionm4s = [p </> ".version.m4" | p <- packages] packagemanversionm4s = [p </> ".version.m4" | p <- packages]
packagemandatem4s = [p </> ".date.m4" | p <- packages] packagemandatem4s = [p </> ".date.m4" | p <- packages]
@ -274,6 +269,7 @@ main = do
-- Regenerate .cabal files from package.yaml files. -- Regenerate .cabal files from package.yaml files.
-- (used by "cabalfiles" and "setversion") -- (used by "cabalfiles" and "setversion")
-- XXX should remove old cabal files first, otherwise fails if they were generated with newer hpack
let gencabalfiles = do let gencabalfiles = do
-- Update cabal files with stack build. -- Update cabal files with stack build.
@ -289,14 +285,14 @@ main = do
-- It should be the same hpack version that's in current stack, to avoid commit conflicts. -- It should be the same hpack version that's in current stack, to avoid commit conflicts.
forM_ pkgdirs $ \d -> cmd_ (Cwd d) Shell "hpack --no-hash" forM_ pkgdirs $ \d -> cmd_ (Cwd d) Shell "hpack --no-hash"
when commit $ do when commit $ commitIfChanged ";cabal: update cabal files" cabalfiles
let msg = ";cabal: update cabal files"
cmd Shell gitcommit ("-m '"++msg++"' --") cabalfiles
-- Update version strings in most "source" files to match what's in PKG/.version. -- setversion [VER] [PKGS] [-c]
-- If a version number is provided as first argument, save that in PKG/.version files first. -- Update version strings in all packages, or just the ones specified.
-- If one or more subdirectories are provided as arguments, save/update only those. -- If a version number is provided as first argument, save that in .version files first.
-- Also regenerates .cabal files from package.yaml files. -- Then update various source files to match what's in their nearby .version file, such as:
-- package.yaml files, .cabal files (regenerating from package.yaml), .version.m4 files.
-- With -c, also commit the changes.
-- See also CONTRIBUTING.md > Version numbers. -- See also CONTRIBUTING.md > Version numbers.
phony "setversion" $ do phony "setversion" $ do
let let
@ -311,7 +307,7 @@ main = do
Just v -> liftIO $ forM_ specifiedversionfiles $ flip maybeWriteFile (v++"\n") Just v -> liftIO $ forM_ specifiedversionfiles $ flip maybeWriteFile (v++"\n")
Nothing -> return () Nothing -> return ()
-- update "source" files depending on .version in the specified packages -- update source files depending on .version in the specified packages
let dependents = map (</> ".version.m4") specifiedpkgs let dependents = map (</> ".version.m4") specifiedpkgs
++ map (</> "package.yaml") specifiedpkgs ++ map (</> "package.yaml") specifiedpkgs
need dependents need dependents
@ -319,7 +315,7 @@ main = do
-- and maybe commit them -- and maybe commit them
when commit $ do when commit $ do
let msg = unwords [ let msg = unwords [
";pkg: bump" ";pkg: set"
,case dirargs of ,case dirargs of
[] -> "version" [] -> "version"
ds -> intercalate ", " ds ++ " version" ds -> intercalate ", " ds ++ " version"
@ -327,22 +323,31 @@ main = do
Nothing -> "" Nothing -> ""
Just v -> "to " ++ v Just v -> "to " ++ v
] ]
cmd Shell gitcommit ("-m '"++msg++"' --") specifiedversionfiles dependents commitIfChanged msg $ specifiedversionfiles ++ dependents
gencabalfiles gencabalfiles
-- Update some of the version strings in hledger-install/hledger-install.sh. Manual fixup will be needed.
-- Not done by setversion since that is used on master, where the production hledger-install is.
phony "hledger-install-version" $ do
let versionfile = ".version"
let out = "hledger-install/hledger-install.sh"
version <- ((headDef (error $ "failed to read " <> versionfile) . words) <$>) $ liftIO $ readFile versionfile
cmd_ Shell sed "-i -e" ("'s/(^HLEDGER_INSTALL_VERSION)=.*/\\1='`date +%Y%m%d`'/'") out
cmd_ Shell sed "-i -e" ("'s/(^HLEDGER(|_LIB|_UI|_WEB)_VERSION)=.*/\\1="++version++"/'") out
-- PKG/.version.m4 <- PKG/.version, just updates the _version_ macro -- PKG/.version.m4 <- PKG/.version, just updates the _version_ macro
"hledger*/.version.m4" %> \out -> do "hledger*/.version.m4" %> \out -> do
let versionfile = takeDirectory out </> ".version" let versionfile = takeDirectory out </> ".version"
need [versionfile] need [versionfile]
version <- ((head . words) <$>) $ liftIO $ readFile versionfile version <- ((headDef (error $ "failed to read " <> versionfile) . words) <$>) $ liftIO $ readFile versionfile
cmd_ Shell sed "-i -e" ("'s/(_version_}}, *)\\{\\{[^}]+/\\1{{"++version++"/;'") out cmd_ Shell sed "-i -e" ("'s/(_version_}}, *)\\{\\{[^}]+/\\1{{"++version++"/;'") out
-- PKG/package.yaml <- PKG/.version, just updates version strings -- PKG/package.yaml <- PKG/.version, just updates version strings
"hledger*/package.yaml" %> \out -> do "hledger*/package.yaml" %> \out -> do
let versionfile = takeDirectory out </> ".version" let versionfile = takeDirectory out </> ".version"
need [versionfile] need [versionfile]
version <- ((head . words) <$>) $ liftIO $ readFile versionfile version <- ((headDef (error $ "failed to read " <> versionfile) . words) <$>) $ liftIO $ readFile versionfile
let ma:jor:_ = splitOn "." version let ma:jor:_ = splitOn "." version
nextmajorversion = intercalate "." [ma, show $ read jor+1] nextmajorversion = intercalate "." [ma, show $ read jor+1]
@ -410,20 +415,21 @@ main = do
-- MANUALS -- MANUALS
-- Generate the manuals in plain text, nroff, info, and markdown formats. -- Generate the manuals in plain text, nroff, info, and markdown formats.
-- NB you should run "Shake cmddocs" before this, it's not automatic (?)
phony "manuals" $ do phony "manuals" $ do
need $ concat [ need $ concat [
nroffmanuals ["mandates"]
,nroffmanuals
,infomanuals ,infomanuals
-- ,[infodir] -- ,[infodir]
,txtmanuals ,txtmanuals
,webmanuals ,webmanuals
] ]
when commit $ do when commit $
let msg = ";doc: update manuals" commitIfChanged ";doc: update embedded manuals" $
cmd Shell gitcommit ("-m '"++msg++"' --") packagemandatem4s nroffmanuals infomanuals infodirentries txtmanuals -- infodir concat [commandmds, packagemandatem4s, nroffmanuals, infomanuals, infodirentries, txtmanuals] -- infodir
-- Update the dates to show in man pages, to the current month and year. -- Update the dates to show in man pages, to the current month and year.
-- Currently must be run manually when needed.
-- Dates are stored in PKG/.date.m4, and are committed along with manuals by Shake manuals -c. -- Dates are stored in PKG/.date.m4, and are committed along with manuals by Shake manuals -c.
phony "mandates" $ do phony "mandates" $ do
date <- chomp . fromStdout <$> (cmd Shell "date +'%B %Y'" :: Action (Stdout String)) date <- chomp . fromStdout <$> (cmd Shell "date +'%B %Y'" :: Action (Stdout String))
@ -470,7 +476,10 @@ main = do
-- remove with col -b, but it doesn't as can be seen with groff -V.) -- remove with col -b, but it doesn't as can be seen with groff -V.)
-- To get plain text, we run groff's lower-level commands (from -V) and add -cbuo. -- To get plain text, we run groff's lower-level commands (from -V) and add -cbuo.
-- -Wall silences most troff warnings, remove to see them -- -Wall silences most troff warnings, remove to see them
cmd Shell "tbl" src "| eqn -Tascii | troff -Wall -mandoc -Tascii | grotty -cbuo >" out -- XXX eqn complains on nonascii chars, not needed ?
-- cmd Shell "tbl" src "| eqn -Tascii | troff -Wall -mandoc -Tascii | grotty -cbuo >" out
-- XXX how to silence wide table warnings (generated by tbl, reported by troff) ?
cmd Shell "tbl" src "| troff -Wall -mandoc -Tascii | grotty -cbuo >" out
-- Generate Info manuals suitable for viewing with info, from the .m4.md source. -- Generate Info manuals suitable for viewing with info, from the .m4.md source.
infomanuals |%> \out -> do -- hledger/hledger.info infomanuals |%> \out -> do -- hledger/hledger.info
@ -532,15 +541,30 @@ main = do
else h else h
-- assume any other .m4.md files in dir are included by this one XXX not true in hledger-lib -- assume any other .m4.md files in dir are included by this one XXX not true in hledger-lib
subfiles <- liftIO $ filter (/= src) . filter (".m4.md" `isSuffixOf`) . map (dir </>) <$> S.getDirectoryContents dir subfiles <- liftIO $ filter (/= src) . filter (".m4.md" `isSuffixOf`) . map (dir </>) <$> S.getDirectoryContents dir
let deps = [src, commonm4, commandsm4, packageversionm4, packagemandatem4] ++ subfiles let deps = [src, commonm4, packageversionm4, packagemandatem4] ++ subfiles
need deps need deps
when (manual=="hledger") $ need commandmds when (manual=="hledger") $ need $ commandsm4 : commandmds
-- add the web page's heading. -- add the web page's heading.
-- XXX Might be nice to do this atomically with the below, so -- XXX Might be nice to do this atomically with the below, so
-- make avoid any double refresh when watch docs with entr/livereload. -- make avoid any double refresh when watch docs with entr/livereload.
-- But cmd Shell doesn't handle arguments containing spaces properly. -- But cmd Shell doesn't handle arguments containing spaces properly.
liftIO $ writeFile out $ unlines [ let
"<!-- " ++ "Generated by \"Shake webmanuals\" from " ++ unwords deps ++ " -->" aboutmsg =
["<!-------------------------------------------------------------------------"
,"Don't edit this file directly."
,"Instead, in the hledger repo's master branch edit the source file, one of:"
] <>
[" hledger/Hledger/Cli/Commands/commands.m4" | manual=="hledger"] <>
[" hledger/Hledger/Cli/Commands/*.md" | manual=="hledger"] <>
[" " <> intercalate "\n " deps
,""
,"If the change needs to be applied to past releases' manuals on hledger.org,"
,"see https://hledger.org/DOCS.html, or ask the maintainer to help."
,"-------------------------------------------------------------------------->"
]
liftIO $ writeFile out $ unlines $
aboutmsg <>
[""
,"<div class=\"docversions\"></div>" ,"<div class=\"docversions\"></div>"
,"" ,""
,"# " ++ heading ,"# " ++ heading
@ -590,164 +614,173 @@ main = do
-- This may also update .cabal files from package.yaml files, and/or install haskell deps. -- This may also update .cabal files from package.yaml files, and/or install haskell deps.
phony "build" $ do phony "build" $ do
let let
pkgs | null args = packages args' = drop 1 args
| otherwise = args pkgs | null args' = packages
| otherwise = args'
sequence_ [ do sequence_ [ do
need $ fromMaybe [] $ lookup pkg embeddedFiles need $ fromMaybe [] $ lookup pkg embeddedFiles
cmd Shell "stack build " pkg :: Action () cmd Shell "stack build " pkg :: Action ()
| pkg <- pkgs | pkg <- pkgs
] ]
-- regenerate Hledger/Cli/Commands/*.txt from the .md source files for CLI help -- Using the current hledger build, run all commands to update their options help in COMMAND.md,
phony "cmdhelp" $ do -- then regenerate all the COMMAND.txt from COMMAND.md.
-- With -c, also commit any changes in the .md and .txt files.
-- The hledger build should up to date when running this. XXX how to check ? need ["build"] is circular
phony "cmddocs" $ do
liftIO $ putStrLn "please ensure the hledger build is up to date. Running all commands..."
need commandtxts need commandtxts
when commit $ do when commit $ commitIfChanged ";doc: update command docs" $ commandmds <> commandtxts
let msg = ";doc: update CLI usage texts"
cmd Shell gitcommit ("-m '"++msg++"' --") commandtxts
-- Regenerate Hledger/Cli/Commands/*.txt from the corresponding .md files,
-- after first updating the options help within those.
commandtxts |%> \out -> do commandtxts |%> \out -> do
let src = out -<.> "md" let src = out -<.> "md"
need [src] liftIO $ putStrLn ("generating " <> out)
need [src <.> "new"] -- 1. depend on phony target that updates the options help in src
need [src] -- 2. depend on the now updated src
cmd Shell cmd Shell
pandoc fromsrcmd src "--lua-filter" "tools/pandoc-dedent-code-blocks.lua" "-t plain" ">" out pandoc fromsrcmd src "--lua-filter" "tools/pandoc-dedent-code-blocks.lua" "-t plain" ">" out
-- -- Update each Hledger/Cli/Commands/*.md, replacing the ```flags block with latest --help output,
-- -- or a placeholder if there are no command-specific flags.
-- -- For hledger manual and also for cmddocs below.
-- -- NB hledger executables should be up to date, see cmddocs
-- phony "optdocs" $ do
-- need commandmdsnew
-- when commit $ commitIfChanged ";doc: update command flag docs" commandmds
-- hledger/Hledger/Cli/Commands/CMD.md.new: a phony target that updates the ```flags block
-- within hledger/Hledger/Cli/Commands/CMD.md with the output of "stack run -- hledger CMD --help".
-- If that fails, a warning is printed and it carries on, keeping the old options help.
-- NB this needs the hledger build to be up to date, see cmddocs.
phonys $ \out ->
if not $ "hledger/Hledger/Cli/Commands/" `isPrefixOf` out && ".md.new" `isSuffixOf` out
then Nothing
else Just $ do
let src = dropExtension out
need [src]
srcls <- fmap lines $ liftIO $ readFileStrictly src
let
(pre,rest) = break (=="```flags") srcls
(_,post) = span (/="```") rest
let cmdname = map toLower $ takeBaseName src
do
let shellcmd = "stack exec -- hledger -h " <> cmdname
-- liftIO $ putStrLn $ "running " <> shellcmd <> " to get options help"
cmdhelp <- lines . fromStdout <$> (cmd Shell shellcmd :: Action (Stdout String))
let
cmdflagshelp = takeWhile (not.null) $ dropWhile (/="Flags:") cmdhelp
cmdflagshelp'
| null cmdflagshelp = ["Flags:","no command-specific flags"]
| otherwise = cmdflagshelp
liftIO $ writeFile src $ unlines $ concat [pre, ["```flags"], cmdflagshelp', post]
-- This is supposed to print the error but otherwise ignore it, making this action a no-op,
-- in case hledger is not yet built/runnable.
`actionCatch` \(e::C.IOException) -> return ()
-- XXX should somehow control the output and elide the verbose "not found on path" errors
-- let elide err
-- | "path: [" `isInfixOf` err = takeWhile (/='[') err <> "..."
-- | otherwise = err
-- in \(e::C.IOException) -> liftIO $ hPutStrLn stderr $ elide $ show e -- not used
-- CHANGELOGS -- CHANGELOGS
let
-- git log showing short commit hashes
gitlog = "git log --abbrev-commit"
-- git log formats suitable for changelogs/release notes
-- %s=subject, %an=author name, %n=newline if needed, %w=width/indent1/indent2, %b=body, %h=hash
changelogGitFormat = "--pretty=format:'- %s (%an)%n%w(0,2,2)%b\n'"
-- changelogVerboseGitFormat = "--pretty=format:'- %s (%an)%n%w(0,2,2)%b%h' --stat"
-- Format a git log message, with one of the formats above, as a changelog item
changelogCleanupCmd = unwords [
sed
,"-e 's/^( )*\\* /\1- /'" -- ensure bullet lists in descriptions use hyphens not stars
,"-e 's/ \\(Simon Michael\\)//'" -- strip maintainer's author name
,"-e 's/^- (doc: *)?(updated? *)?changelogs?( *updates?)?$//'" -- strip some variants of "updated changelog"
,"-e 's/^ +\\[ci skip\\] *$//'" -- strip [ci skip] lines
,"-e 's/^ +$//'" -- replace lines containing only spaces with empty lines
-- ,"-e 's/\r//'" -- strip windows carriage returns (XXX \r untested. IDEA doesn't like a real ^M here)
,"-e '/./,/^$/!d'" -- replace consecutive newlines with one
]
-- Things to exclude when doing git log for project-wide changelog.
-- git exclude pathspecs, https://git-scm.com/docs/gitglossary.html#gitglossary-aiddefpathspecapathspec
projectChangelogExcludeDirs = unwords [
":!hledger-lib"
,":!hledger"
,":!hledger-ui"
,":!hledger-web"
,":!tests"
]
-- update all changelogs with latest commits -- update all changelogs with latest commits
phony "changelogs" $ do phony "changelogs" $ do
need changelogs need changelogs
when commit $ do when commit $ commitIfChanged ";doc: update changelogs" changelogs
let msg = ";doc: update changelogs"
cmd Shell gitcommit ("-m '"++msg++"' --") changelogs
-- [PKG/]CHANGES.md -- [PKG/]CHANGES.md [-n|--dry-run]
-- Add any new non-boring commits to the specified changelog, in -- Add any new commit messages to the specified changelog, idempotently.
-- an idempotent way, minimising manual toil, as follows. We look at: -- Or with -n/--dry-run, just print the new content to stdout.
-- -- Assumptions/requirements:
-- - the changelog's topmost markdown heading, which can be a -- 1. All releases nowadays are full releases (including all four packages).
-- dev heading (first word is a git revision like 4fffe6e7) or -- 2. The changelog's topmost markdown heading text is a release heading like "1.18.1 2020-06-21", or a more recent commit id like "4fffe6e7".
-- a release heading (first word is a release version & tag -- 3. When a release heading is added to a changelog, a corresponding release tag is also created.
-- like 1.18.1, second word is a date like 2020-06-21) or a
-- package release heading (hledger-ui-1.18.1).
--
-- - the package version, in the adjacent .version file, which
-- can be a dev version like 1.18.99 (first two digits of last
-- part are 97, 98 or 99) or a release version like 1.18.1
-- (any other cabal-style version).
--
-- The old changelog heading is removed if it was a dev heading;
-- new commits in PKG not prefixed with semicolon are added;
-- and a suitable new heading is added: a release heading if
-- the package version looks like a release version, otherwise
-- a dev heading with the current HEAD revision.
--
-- With -n/--dry-run, print new content to stdout instead of
-- updating the changelog.
--
phonys (\out -> if out `notElem` changelogs phonys (\out -> if out `notElem` changelogs
then Nothing then Nothing
else Just $ do else Just $ do
tags <- lines . fromStdout <$> (cmd Shell "git tag" :: Action (Stdout String)) let
-- shell command to run git log showing short commit hashes.
-- In 2024 git is showing 9 digits, 1 more than jj - show 8 for easier interop
gitlog = "git log --abbrev=8"
-- a git log format suitable for changelogs/release notes
-- %s=subject, %an=author name, %n=newline if needed, %w=width/indent1/indent2, %b=body, %h=hash
changelogGitFormat = "--pretty=format:'- %s (%an)%n%w(0,2,2)%b\n'"
-- changelogVerboseGitFormat = "--pretty=format:'- %s (%an)%n%w(0,2,2)%b%h' --stat"
-- shell command to format a git log message with the above format, as a changelog item
commitMessageToChangelogItemCmd = unwords [
sed
,"-e 's/^( )*\\* /\1- /'" -- ensure bullet lists in descriptions use hyphens not stars
,"-e 's/ \\(Simon Michael\\)//'" -- strip maintainer's author name
,"-e 's/^- (doc: *)?(updated? *)?changelogs?( *updates?)?$//'" -- strip some variants of "updated changelog"
,"-e 's/^ +\\[ci skip\\] *$//'" -- strip [ci skip] lines
,"-e 's/^ +$//'" -- replace lines containing only spaces with empty lines
-- ,"-e 's/\r//'" -- strip windows carriage returns (XXX \r untested. IDEA doesn't like a real ^M here)
,"-e '/./,/^$/!d'" -- replace consecutive newlines with one
]
-- Directories to exclude when doing git log for the project changelog.
-- https://git-scm.com/docs/gitglossary.html#gitglossary-aiddefpathspecapathspec
projectChangelogExcludes = unwords [
":!hledger-lib"
,":!hledger"
,":!hledger-ui"
,":!hledger-web"
,":!tests"
]
mpkg = if dir=="doc" then Nothing else Just dir where dir = takeDirectory out
-- Parse the changelog.
oldlines <- liftIO $ lines <$> readFileStrictly out oldlines <- liftIO $ lines <$> readFileStrictly out
let let
dir = takeDirectory out (preamble, oldheading:rest) = span isnotheading oldlines where isnotheading = not . ("#" `isPrefixOf`)
mpkg | dir=="." = Nothing oldversion = headDef err $ drop 1 $ words oldheading
| otherwise = Just dir
(preamble, oldheading:rest) = span isnotheading oldlines
where isnotheading = not . ("#" `isPrefixOf`)
-- changelog version: a hash or the last release version of this package (or the project)
changelogversion = headDef err $ drop 1 $ words oldheading
where err = error $ "could not parse changelog heading: "++oldheading where err = error $ "could not parse changelog heading: "++oldheading
-- prepend the package name if we are in a package (not the top-level project directory)
maybePrependPackage s = maybe s (++("-"++s)) mpkg
toTag = maybePrependPackage
isOldRelease rev = isReleaseVersion rev && toTag rev `elem` tags
isNewRelease rev = isReleaseVersion rev && toTag rev `notElem` tags
-- git revision corresponding to the changelog version:
-- a hash (a3f19c15), package release tag (hledger-ui-1.20), or project release tag (1.20)
lastrev
| isOldRelease changelogversion = toTag changelogversion -- package release tag
| isNewRelease changelogversion =
trace (out ++ "'s version \""++changelogversion++"\" is not yet tagged, can't list changes")
"HEAD"
| otherwise = changelogversion
-- interesting commit messages between lastrev and HEAD, cleaned up -- Find the latest commit that has been scanned for this changelog, as a commit id or tag name.
let lastscannedrev
interestingpaths = fromMaybe projectChangelogExcludeDirs mpkg | isCommitHash oldversion = oldversion
-- interestingmessages = "--invert-grep --grep '^;'" -- ignore commits beginning with ; | otherwise = maybe oldversion (++("-"++oldversion)) mpkg
-- TODO: update for new commit conventions. ; now means skip CI,
-- feat:/imp:/fix: means release notes, pkg:/lib: means changelogs, etc.
interestingmessages = ""
newitems <- fromStdout <$>
(cmd Shell gitlog changelogGitFormat (lastrev++"..") interestingmessages "--" interestingpaths
"|" changelogCleanupCmd :: Action (Stdout String))
-- git revision of current HEAD -- Find the latest commit (HEAD).
headrev <- unwords . words . fromStdout <$> latestrev <- unwords . words . fromStdout <$> (cmd Shell gitlog "-1 --pretty=%h" :: Action (Stdout String))
(cmd Shell gitlog "-1 --pretty=%h -- " interestingpaths :: Action (Stdout String))
-- package version: the version number currently configured for this package (or the project)
packageversion <-
let versionfile = dir </> ".version"
err = error $ "could not parse a version in "++versionfile
in liftIO $ headDef err . words <$> readFileStrictly versionfile
date <- liftIO getCurrentDay
let
-- the new changelog heading will be a final (dated, versioned) heading if
-- the configured package version is a new release version (non-dev & non-tagged)
(newrev, newheading)
| isNewRelease packageversion = (toTag packageversion, unwords [packageversion, show date])
| otherwise = (headrev, headrev)
newcontent = "# "++newheading++"\n" ++ newitems
newchangelog =
unlines preamble
++ newcontent
++ (if isCommitHash changelogversion then "" else oldheading)
++ unlines rest
liftIO $ if -- If it's newer,
| lastrev == newrev -> pure () -- putStrLn $ out ++ ": up to date" when (lastscannedrev /= latestrev) $ do
| dryrun -> putStr $ out ++ ":\n" ++ newcontent
| otherwise -> do -- Find the new commit messages relevant to this changelog, and clean them.
writeFile out newchangelog let scanpath = fromMaybe projectChangelogExcludes mpkg
putStrLn $ out ++ ": updated to " ++ newrev newitems <- fromStdout <$> (cmd Shell
"set -o pipefail;" -- so git log failure will cause this action to fail
gitlog changelogGitFormat (lastscannedrev++"..") "--" scanpath
"|" commitMessageToChangelogItemCmd
:: Action (Stdout String))
-- Add the new heading and change items to the changelog, or print them.
let newcontent = "# " ++ latestrev ++ "\n\n" ++ newitems ++ "\n"
liftIO $ if dryrun
then putStr $ out ++ ":\n" ++ newcontent
else do
writeFile out $ concat [
unlines preamble
,newcontent
,"\n"
,if isCommitHash oldversion then "" else oldheading
,"\n"
,unlines rest
]
putStrLn (out ++ ": updated to " ++ latestrev)
) )
-- Update all program-specific docs, eg after setversion. -- Update all program-specific docs, eg after setversion.
phony "docs" $ need [ phony "docs" $ need [
"cmdhelp" "cmddocs"
,"manuals" ,"manuals"
,"changelogs" ,"changelogs"
] ]
@ -756,36 +789,28 @@ main = do
phony "site" $ do phony "site" $ do
need [ need [
"webmanuals" "webmanuals"
,"orgfiles"
] ]
cmd_ "make -C site build" cmd_ "make -C site build"
phony "orgfiles" $ -- Markdown generated from org files, for the website.
need [ -- [ -- "doc/BACKLOG.md"
".BACKLOG.md" -- ] |%> \out -> do
,".ROADMAP.md" -- let src = out -<.> "org"
] -- need [src]
-- -- replace the generated top heading with our own so we can insert the TOC after it
-- These org files are converted to markdown for the website. -- let heading = dropExtension out
[ ".ROADMAP.md" -- mdlines <- drop 1 . lines . fromStdout <$> (cmd Shell pandoc fromorg towebmd src :: Action (Stdout String))
,".BACKLOG.md" -- liftIO $ writeFile out $ unlines $ [
] |%> \out -> do -- "<!-- " ++ "Generated by \"Shake " ++ out ++ " from " ++ src ++ " -->"
let src = drop 1 out -<.> "org" -- ,""
need [src] -- ,"# " ++ heading
-- replace the generated top heading with our own so we can insert the TOC after it -- ,""
let heading = dropExtension $ drop 1 out -- ,"<div class=\"pagetoc\">"
mdlines <- drop 1 . lines . fromStdout <$> (cmd Shell pandoc fromorg towebmd src :: Action (Stdout String)) -- ,""
liftIO $ writeFile out $ unlines $ [ -- ,"<!-- toc -->"
"<!-- " ++ "Generated by \"Shake " ++ out ++ " from " ++ src ++ " -->" -- ,"</div>"
,"" -- ,""
,"# " ++ heading -- ] ++ mdlines
,""
,"<div class=\"pagetoc\">"
,""
,"<!-- toc -->"
,"</div>"
,""
] ++ mdlines
-- XXX try to style backlog items as unnumbered or nested-numbered list items -- XXX try to style backlog items as unnumbered or nested-numbered list items
{- {-
@ -835,7 +860,13 @@ main>ol>li {
putNormal "Cleaning shake build cache" putNormal "Cleaning shake build cache"
removeFilesAfter ".shake" ["//*"] removeFilesAfter ".shake" ["//*"]
-- Git commit the given files with the given message if they have changes,
-- otherwise print a no change message and continue.
commitIfChanged msg files = do
diffs <- (/=ExitSuccess) . fromExit <$> cmd Shell "git diff --no-ext-diff --quiet --exit-code --" files
if diffs
then cmd Shell ("git commit -m '"++msg++"' --") files
else liftIO $ putStrLn $ "nothing to commit for \"" ++ msg ++ "\""
-- Convert numbered man page names to manual names. -- Convert numbered man page names to manual names.
-- hledger.1 -> hledger, hledger_journal.5 -> hledger_journal -- hledger.1 -> hledger, hledger_journal.5 -> hledger_journal

View File

@ -0,0 +1,3 @@
hledger -f examples/10ktxns-100kaccts.journal print
hledger -f examples/10ktxns-100kaccts.journal register
hledger -f examples/10ktxns-100kaccts.journal balance

View File

@ -0,0 +1,3 @@
hledger -f examples/10ktxns-10kaccts.journal print
hledger -f examples/10ktxns-10kaccts.journal register
hledger -f examples/10ktxns-10kaccts.journal balance

22
bench-many-accts.sh Normal file
View File

@ -0,0 +1,22 @@
hledger -f examples/1ktxns-1accts.journal balance
hledger -f examples/1ktxns-10accts.journal balance
hledger -f examples/1ktxns-100accts.journal balance
hledger -f examples/1ktxns-1kaccts.journal balance
hledger -f examples/1ktxns-10kaccts.journal balance
hledger -f examples/1ktxns-100kaccts.journal balance
hledger -f examples/1ktxns-1maccts.journal balance
hledger -f examples/10ktxns-1accts.journal balance
hledger -f examples/10ktxns-10accts.journal balance
hledger -f examples/10ktxns-100accts.journal balance
hledger -f examples/10ktxns-1kaccts.journal balance
hledger -f examples/10ktxns-10kaccts.journal balance
hledger -f examples/10ktxns-20kaccts.journal balance
hledger -f examples/10ktxns-30kaccts.journal balance
hledger -f examples/10ktxns-40kaccts.journal balance
hledger -f examples/10ktxns-50kaccts.journal balance
hledger -f examples/10ktxns-60kaccts.journal balance
hledger -f examples/10ktxns-70kaccts.journal balance
hledger -f examples/10ktxns-80kaccts.journal balance
hledger -f examples/10ktxns-90kaccts.journal balance
hledger -f examples/10ktxns-100kaccts.journal balance
#hledger -f examples/10ktxns-1maccts.journal balance

19
bench-many-txns.sh Normal file
View File

@ -0,0 +1,19 @@
hledger -f examples/1ktxns-1kaccts.journal balance
hledger -f examples/2ktxns-1kaccts.journal balance
hledger -f examples/3ktxns-1kaccts.journal balance
hledger -f examples/4ktxns-1kaccts.journal balance
hledger -f examples/5ktxns-1kaccts.journal balance
hledger -f examples/6ktxns-1kaccts.journal balance
hledger -f examples/7ktxns-1kaccts.journal balance
hledger -f examples/8ktxns-1kaccts.journal balance
hledger -f examples/9ktxns-1kaccts.journal balance
hledger -f examples/10ktxns-1kaccts.journal balance
hledger -f examples/20ktxns-1kaccts.journal balance
hledger -f examples/30ktxns-1kaccts.journal balance
hledger -f examples/40ktxns-1kaccts.journal balance
hledger -f examples/50ktxns-1kaccts.journal balance
hledger -f examples/60ktxns-1kaccts.journal balance
hledger -f examples/70ktxns-1kaccts.journal balance
hledger -f examples/80ktxns-1kaccts.journal balance
hledger -f examples/90ktxns-1kaccts.journal balance
hledger -f examples/100ktxns-1kaccts.journal balance

View File

@ -5,7 +5,7 @@
# (criterion) is more robust. # (criterion) is more robust.
# #
# Generate the test journals: # Generate the test journals:
# make samplejournals # just samplejournals
# #
# Get quickbench: # Get quickbench:
# git clone https://github.com/simonmichael/quickbench # git clone https://github.com/simonmichael/quickbench
@ -15,32 +15,31 @@
# Measure performance: # Measure performance:
# time ./bench.sh # show if these work, what they do, total time (GNU time also shows max memory) # time ./bench.sh # show if these work, what they do, total time (GNU time also shows max memory)
# quickbench [OPTS] # time each command, one or more times # quickbench [OPTS] # time each command, one or more times
# make bench # time each command with several hledger versions (BENCHEXES in Makefile)
# stack bench hledger # time a different set of benchmarks (bench/bench.hs) # stack bench hledger # time a different set of benchmarks (bench/bench.hs)
# stack bench hledger --ba --criterion # time more carefully, using criterion # stack bench hledger --ba --criterion # time more carefully, using criterion
# commands to benchmark: # commands to benchmark:
# hledger -f examples/100x100x10.journal print # hledger -f examples/100txns-100accts.journal print
# hledger -f examples/1000x1000x10.journal print # hledger -f examples/1ktxns-1kaccts.journal print
hledger -f examples/10000x1000x10.journal print hledger -f examples/10ktxns-1kaccts.journal print
# hledger -f examples/10000x1000x10.journal print ff # hledger -f examples/10ktxns-1kaccts.journal print ff
#hledger -f examples/100000x1000x10.journal print #hledger -f examples/100ktxns-1kaccts.journal print
#hledger -f examples/100000x1000x10.journal print ff #hledger -f examples/100ktxns-1kaccts.journal print ff
# hledger -f examples/100x100x10.journal register # hledger -f examples/100txns-100accts.journal register
# hledger -f examples/1000x1000x10.journal register # hledger -f examples/1ktxns-1kaccts.journal register
hledger -f examples/10000x1000x10.journal register hledger -f examples/10ktxns-1kaccts.journal register
# hledger -f examples/10000x1000x10.journal register ff # hledger -f examples/10ktxns-1kaccts.journal register ff
#hledger -f examples/100000x1000x10.journal register #hledger -f examples/100ktxns-1kaccts.journal register
#hledger -f examples/100000x1000x10.journal register ff #hledger -f examples/100ktxns-1kaccts.journal register ff
# hledger -f examples/100x100x10.journal balance # hledger -f examples/100txns-100accts.journal balance
# hledger -f examples/1000x1000x10.journal balance # hledger -f examples/1ktxns-1kaccts.journal balance
hledger -f examples/10000x1000x10.journal balance hledger -f examples/10ktxns-1kaccts.journal balance
# hledger -f examples/10000x1000x10.journal balance ff # hledger -f examples/10ktxns-1kaccts.journal balance ff
#hledger -f examples/100000x1000x10.journal balance #hledger -f examples/100ktxns-1kaccts.journal balance
#hledger -f examples/100000x1000x10.journal balance ff #hledger -f examples/100ktxns-1kaccts.journal balance ff
hledger -f examples/1000x1000x10.journal balance --weekly #hledger -f examples/1ktxns-1kaccts.journal balance --weekly
hledger -f examples/10000x1000x10.journal balance --weekly #hledger -f examples/10ktxns-1kaccts.journal balance --weekly

3
bench100k.sh Normal file
View File

@ -0,0 +1,3 @@
hledger -f examples/100ktxns-1kaccts.journal print
hledger -f examples/100ktxns-1kaccts.journal register
hledger -f examples/100ktxns-1kaccts.journal balance

3
bench10k.sh Normal file
View File

@ -0,0 +1,3 @@
hledger -f examples/10ktxns-1kaccts.journal print
hledger -f examples/10ktxns-1kaccts.journal register
hledger -f examples/10ktxns-1kaccts.journal balance

3
bench1k.sh Normal file
View File

@ -0,0 +1,3 @@
hledger -f examples/1ktxns-1kaccts.journal print
hledger -f examples/1ktxns-1kaccts.journal register
hledger -f examples/1ktxns-1kaccts.journal balance

3
bench5k.sh Normal file
View File

@ -0,0 +1,3 @@
hledger -f examples/5ktxns-1kaccts.journal print
hledger -f examples/5ktxns-1kaccts.journal register
hledger -f examples/5ktxns-1kaccts.journal balance

33
bin/.gitignore vendored
View File

@ -1,9 +1,24 @@
hledger-budget # lots of uncommitted stuff here
hledger-chart
hledger-check-dates #g.*
hledger-dupes # _*
hledger-equity # *.hi
hledger-prices # *.o
hledger-print-unique
hledger-register-match # executables compiled from .hs scripts
hledger-rewrite gsheet-csv
hledger-balance-as-budget-multi
hledger-balance-as-budget
hledger-check-fancyassertions
hledger-check-postable
hledger-check-tagfiles.cabal
hledger-check-tagfiles
hledger-combine-balances
hledger-move
hledger-register-max
hledger-register-max2
hledger-report1
hledger-script-example-short
hledger-script-example
hledger-smooth
hledger-swap-dates

361
bin/Justfile Executable file
View File

@ -0,0 +1,361 @@
#!/usr/bin/env just -f
# * financial reports/scripts, managed with https://github.com/casey/just
# ** PUBLIC: the scripts below can be shared in hledger's bin/Justfile.
# *** PREAMBLE ------------------------------------------------------------
just := "just -f " + justfile()
TODAY := `date +%Y-%m-%d`
# list the commands available
@help:
{{ just }} -ul --list-heading=$'{{ file_name(justfile()) }} commands:\n\
ARGS can be added to customise reports.\n\
'
# XXX we don't quote ARGS properly, so each one must be free of spaces
# XXX broken
# # interactively pick a command with the default chooser. Eg: just pick -
# pick:
# {{ just }} --choose
# XXX be careful, runs each selected command immediately. Use mouse to select.
# interactively view command outputs with fzf and bkt. Eg: just view - --black
view *ARGS:
{{ just }} --choose --chooser="fzf --reverse --preview='bkt --ttl=15m --stale=15s -- just {}' {{ ARGS }}"
# rerun the given command with watchexec whenever local files change
watch CMD:
watchexec -- {{ just }} {{ CMD }}
# *** IMPORT ------------------------------------------------------------
# where to import most hledger transactions from
# import sources:
# 1. cash wallets
# 2. wells fargo bank
# 3. bank of ireland
# 4. fidelity
# 5. paypal
IMPORTFILES := '\
wf-bchecking.csv.rules \
wf-pchecking.csv.rules \
wf-bsavings.csv.rules \
wf-psavings.csv.rules \
bofi-ichecking.csv.rules \
fidelity.csv.rules \
paypal.csv \
'
# get auto-downloadable CSVs, and clean manually-downloaded CSVs
csv:
#!/usr/bin/env bash
# latestcsv PARTIALFILEPATH - list latest non-cleaned CSV with this path
latestcsv() { ls -t "$1"*.csv | grep -v ".clean" | head -1; }
echo "cleaning fidelity csv"
# remove leading space
for f in $(latestcsv ~/Downloads/History_for_Account_); do
g=~/Downloads/$(basename $f csv)clean.csv
sed -e 's/^ //' $f >$g
# ls -l $g
done
echo "getting paypal csv..."
paypaljson | paypaljson2csv > paypal.csv
# ls -l paypal.csv
# get CSVs, then import any new transactions from them to the journal, logging but not printing errors; add --dry to preview
@csv-import *ARGS:
date >>import.log
{{ just }} csv 2>>import.log || echo "Failed, check import.log"
hledger import {{ IMPORTFILES }} {{ ARGS }} 2>>import.log || echo "Failed, check import.log"
HOUSEHOLDEKRECENT := "household-recent.journal"
# get a household adjustment transaction for last month
household:
#!/usr/bin/env bash
echo "getting household google sheet..."
date=$(if [ "$(builtin type -p gdate)" ]; then echo gdate; else echo date; fi)
env household $($date --date -1month +%b) >{{ HOUSEHOLDEKRECENT }}
# get a household adjustment transaction for last month, then import it if new; add --dry to preview
@household-import *ARGS:
{{ just }} household 2>>import.log || echo "Failed, check import.log"
hledger import {{ HOUSEHOLDEKRECENT }} -I {{ ARGS }} 2>>import.log || echo "Failed, check import.log"
# show the forecast transactions predicted recently and soon
@forecast *ARGS:
hledger print --forecast=15daysago..15days tag:_generated --auto -I {{ ARGS }}
# import any new forecast transactions; add --dry to preview
@forecast-import *ARGS:
#!/usr/bin/env bash
echo "importing transactions from forecast rules"
hledger import forecast.journal --forecast=15daysago..15days --auto -I {{ ARGS }} 2>>import.log || echo "Failed, check import.log"
if [[ "$ARGS" != *"--dry"* ]]; then
echo "(remove any near-future transactions included for preview)"
echo "resetting .latest.forecast.journal to today's date"
date +%Y-%m-%d >.latest.forecast.journal
fi
# get and import all the above; add --dry to preview
@import *ARGS:
{{ just }} csv-import {{ ARGS }}
{{ just }} household-import {{ ARGS }}
{{ just }} forecast-import {{ ARGS }}
# show prices for main commodities (default: today's)
@get-prices *PHFETCHARGS:
(pricehist fetch -o ledger -s {{ TODAY }} alphavantage EUR/USD {{ PHFETCHARGS }} | sed -E 's/EUR/€/') &
(pricehist fetch -o ledger -s {{ TODAY }} alphavantage GBP/USD {{ PHFETCHARGS }} | sed -E 's/GBP/£/') &
(pricehist fetch -o ledger -s {{ TODAY }} alphavantage JPY/USD {{ PHFETCHARGS }} | sed -E 's/JPY/¥/')
# Parallelised for speed; do slowest last.
# Output order varies, can be sorted with LC_COLLATE=C.UTF-8 sort or hledger -f- prices.
# *** REPORTS ------------------------------------------------------------
PERIOD := "1/1..tomorrow"
# show balance sheet
bs *ARGS:
hledger bs --layout bare --pretty --drop 1 -p {{ PERIOD }} -E -5 {{ ARGS }}
# show income statement
is *ARGS:
hledger is --layout bare --pretty --drop 1 -p {{ PERIOD }} -S {{ ARGS }}
# show assets
a *ARGS:
hledger bal type:al -H --layout bare --pretty --drop 1 -p {{ PERIOD }} -E {{ ARGS }}
# show revenues
r *ARGS:
hledger bal type:r --layout bare --pretty --drop 1 -p {{ PERIOD }} -S --invert {{ ARGS }}
# show expenses
x *ARGS:
hledger bal type:x --layout bare --pretty --drop 1 -p {{ PERIOD }} -S --invert {{ ARGS }}
# show assets bar chart
ab *ARGS:
echo "Quarterly net worth:"
hledger-bar -v 200 -Q type:al -H {{ ARGS }}
# show revenues bar chart
rb *ARGS:
echo "Quarterly revenues:"
hledger-bar -v 40 -Q type:r --invert {{ ARGS }}
# show expenses bar chart
xb *ARGS:
echo "Quarterly expenses:"
hledger-bar -v 40 -Q type:x --invert {{ ARGS }}
# XXX with partial workaround for https://github.com/gooofy/drawilleplot/issues/4
# show assets line chart
al *ARGS:
hledger plot -- bal --depth=1 type:a --historical --terminal --rcParams '{"figure.figsize":[8,3]}' --no-today -q --title "hledger assets" {{ ARGS }} | sed 's// /g'
# show revenues line chart
rl *ARGS:
hledger plot -- bal --depth=1 type:r --monthly --invert --terminal --rcParams '{"figure.figsize":[8,3]}' --drawstyle 'steps-mid' --no-today -q --title "hledger monthly revenues" {{ ARGS }} | sed 's// /g'
# show expenses line chart
xl *ARGS:
hledger plot -- bal --depth=1 type:x --monthly --terminal --rcParams '{"figure.figsize":[8,3]}' --drawstyle 'steps-mid' --no-today -q --title "hledger monthly expenses" {{ ARGS }} | sed 's// /g'
# show consulting revenue
consulting *ARGS:
hledger reg --invert 'revenues:(cw|ah)' -p {{ PERIOD }} {{ ARGS }}
# estimated-tax *ARGS :
# @echo "Federal estimated tax due for this year"
# $(HLEDGER) register liabilities:personal:tax:federal:$(YEAR) --width=130
# @echo State estimated tax due for this year:
# @$(HLEDGER) register liabilities:personal:tax:state:$(YEAR) --width=130
# @echo
# *** TIME REPORTS ------------------------------------------------------------
set export := true
# The file where actual time data is logged, for dashboard's stats.
# This might or might not be the top-level $TIMELOG file.
#TIMELOGDATA=$TIMELOG
YEAR := `date +%Y`
TIMELOGDATA := 'time-' + YEAR + '.timedot'
TIMELOGALL := `dirname "$TIMELOG"` + '/time-all.journal'
# This redisplays only when a file listed by `hledger -f $TIMELOG files` is modified.
# To force a per minute display as well, have $TIMELOG include a dummy file (.update)
# and configure a cron job to touch that every minute.
# (This is better than touching the timelog file itself, which confuses editors.)
#
# show time dashboard, redisplaying when timelog files change
tdash *ARGS:
#!/usr/bin/env bash
set -euo pipefail
dir=$(dirname "$TIMELOG")
cd "$dir"
opts= #--poll=10 # <- uncomment to fix symlinked files being ignored
watchexec $opts --no-vcs-ignore \
--filter-file=<(hledger -f "$TIMELOG" files | sed -E "s|$dir/||g") \
-c -r {{ just }} tstatus {{ ARGS }}
# show time dashboard, redisplaying every minute with watch
# dash-1m *ARGS:
# watch -n60 -c tt status
# }
# show current time status
tstatus *ARGS:
#!/usr/bin/env bash
set -euo pipefail
date=$(if [ "$(builtin type -p gdate)" ]; then echo gdate; else echo date; fi)
stat=$(if [ "$(builtin type -p gstat)" ]; then echo gstat; else echo stat; fi)
curtime=$($date +'%H:%M %Z, %a %b %-e %Y')
modtime=$($date +'%H:%M %Z' -r "$TIMELOGDATA")
modsecs=$($stat -c %Y "$TIMELOGDATA")
nowsecs=$($date +%s)
agesecs=$((nowsecs - modsecs))
agemins=$(python3 -c "print($agesecs/60)")
agehrs=$(python3 -c "print($agesecs/3600.0)")
ageqtrhrs=$(python3 -c "print(round($agesecs/900.0))")
agedots=$({{ just }} tdots "$ageqtrhrs")
printf "Current time: %s\n" "$curtime"
# old, for osh: use env here to run the system printf, which supports floating point
env printf "Timelog saved: %s, %.0fm / %.1fh / %s ago\n" "$modtime" "$agemins" "$agehrs" "$agedots"
# Show the current day/week/month budget status.
printf "Time plans:\n"
# calculate each period's budget from daily budget
hledger -f "$TIMELOG" bal -1 -p 'daily today' --budget=Daily {{ ARGS }} | tail +2
hledger -f "$TIMELOG" bal -1 -p 'weekly this week' --budget=Daily {{ ARGS }} | tail +2
hledger -f "$TIMELOG" bal -1 -p 'monthly this month' --budget=Daily {{ ARGS }} | tail +2
# or use each period's specific budget
# hledger -f "$TIMELOG" bal -p 'daily today' --budget=Daily -1 | tail +2
# hledger -f "$TIMELOG" bal -p 'weekly this week' --budget=Weekly -1 | tail +2
# hledger -f "$TIMELOG" bal -p 'monthly this month' --budget=Monthly -1 | tail +2
echo
hledger -f "$TIMELOG" check -s tags ordereddates || true
# this comes last because it's slow and variable length
echo
printf "Display activity:\n"
wakelog today | tail -n 6
# what happened ? Show largest time balances first, today and depth 1 by default
@twhat *ARGS:
hledger -f "$TIMELOG" bal -S -1 -p today {{ ARGS }}
# print line of N dots, grouped in 4s (suitable for timedot)
tdots N:
#!/usr/bin/env bash
set -euo pipefail
n={{ N }}
ndiv4=$((n/4))
nmod4=$((n-n/4*4))
sep=''
while [[ $ndiv4 -gt 0 ]]; do ndiv4=$((ndiv4-1)); echo -n "$sep...."; sep=' '; done
while [[ $nmod4 -gt 0 ]]; do nmod4=$((nmod4-1)); echo -n "$sep."; sep=''; done
echo
RFLAGS := '-tM'
# horizontal time summary this year, monthly by default
@tx *ARGS:
hledger -f "$TIMELOG" bal -1 "$RFLAGS" {{ ARGS }}
# vertical time summary this year, monthly by default
@ty *ARGS:
hledger -f "$TIMELOG" bal -1 "$RFLAGS" --transpose {{ ARGS }}
# horizontal time summary since 2007, yearly by default. Gaps in 2010-2015.
@txall *ARGS:
hledger -f "$TIMELOGALL" bal -1 "$RFLAGS" -Y {{ ARGS }}
# vertical time summary since 2007, yearly by default. Gaps in 2010-2015.
@tyall *ARGS:
hledger -f "$TIMELOGALL" bal -1 "$RFLAGS" -Y --transpose {{ ARGS }}
# horizontal hledger time summary, yearly by default. Gaps in 2010-2015.
@txallhledger *ARGS:
{{ just }} txall hledger not:^ser.ek -AT {{ ARGS }}
# show a bar chart of this year's time in hours, weekly by default. Bar resolution is 1h.
@tbar *ARGS:
hledger-bar -v 1 -f "$TIMELOG" -W {{ ARGS }}
# show a bar chart of time since 2007, monthly by default, with 10h bar resolution. Gaps in 2010-2015.
@tbarall *ARGS:
hledger-bar -v 10 -f "$TIMELOGALL" -M not:cur: {{ ARGS }}
# not:cur: because --layout=bare will add a row for no-symbol commodity if any periods are zero.
# show a bar chart of time since 2007, yearly by default, with 100h bar resolution. Gaps in 2010-2015.
@tbarally *ARGS:
hledger-bar -v 100 -f "$TIMELOGALL" -Y not:cur:'' {{ ARGS }}
# not:cur: because --layout=bare will add a row for no-symbol commodity if any periods are zero.
# this and last week's time budgets
@tweekbudgets *ARGS:
printf "\nLast week, this week:\n"
timeweekly run
# recent past weeks' time budgets
@tweekbudgetspast *ARGS:
printf "\nPast weeks:\n"
timeweekly past
# show unused / undeclared time accounts
@taccunused *ARGS:
echo "Unused: (but declared)"
hledger -f "$TIMELOG" acc --unused {{ ARGS }} --directives | gsed -E 's/:(.)/.\1/g'
echo
echo "Undeclared: (but used)"
hledger -f "$TIMELOG" acc --undeclared {{ ARGS }} --directives | gsed -E 's/:(.)/.\1/g'
# show unused / undeclared time accounts by category
@taccunusedcat *ARGS:
for a in $(tt acc -1); do line; echo "$a":; tt unused "^$a"; echo; done; line
# add declarations for all undeclared time accounts
@taccadd *ARGS:
hledger -f "$TIMELOG" accounts --undeclared --directives | sed 's/:/./g' >>"$TIMELOG"
# show monthly time budget performance this year
@tbudgets *ARGS:
{{ just }} tx --budget=daily -M -p jan..tomorrow {{ ARGS }}
# show monthly time budget performance this year, vertically
@tbudgetsy *ARGS:
{{ just }} ty --budget=daily -M -p jan..tomorrow {{ ARGS }}
# dedicated weekly reports, needed to set proper week start date, to ensure simple headings:
# show weekly time budget performance this year
@tbudgetsw *ARGS:
{{ just }} ty --budget=daily -W -p 3/27..tomorrow {{ ARGS }}
# show weekly time budget performance this year, horizontally
@tbudgetswx *ARGS:
{{ just }} tx --budget=daily -W -p 3/27..tomorrow {{ ARGS }}
# show monthly time percentages
@txpc *ARGS:
{{ just }} tx -% {{ ARGS }}
# show monthly time tagged by activity type
@txt *ARGS:
hledger -f "$TIMELOG" bal -b2023/5 -M tag:t -1 {{ ARGS }}
# show monthly time tagged by activity type as percentages
@txtpc *ARGS:
{{ just }} txt -% {{ ARGS }}

View File

@ -1,43 +1,94 @@
# Scripts # Scripts and add-ons
<div class=pagetoc> <div class=pagetoc>
<!-- toc --> <!-- toc -->
</div> </div>
This document is the README in the hledger repo's [bin] directory, (This is the README in the hledger repo's `bin/` directory,
and is also published as [Scripts] on hledger.org. also published as the [Scripts and add-ons] page on hledger.org.)
Here we collect hledger scripts: additional small tools which complement hledger in some way. <!-- This page can be viewed on github or hledger.org, so use absolute urls here: -->
These can be:
- shell aliases or functions, defined eg in your shell's startup file [Scripts and add-ons]: https://hledger.org/scripts.html
- shell script files [Scripting hledger]: https://hledger.org/scripting.html
- programs written in other languages, like Python or Haskell. [bin]: https://github.com/simonmichael/hledger/tree/master/bin
Haskell scripts are the most powerful since they can call hledger's Haskell API (we'll call these *hledger-integrated*).
- script files or programs named `hledger-*`,
which show up in hledger's [commands list](hledger.html#commands)
as [add-on commands](https://hledger.org/dev/hledger.html#addons).
The most common types of hledger script are: A *script* is a program you can run immediately without needing to compile it first.
They are often small and defined in a single file or shell alias or shell function.
You can create your own simple or complex scripts which enhance hledger.
Eg you might script a complicated report so you don't have to remember the detailed command(s).
1. shell aliases/functions/scripts which run hledger with custom options and arguments, eg to produce a particular report A hledger *add-on command* is any program whose name begins with "hledger-".
2. Haskell add-on command scripts implementing variants of the built-in commands, or new kinds of report. Add-on commands found in PATH will appear in the commands list (shown when you run `hledger` with no arguments).
Some of the scripts below are add-ons.
Some add-ons are written in Haskell and can use hledger's full power, like builtin commands.
[Scripting hledger] has more on this general topic. Below are some existing scripts you can use or learn from.
Most of these are collected in [hledger's bin/ directory][bin],
which you can get by [cloning](https://hledger.org/scripts.html#install-scripts) the hledger source.
Compiled add-ons are also listed below, in their own section.
The current "bin scripts" are listed in the page contents and below, categorised by how they invoke hledger. Note, you don't need any of these extras if you are new to hledger -
They are either useful as is, or can be examples/inspiration for making your own. except possibly hledger-ui and hledger-web, which can be nice to have at the start.
Contributions welcome!
Following the list are [install instructions](#installing-the-bin-scripts) and other tips.
<!-- This page can be viewed on github or hledger.org, so use absolute urls. -->
[bin]: https://github.com/simonmichael/hledger/tree/master/bin
[Scripts]: https://hledger.org/scripts.html
[Scripting hledger]: https://hledger.org/scripting.html
## hledger-running scripts ## Related scripts
These run hledger via its command line interface, and perhaps process its output: Here are some scripts which don't use hledger directly, but might be useful to hledger users.
(For more, see also: [plaintextaccounting.org > Software](https://plaintextaccounting.org#software)).
### ledgereval
[ledgereval](https://github.com/simonmichael/hledger/blob/master/bin/ledgereval)
is a helper for evaluating Ledger value expressions.
It's useful eg when converting amount expressions like `(1 USD + 2 USD)` to simple amounts.
### pricehist
[pricehist](https://pypi.org/project/pricehist) is useful for downloading market prices / conversion rates; recommended.
And [`hledger-pricehist`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-pricehist)
is a small script to make it show up in the hledger commands list.
### paypaljson
[`paypaljson`](https://github.com/simonmichael/hledger/blob/master/bin/paypaljson)
downloads the last 30 days of Paypal transactions (requires a free developer account & API key).
### paypalcsv
[`paypalcsv`](https://github.com/simonmichael/hledger/blob/master/bin/paypalcsv) (python)
converts `paypaljson`'s output to CSV, with format similar to Paypal's manually-downloaded CSV.
Example usage with hledger 1.50+:
call these in a CSV [rules file](https://hledger.org/hledger.html#csv) like: `source | paypaljson | paypalcsv`.
Or, do the download externally with `paypaljson >paypal.json`,
then convert to CSV in the rules file: `source | paypalcsv paypal.json`.
### simplefinsetup
[`simplefinsetup`](https://github.com/simonmichael/hledger/blob/master/bin/simplefinsetup)
helps set up access to SimpleFIN ([simplefin.org](https://simplefin.org)), a developer-friendly aggregator of US bank data.
### simplefinjson
[`simplefinjson`](https://github.com/simonmichael/hledger/blob/master/bin/simplefinjson)
downloads data for one or more bank accounts from SimpleFIN's API, as JSON.
### simplefincsv
[`simplefincsv`](https://github.com/simonmichael/hledger/blob/master/bin/simplefincsv)
converts SimpleFIN's JSON data to CSV, for one or more bank accounts.
Example usage with hledger 1.50+:
download multi-account JSON once with `simplefinjson >simplefin.json`,
and in each account's CSV [rules file](https://hledger.org/hledger.html#csv), extract that account's CSV, eg:
`source | simplefincsv simplefin.json 'wells fargo.*checking'`.
See also [hledger and SimpleFIN](https://hledger.org/simplefin.html).
## hledger command line scripts
These scripts use hledger's command line interface, or process one of its output formats.
### bashrc ### bashrc
@ -50,6 +101,157 @@ $ . bin/bashrc
$ fin # list the scripts available $ fin # list the scripts available
``` ```
### ft
[`ft`](https://github.com/simonmichael/hledger/blob/master/bin/ft)
is a way to organise your finance-related reports and scripts using standard bash.
(See also [Justfile](#justfile) below.)
```cli
$ alias f=~/src/hledger/bin/ft
$ f
--------------------------------------------------------------------------------"; }
ft - finance tool: run financial reports and finance-related scripts
Usage: ft [COMMAND [ARGS]]
Commands:
help show this help
get-csv download auto-downloadable CSVs (paypal)
import-dry import new downloaded transactions to the journal, dry run
import import new downloaded transactions to the journal, logging and not printing errors
get-prices [PRICEHISTFETCHOPTS] - download prices for main commodities (default: today's)
bs show balance sheet
is show income statement
a show assets
r show revenues
x show expenses
ab show assets bar chart
rb show revenues bar chart
xb show expenses bar chart
al show assets line chart
rl show revenues line chart
xl show expenses line chart
forecast print transactions predicted by forecast rules from last week on
household show a draft month-end household adjustment transaction for last month
consulting show consulting revenue
bin [PAT] show all scripts in $DIR/bin/[bashrc] (default: ~/finance/)
OTHERCMD [ARGS] run other hledger commands on the default journal
Add hledger options to customise reports.
```
### tt
[`tt`](https://github.com/simonmichael/hledger/blob/master/bin/tt)
is a similar bash multi-script for time reports.
```cli
$ alias t=~/src/hledger/bin/tt
$ t
--------------------------------------------------------------------------------
tt - time tool: run time reports and time-related scripts
Usage: tt [COMMAND [ARGS]]
Commands:
help show this help
dash show time dashboard, redisplaying when timelog files change
status show current time status
what what happened ? Show largest balances first, today and depth 1 by default
dots print line of N dots, grouped in 4s (suitable for timedot)
x horizontal time summary this year, monthly by default
y vertical time summary this year, monthly by default
rweeks recent weeks' time budgets
weeks this and last week's time budgets
hours show a bar chart of daily hours
accunused show unused / undeclared accounts
accunusedcat show unused / undeclared accounts by category
accadd add declarations for all undeclared accounts
budgets show monthly time budget performance this year
budgetsy show monthly time budget performance this year, vertically
budgetsw show weekly time budget performance this year
budgetswx show weekly time budget performance this year, horizontally
OTHERCMD [ARGS] run other hledger commands on $TIMELOG
Add hledger options to customise reports.
```
### Justfile
<https://github.com/casey/just> is a nice tool for organising financial reports and scripts,
similar to `make`, but more robust for this use case. I can recommend it.
See also [hledger and just](just.md).
Here is a [Justfile](https://github.com/simonmichael/hledger/blob/master/bin/Justfile)
reimplementing the `ft` and `tt` scripts more simply:
```cli
$ brew install just # eg
$ alias j=just
$ cd ~/finance
$ cp ~/src/hledger/bin/Justfile . # or start from scratch: just --init
$ j
Justfile commands:
watch CMD # rerun the given command with watchexec whenever local files change
get-csv # download auto-downloadable CSVs (paypal)
import-dry # import new downloaded transactions to the main journal, dry run
import # import new downloaded transactions to the journal, logging and not printing errors
get-prices *PRICEHISTFETCHOPTS # show prices for main commodities (default: today's)
bs *HLEDGERARGS # show balance sheet
is *HLEDGERARGS # show income statement
a *HLEDGERARGS # show assets
r *HLEDGERARGS # show revenues
x *HLEDGERARGS # show expenses
ab *HLEDGERARGS # show assets bar chart
rb *HLEDGERARGS # show revenues bar chart
xb *HLEDGERARGS # show expenses bar chart
al *HLEDGERARGS # show assets line chart
rl *HLEDGERARGS # show revenues line chart
xl *HLEDGERARGS # show expenses line chart
forecast *HLEDGERARGS # print transactions predicted by forecast rules from last week on
household *HLEDGERARGS # show a draft month-end household adjustment transaction for last month
consulting *HLEDGERARGS # show consulting revenue
tdash *HLEDGERARGS # show time dashboard, redisplaying when timelog files change
tstatus *HLEDGERARGS # show current time status
twhat *HLEDGERARGS # what happened ? Show largest time balances first, today and depth 1 by default
tdots N # print line of N dots, grouped in 4s (suitable for timedot)
tx *HLEDGERARGS # horizontal time summary this year, monthly by default
ty *HLEDGERARGS # vertical time summary this year, monthly by default
tweeks *HLEDGERARGS # this and last week's time budgets
tweekspast *HLEDGERARGS # recent past weeks' time budgets
thours *HLEDGERARGS # show a bar chart of daily hours
taccunused *HLEDGERARGS # show unused / undeclared time accounts
taccunusedcat *HLEDGERARGS # show unused / undeclared time accounts by category
taccadd *HLEDGERARGS # add declarations for all undeclared time accounts
tbudgets *HLEDGERARGS # show monthly time budget performance this year
tbudgetsy *HLEDGERARGS # show monthly time budget performance this year, vertically
tbudgetsw *HLEDGERARGS # show weekly time budget performance this year
tbudgetswx *HLEDGERARGS # show weekly time budget performance this year, horizontally
```
### watchaccounts
[`watchaccounts`](https://github.com/simonmichael/hledger/blob/master/bin/watchaccounts)
shows hledger account names, updating on file change under the current directory.
Arguments are passed to the `hledger accounts` command. Useful when cleaning up accounts.
```cli
$ watchaccounts expenses -2
$ watchaccounts -f time.journal client1 date:thismonth -l
```
### sortandmergepostings
[`sortandmergepostings`](https://github.com/simonmichael/hledger/blob/master/bin/sortandmergepostings)
is an adventuresome AWK script intended to clean up and merge similar postings in a transaction
(see [original discussion](https://unix.stackexchange.com/questions/526995/re-order-lines-and-merge-others-based-on-a-specific-criteria/527004)).
It sorts postings so that positive ones are first, negative ones last.
Within each sign, postings are sorted by commodity.
Within each commodity group, postings are sorted by amount.
Among identical amounts in the same group, postings are sorted alphabetically by account name.
Once sorted, if there are multiple postings to the same account in the same direction with the same commodity and comments, it tries to merge them (by leaving some amounts blank).
Subsequently piping the output to `hledger print` can recalculate the missing amounts.
Multiple runs might be needed to clean up all duplicates.
```cli
$ sortandmergepostings input.journal | hledger -f - print -x
```
### hledger-simplebal ### hledger-simplebal
[`hledger-simplebal`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-simplebal) [`hledger-simplebal`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-simplebal)
@ -60,57 +262,197 @@ This and the other "hledger-" scripts are add-on commands.
$ hledger simplebal $ hledger simplebal
``` ```
### hledger-bar
[`hledger-bar`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-bar)
prints quick bar charts in the terminal.
```cli
$ hledger bar reimbursement
2023-01 ++++++
2023-02 ++
2023-03 ++
2023-04 -------
```
```cli
$ hledger bar # show help
$ hledger bar food # monthly food expenses
$ hledger bar 1 --count food # monthly food posting counts
$ hledger bar type:c not:tag:clopen cur:\\\\$ -W # weekly cashflow, $ only
$ hledger bar type:al not:tag:clopen cur:\\\\$ # monthly net worth change ($)
$ hledger bar type:rx --invert cur:\\\\$ # monthly profit/loss ($)
$ hledger bar -v 1 -f $TIMELOG -D # daily hours, with numbers
```
(or with hledger <1.50: `hledger bar -- ...`)
### hledger-check-buynothing
[`hledger-check-buynothing`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-buynothing)
checks for no activity in Expense accounts on Buy Nothing Day (or other period).
### hledger-git ### hledger-git
[`hledger-git`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-git) [`hledger-git`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-git)
provides easy version control for your journal files, using git. Run it with no arguments for help. provides easy version control for your journal files, using [git](https://git-scm.com).
Run it with no arguments for help.
```cli ```cli
$ hledger git log $ hledger git log
$ hledger git status $ hledger git status
$ hledger git record [MSG] $ hledger git record [MSG]
``` ```
### hledger-jj
[`hledger-jj`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-jj)
provides easy version control for your journal files, using [jj](https://jj-vcs.github.io)
(and a git repo).
This is newer and better than hledger-git and hledger-pijul.
Unlike most shell scripts here, it requires [ysh](https://oils.pub).
```cli
$ hledger jj log
$ hledger jj status
$ hledger jj diff
$ hledger jj commit [MSG]
```
### hledger-pijul ### hledger-pijul
[`hledger-pijul`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-pijul) [`hledger-pijul`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-pijul)
provides the same thing using the [pijul](https://pijul.org) version control system.. provides easy version control for your journal files, using the [pijul](https://pijul.org) version control system.
```cli ```cli
$ hledger pijul log $ hledger pijul log
$ hledger pijul status $ hledger pijul status
$ hledger pijul record [MSG] $ hledger pijul record [MSG]
``` ```
## hledger-integrated scripts ### hledger-dc
These call hledger as a Haskell library, and so must be written in [`hledger-dc`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-dc)
Haskell. They can use hledger's internal data types and can do reads journal files which use a Dr/Cr notation instead of/in addition to amount signs:
anything hledger's built-in commands can do: ```journal
2025-01-01 salary
### hledger-addon-example Cr revenues 800 USD
Dr assets
[`hledger-addon-example.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-addon-example.hs)
is a starter template for a common type of script: a hledger-integrated add-on command.
It has the same structure as most of the other add-ons here:
- implemented as a stack script for robustness
- provides command line help
- accepts common hledger options
Further cleanup and documentation is ongoing.
### hledger-print-location
[`hledger-print-location.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-print-location.hs)
is a variant of hledger's `print` command
that adds the file and line number to every transaction, as a tag:
```cli
$ hledger print-location -f hledger/examples/sample.journal desc:eat
2008/06/03 * eat & shop
; location: /Users/simon/src/hledger/examples/sample.journal:30
expenses:food $1
expenses:supplies $1
assets:cash
``` ```
### hledger-edit
The [hledger-utils python package](https://pypi.org/project/hledger-utils/) provides
a `hledger-edit` command to edit the queried transactions in your `$EDITOR` no matter what file they reside in.
Install or upgrade:
```cli
$ pip install -U hledger-utils # might be slightly different on your system
```
Examples:
```cli
# Opens your $EDITOR or $VISUAL with only costs in Florida
# (if you named and tagged them like that)
# edit the transactions, save and exit your editor,
# then the changes are distributed to the original files
$ hledger edit Cost tag:location=Florida
```
```
# Automate changes by setting `$EDITOR` to a script
# (here all food we had on that one day in Florida was Fast Food 🌭 and we initially forgot to write that)
EDITOR='perl -pi -e "s|Cost:Food|Cost:Food:Fast Food|g"' hledger edit tag:location=Florida date:2022-12-20
```
[![asciicast](https://asciinema.org/a/549559.svg)](https://asciinema.org/a/549559)
### hledger-plot
The [hledger-utils python package](https://pypi.org/project/hledger-utils/) provides
a `hledger-plot` command for generating charts with matplotlib.
Install or upgrade:
```cli
$ pip install -U hledger-utils # might be slightly different on your system
```
Examples:
```
$ hledger-plot -h
$ hledger plot bal -DH ^Assets -2
```
(or with hledger <1.50: `hledger plot -- ...`)
### hledger-lots
[`hledger-lots`](https://github.com/edkedk99/hledger-lots)
shows a lots report, or generates a lot sale transaction, using FIFO strategy
(and without needing subaccounts for lots).
Install or upgrade:
```
$ pip install -U hledger-lots
```
Examples:
```cli
$ hledger lots
$ hledger lots view
$ hledger lots list
```
### hledger-report1.sh
[hledger-report1.sh](https://github.com/simonmichael/hledger/blob/master/bin/hledger-report1.sh)
is a custom compound report done in shell. See also hledger-report1.hs.
### hledger-timedothm
[`hledger-timedothm`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-timedothm)
reads timedot files which support HOURS:MINUTES notation:
```timedot
2025-09-27
time ..
time 0.5
time 30m
time 0:30 ; new H:M syntax
```
and it displays amounts in that notation:
```cli
$ hledger timedothm sample.timedothm reg -w80
2025-09-27 (time) 0:30 0:30
(time) 0:30 1:00
(time) 0:30 1:30
(time) 0:30 2:00
```
### hledgerj1
[`hledgerj1`](https://github.com/simonmichael/hledger/blob/master/bin/hledgerj1)
is a small example of a wrapper script that preprocesses the journal,
converting it from a custom format, in this case a one-line journal format
where slash represents newline. Eg:
```text
2025-01-04 shopping / assets:bank:checking / expenses:food 200 USD / expenses:supplies 50 USD
```
```cli
$ hledgerj1 a.j1 print
2025-01-04 shopping
assets:bank:checking
expenses:food 200 USD
expenses:supplies 50 USD
```
## hledger haskell scripts
These scripts are written in Haskell and use hledger's haskell API (by importing the `hledger` or `hledger-lib` haskell libraries).
They are often [stack scripts](https://docs.haskellstack.org/en/stable/topics/scripts).
They can do anything hledger's builtin commands can do, and are usually more robust than command line scripts.
Some builtin commands were first developed as standalone haskell scripts.
### hledger-script-example
[`hledger-script-example.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-script-example.hs)
is a template for writing your own hledger-integrated add-on command.
It has the same structure as most of the add-ons here:
- a stack script for robustness
- providing command line help
- accepting common hledger options
### hledger-swap-dates ### hledger-swap-dates
[`hledger-swap-dates.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-swap-dates.hs) [`hledger-swap-dates.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-swap-dates.hs)
@ -123,6 +465,18 @@ interprets all tag values containing a `/` (forward slash) as file paths, and ch
[`hledger-check-tagfiles.cabal.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-tagfiles.cabal.hs) [`hledger-check-tagfiles.cabal.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-tagfiles.cabal.hs)
is the same command implemented as a cabal script rather than a stack script. is the same command implemented as a cabal script rather than a stack script.
### hledger-register-max
[`hledger-register-max.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-register-max.hs)
runs a register report and prints the posting with largest historical balance.
```cli
$ hledger-register-max -f examples/bcexample.hledger checking
2013-01-03 Hoogle | Payroll Assets:US:BofA:Checking 1350.60 USD 8799.22 USD
$ hledger register-max -f examples/bcexample.hledger checking
2013-01-03 Hoogle | Payroll Assets:US:BofA:Checking 1350.60 USD 8799.22 USD
```
### hledger-check-postable ### hledger-check-postable
[`hledger-check-postable.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-postable.hs) [`hledger-check-postable.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-postable.hs)
@ -150,129 +504,151 @@ shows balance reports for two different periods side by side.
[`hledger-balance-as-budget.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-balance-as-budget.hs) [`hledger-balance-as-budget.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-balance-as-budget.hs)
uses one balance report to set budget goals for another balance report. uses one balance report to set budget goals for another balance report.
This is useful for compare-and-contrast reports. You can, for example, use a previous year as a budget for this year, and see
how this year spending compares to your past spending.
### hledger-balance-as-budget-multi
[`hledger-balance-as-budget.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-balance-as-budget-multi.hs)
uses one balance report to set budget goals for another balance report, and allows you to run multiple balance commands on them.
Like `hledger run`, this will load journals only once, and will be significantly faster than calling `hledger-balance-as-budget`
multiple times.
### hledger-smooth ### hledger-smooth
[`hledger-smooth.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-smooth.hs) [`hledger-smooth.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-smooth.hs)
is an incomplete attempt at automatically splitting infrequent/irregular transactions. is an incomplete attempt at automatically splitting infrequent/irregular transactions.
## hledger-related scripts ### hledger-move
These don't run hledger, but are probably related to it in some way: [`hledger-move.hs`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-move.hs)
helps make subaccount/cost-preserving transfers.
### paypaljson ### hledger-report1.hs
[`paypaljson`](https://github.com/simonmichael/hledger/blob/master/bin/paypaljson) [hledger-report1.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-report1.hs)
downloads the last 30 days of Paypal transactions (requires a free developer account & API key). is a custom compound report done in haskell. See also hledger-report1.sh.
### paypaljson2csv ### hledger-txnsbycat.hs
[`paypaljson2csv`](https://github.com/simonmichael/hledger/blob/master/bin/paypaljson2csv) (python) [hledger-txnsbycat.hs](https://github.com/brianhv/hledger-scripts/blob/main/hledger-txnsbycat.hs)
converts `paypaljson`'s output to CSV, with format similar to Paypal's manually-downloaded CSV. is a mixture of a balance report and a register report; it shows each account's transactions
under the account's balance.
## More scripts ## Add-ons
[plaintextaccounting.org](https://plaintextaccounting.org) has a longer list of PTA tools, not hledger-specific. These are some official and third-party add-ons you can install as compiled programs:
### hledger-ui
[hledger-ui](hledger-ui.html) is hledger's official terminal UI. It allows faster browsing of your accounts and transactions.
### hledger-web
[hledger-web](hledger-web.html) is hledger's official web UI. It allows data entry and simple reports in a web browser. It's good for non-command-line users.
### hledger-iadd
[hledger-iadd](https://hackage.haskell.org/package/hledger-iadd) is a popular alternative to the builtin `add` command.
### hledger-interest
[hledger-interest](https://hackage.haskell.org/package/hledger-interest) generates interest transactions.
Notes (as of 1.6.7):
- Use the <https://github.com/peti/hledger-interest#readme>, it's better than the command line help or hackage description.
- hledger-interest silently ignores $LEDGER_FILE, so be sure to provide a file name explicitly with -f.
### hledger-sankeymatic
[hledger-sankeymatic](https://github.com/victormihalache/hledger-sankeymatic) helps export hledger data to make flow diagrams at <https://sankeymatic.com>.
See also [Charts](charts.md).
### Other
- [hledger-stockquotes](https://hackage.haskell.org/package/hledger-stockquotes) fetches market prices. Not widely used, use pricehist instead.
- [hledger-diff](https://hackage.haskell.org/package/hledger-diff) compares two journal files. It's now built in to hledger, so you don't need it.
## Installing the bin scripts
These [bin](https://github.com/simonmichael/hledger/tree/master/bin) scripts ## How to...
are not automatically installed along with hledger;
if you want them you must download them separately. Here's a suggested method: ### Install scripts
To use these bin scripts you must ensure they are in your $PATH and runnable:
- Shell scripts: you may need [bash](https://www.gnu.org/software/bash), or to adapt the scripts for your shell.
- Python scripts: you'll need python 3 and pip.
- Haskell scripts: you'll need [stack](http://haskellstack.org).
Or if you know how, you can make them cabal scripts, or install their dependencies manually and use runghc/ghc.
Here's a suggested install procedure:
```cli ```cli
# go to wherever you keep financial files # Go to wherever you keep financial files:
$ cd ~/finance $ cd ~/finance
# get the hledger repo (the fast way, without version control) # Get the hledger repo
# the fast way, without version control:
$ curl -LOJ https://github.com/simonmichael/hledger/archive/refs/heads/master.zip && unzip hledger-master.zip && mv hledger-master hledger $ curl -LOJ https://github.com/simonmichael/hledger/archive/refs/heads/master.zip && unzip hledger-master.zip && mv hledger-master hledger
# or the slow way, with version control for easy diffing/updating/contributing
# git clone https://github.com/simonmichael/hledger
# (or the slow way, with version control for easy diffing/updating/contributing) # Make a more convenient symlink to the bin directory:
# git clone https://github.com/simonmichael/hledger.git
# make a more convenient symlink to the bin directory
$ ln -s hledger/bin $ ln -s hledger/bin
# add the bin directory to your PATH. Eg as a bash user: # Add the bin directory to your PATH. Eg as a bash user:
$ echo "export PATH=$PATH:$PWD/bin" >>~/.bash_profile" $ echo "export PATH=$PATH:$PWD/bin" >>~/.bash_profile"
$ export PATH=$PATH:$PWD/bin $ export PATH=$PATH:$PWD/bin
# check that hledger's command list now shows the hledger-* scripts # Optionally, compile all haskell scripts for faster startup:
# (they will be listed with a + prefix): $ cd hledger; bin/compile.sh
# Optionally, install the python scripts:
$ pip install -U hledger-utils
$ pip install -U hledger-lots
# Check that hledger's command list now includes the bin scripts.
# Eg "check-fancyassertions" and "swap-dates" should be listed:
$ hledger $ hledger
``` ```
Scripts with no file extension are mostly [bash] scripts except where noted.
if you don't want to install bash you might have to adapt them to your shell.
Scripts with a `.hs` file extension are usually [stack scripts], requiring [stack] to run.
If you don't want to install stack you can adapt them to be cabal scripts,
or install their required libraries yourself and run/compile them with suitable runghc/ghc commands.
See also [Working with hledger-*.hs scripts](#working-with-hledger-hs-scripts) below.
[bash]: https://www.gnu.org/software/bash
[stack]: https://haskellstack.org
[stack scripts]: https://docs.haskellstack.org/en/stable/GUIDE/#script-interpreter
## Working with hledger-*.hs scripts
The hledger-*.hs [add-on commands] are mostly implemented as [stack]
runghc scripts. See the comments in hledger-check-fancyassertions.hs
for more about how to run or compile them. Short version: run
bin/compile.sh to compile all scripts, and add this directory to your
$PATH so they show up in hledger's command list.
[add-on commands]: http://hledger.org/hledger.html#add-on-commands
[stack]: https://www.fpcomplete.com/haskell/get-started
[cabal]: https://www.haskell.org/cabal
How to:
### Install all add-on commands
$ git clone https://github.com/simonmichael/hledger
$ hledger/bin/compile.sh
$ export PATH=$PATH:$PWD/hledger/bin
$ hledger # scripts now appear in commands list
$ hledger-print-location --help # run a script directly
$ hledger print-location -- --help # or run it via hledger. -- is needed before script options
### Create a new script ### Create a new script
The example scripts follow a template that implements hledger's To create a new hledger-integrated script, copy hledger-script-example.hs.
standard command line options and help, so it's a good idea to use one On unix, the new script should be marked executable. This should do it:
as your starting point. The hledger- naming is not required, but it
causes scripts to show up in the hledger commands list. On unix,
your new script should be marked executable. This should do it:
$ cd hledger $ cd bin
$ cp bin/hledger-swap-dates.hs bin/hledger-foo.hs # and edit, at least the command name and help $ cp hledger-script-example.hs hledger-cmd.hs # replace cmd with your command name
$ stack install string-qq # ensure any extra script deps are installed # edit hledger-cmd.hs, updating at least the command name and help
$ bin/hledger-cmd.hs --help $ stack install safe text # ensure the script's dependencies are installed
foo [OPTIONS] $ hledger-cmd.hs --help
My new foo command. cmd [OPTIONS]
My new cmd command.
... ...
$ stack ghc bin/hledger-cmd.hs $ stack ghc hledger-cmd.hs # optionally compile for faster startup/durability
$ hledger foo -- --help $ hledger cmd --help
foo [OPTIONS] cmd [OPTIONS]
My new foo command. My new cmd command.
... ...
### Run ghcid on a script ### Run ghcid on a script
$ stack install string-qq # ensure any extra script deps are installed $ stack exec --package 'safe text' -- ghcid hledger-cmd.hs
$ stack exec -- ghcid bin/hledger-foo.hs
... ...
Ok, one module loaded. Ok, one module loaded.
All good (1 module, at 10:50:48) All good (1 module, at 10:50:48)
### Run ghci on a script ### Run ghci on a script
$ stack install string-qq # ensure any extra script deps are installed $ stack ghci --package 'safe text' hledger-cmd.hs
$ stack ghci bin/hledger-foo.hs
... ...
Ok, one module loaded. Ok, one module loaded.
... ...
ghci> ghci>
### Learn more about scripting hledger
See [Scripting hledger].

View File

@ -1,194 +0,0 @@
#!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-9.3
--package hledger
--package Chart
--package Chart-diagrams
--package cmdargs
--package colour
--package data-default
--package here
--package safe
--package text
-}
{- stackage nightly:
--package SVGFonts
--package diagrams-core
--package diagrams-lib
--package diagrams-postscript
--package diagrams-svg
--package svg-builder
--package cereal-vector
--package dual-tree
--package diagrams-solve
--package statestack
-}
{-# OPTIONS_GHC -Wno-missing-signatures -Wno-unused-do-bind #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
import Control.Monad
import Data.Colour
import Data.Colour.Names hiding (red,green)
import Data.Colour.RGBSpace
import Data.Colour.RGBSpace.HSL (hsl)
import Data.Colour.SRGB.Linear (rgb)
import Data.Default
import Data.List
import Data.Maybe
import Data.Ord
import Data.String.Here
import qualified Data.Text as T
import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Backend.Diagrams
import Safe
import System.Console.CmdArgs.Explicit
import System.Exit
import Hledger.Cli hiding (num,green,is,balance)
defchartoutput = "hledger.svg"
defchartitems = 10
defchartsize = "600x400"
------------------------------------------------------------------------------
cmdmode = hledgerCommandMode
[here| chart
Generate a pie chart for the top account balances with the same sign,
in SVG format.
Based on the old hledger-chart package, this is not yet useful.
It's supposed to show only balances of one sign, but this might be broken.
|]
[flagReq ["chart-output","o"] (\s opts -> Right $ setopt "chart-output" s opts) "IMGFILE" ("output filename (default: "++defchartoutput++")")
,flagReq ["chart-items"] (\s opts -> Right $ setopt "chart-items" s opts) "N" ("number of accounts to show (default: "++show defchartitems++")")
,flagReq ["chart-size"] (\s opts -> Right $ setopt "chart-size" s opts) "WIDTHxHEIGHT" ("image size (default: "++defchartsize++")")
] [generalflagsgroup1]
[]
([], Just $ argsFlag "[QUERY]")
------------------------------------------------------------------------------
data ChartOpts = ChartOpts {
chart_output_ :: FilePath
,chart_items_ :: Int
,chart_size_ :: String
,cliopts_ :: CliOpts
} deriving (Show)
defchartopts = ChartOpts
def
def
def
defcliopts
getHledgerChartOpts :: IO ChartOpts
getHledgerChartOpts = do
cliopts <- getHledgerCliOpts cmdmode
return defchartopts {
chart_output_ = fromMaybe defchartoutput $ maybestringopt "debug-chart" $ rawopts_ cliopts
,chart_items_ = fromMaybe defchartitems $ maybeintopt "debug-items" $ rawopts_ cliopts
,chart_size_ = fromMaybe defchartsize $ maybestringopt "debug-size" $ rawopts_ cliopts
,cliopts_ = cliopts
}
main :: IO ()
main = do
chopts <- getHledgerChartOpts
d <- getCurrentDay
j <- defaultJournal
let ropts = (reportopts_ $ cliopts_ chopts)
let balreport = balanceReportFromMultiBalanceReport ropts (queryFromOpts d ropts) j
let go -- | "--help" `elem` (rawopts_ $ cliopts_ chopts) = putStr (showModeHelp chartmode) >> exitSuccess
-- | "--version" `elem` (rawopts_ $ cliopts_ chopts) = putStrLn progversion >> exitSuccess
= withJournalAndChartOptsDo chopts (writeChart balreport)
go
-- copied from hledger-web
withJournalAndChartOptsDo :: ChartOpts -> (ChartOpts -> Journal -> IO ()) -> IO ()
withJournalAndChartOptsDo opts cmd = do
f <- head `fmap` journalFilePathFromOpts (cliopts_ opts)
readJournalFile Nothing Nothing True f >>=
either error' (cmd opts . journalApplyAliases (aliasesFromOpts $ cliopts_ opts))
-- | Generate an image with the pie chart and write it to a file
writeChart :: BalanceReport -> ChartOpts -> Journal -> IO ()
writeChart balreport opts j = do
-- d <- getCurrentDay
if null $ jtxns j
then putStrLn "This journal has no transactions, can't make a chart." >> exitFailure
else do
let chart = genPie opts balreport
let fileoptions = def -- FileOptions (fromIntegral w, fromIntegral h) SVG loadSansSerifFonts
renderableToFile fileoptions filename (toRenderable chart)
return ()
where
filename = chart_output_ opts
-- (w,h) = parseSize $ chart_size_ opts
-- ropts = reportopts_ $ cliopts_ opts
-- | Parse image size from a command-line option
-- parseSize :: String -> (Int,Int)
-- parseSize str = (read w, read h)
-- where
-- x = fromMaybe (error' "Size should be in WIDTHxHEIGHT format") $ findIndex (=='x') str
-- (w,_:h) = splitAt x str
-- | Generate pie chart
genPie :: ChartOpts -> BalanceReport -> PieLayout
genPie opts (items, _total) = def { _pie_background = solidFillStyle $ opaque $ white
, _pie_plot = pie_chart }
where
pie_chart = def { _pie_data = map (uncurry accountPieItem) chartitems
, _pie_start_angle = (-90)
, _pie_colors = mkColours hue
, _pie_label_style = def{_font_size=12}
}
chartitems = dbg1 "chart" $ top num samesignitems :: [(AccountName, Double)]
(samesignitems, sign) = sameSignNonZero items
top n t = topn ++ [other]
where
(topn,rest) = splitAt n $ sortBy (flip $ comparing snd) t
other = ("other", sum $ map snd rest)
num = chart_items_ opts
hue = if sign > 0 then red else green where (red, green) = (0, 110)
-- copts = cliopts_ opts
-- ropts = reportopts_ copts
-- | Select the nonzero items with same sign as the first, and make
-- them positive. Also return a 1 or -1 corresponding to the original sign.
sameSignNonZero :: [BalanceReportItem] -> ([(AccountName, Double)], Int)
sameSignNonZero is
| null nzs = ([], 1)
| otherwise = (map pos $ filter (test.fourth4) nzs, sign)
where
nzs = filter ((/=0).fourth4) is
pos (acct,_,_,as) = (acct, abs $ read $ show $ maybe 0 aquantity $ headMay $ amounts as)
sign = if fourth4 (head nzs) >= 0 then 1 else (-1)
test = if sign > 0 then (>0) else (<0)
-- | Convert all quantities of MixedAccount to a single commodity
-- amountValue :: MixedAmount -> Double
-- amountValue = quantity . mixedAmountWithCommodity unknown
-- | Generate a tree of account names together with their balances.
-- The balance of account is decremented by the balance of its subaccounts
-- which are drawn on the chart.
-- balances :: Tree Account -> Tree (AccountName, Double)
-- balances (Node rootAcc subAccs) = Node newroot newsubs
-- where
-- newroot = (aname rootAcc,
-- amountValue $
-- aibalance rootAcc - (sum . map (aibalance . root)) subAccs)
-- newsubs = map balances subAccs
-- | Build a single pie chart item
accountPieItem :: AccountName -> Double -> PieItem
accountPieItem accname = PieItem (T.unpack accname) offset where offset = 0
-- | Generate an infinite color list suitable for charts.
mkColours :: Double -> [AlphaColour Double]
mkColours hue = cycle $ [opaque $ rgbToColour $ hsl h s l | (h,s,l) <- liftM3 (,,)
[hue] [0.7] [0.1,0.2..0.7] ]
rgbToColour :: (Fractional a) => RGB a -> Colour a
rgbToColour (RGB r g b) = rgb r g b

View File

@ -1,42 +1,155 @@
# Some hledger/PTA-related bash scripts. # Some hledger/PTA-related bash scripts. See also Justfile.
export FIRSTYEAR="${FIRSTYEAR:-2020}"
export YEAR="${YEAR:-$(date +%Y)}"
export FINDIR=~/finance export FINDIR=~/finance
export LEDGER_FILE=$FINDIR/2022.journal export LEDGER_FILE=$FINDIR/$YEAR/$YEAR.journal
fin() { # fin [PAT] - list financial scripts in $FINDIR/bin/[bashrc] (default: ~/finance) alias all='hledger -f $FINDIR/all.journal'
(cd ${FINDIR:-~/finance} || exit; bin "$@") alias 2020='hledger -f $FINDIR/2020/2020.journal'
alias 2021='hledger -f $FINDIR/2021/2021.journal'
alias 2022='hledger -f $FINDIR/2022/2022.journal'
alias 2023='hledger -f $FINDIR/2023/2023.journal'
alias 2024='hledger -f $FINDIR/2024/2024.journal'
alias 2025='hledger -f $FINDIR/2024/2025.journal'
alias 2026='hledger -f $FINDIR/2024/2026.journal'
alias jan="hledger -p jan"
alias feb="hledger -p feb"
alias mar="hledger -p mar"
alias apr="hledger -p apr"
alias may="hledger -p may"
alias jun="hledger -p jun"
alias jul="hledger -p jul"
alias aug="hledger -p aug"
alias sep="hledger -p sep"
alias oct="hledger -p oct"
alias nov="hledger -p nov"
alias dec="hledger -p dec"
alias accounts='hledger accounts'
alias activity='hledger activity'
alias add='hledger add'
alias areg='hledger aregister'
alias bal='hledger balance'
alias bar='hledger bar'
alias bs='hledger balancesheet'
alias bse='hledger balancesheetequity'
alias budget='hledger balance --budget'
alias cf='hledger cashflow'
alias check='hledger check'
alias close='hledger close'
alias codes='hledger codes'
alias commodities='hledger commodities'
alias desc='hledger descriptions'
alias files='hledger files'
alias iadd='hledger-iadd'
alias interest='hledger interest'
alias import='hledger import'
alias is='hledger incomestatement'
alias lots='hledger lots'
alias notes='hledger notes'
alias payees='hledger payees'
alias plot='hledger plot'
alias prices='hledger prices'
alias print='hledger print'
alias reg='hledger register'
alias repl='hledger repl'
alias rewrite='hledger rewrite'
alias roi='hledger roi'
alias run='hledger run'
alias stats='hledger stats'
alias tags='hledger tags'
alias ui='hledger ui'
alias web='hledger web'
alias bser='hledger -f $LEDGER_FILE -f <(hledger close --retain) bse'
alias f=$FINDIR/Justfile
alias hl='hledger'
# query hledger with sqlite
hq() {
(hledger print -O sql; echo "$1") | sqlite3 -column -header;
} }
bin() { # bin [PAT] - list aliases, functions, scripts in ./bin/[bashrc] # list likely hledger-readable files in current directory
PAT="${1-.}" hledgerfiles() {
BINDIR=./bin ls $@ *.{journal,j,timelog,csv,ledger,lgr,dat} 2>/dev/null
BASHRC=$BINDIR/bashrc
( [[ -e $BASHRC ]] && grep -E '^(alias|function|\w+\(\))' $BASHRC \
| gnused -E -e 's/^alias *//' -e 's/^(function )?(\w+) *\(\) *\{/\2()/' -e 's/#/\t#/' \
# -e "s/=('[^']+'|\"[^\"]+\"|\w+)/=/" # uncomment to hide alias definitions
[[ -d $BINDIR ]] && for F in "$BINDIR"/*; do
[[ -x $F ]] || continue
printf '%s ' "$(basename "$F")"
(grep -IE '^(#|--) ' "$F" 2>/dev/null | gnused -E 's/(#|--)/\t#/'; echo) | head -1
done
) | grep -iE "$PAT" \
#| sort -b -k2 # uncomment to sort by name
} }
gnused() { # GNU sed, called gsed on mac # helpers for working with yearly files.
if hash gsed 2>/dev/null; then gsed "$@"; else sed "$@"; fi
yearfiles() { # yearfiles [N] - list all or the last N yearly journal files
N="$1"; shift
YEAR=$(date +%Y)
if [[ -n "$N" ]]; then
START=$(( "$YEAR" - "$N" + 1))
else
START=$FIRSTYEAR
fi
for ((y="$START"; y<="$YEAR"; y++)); do
echo "$FINDIR/$y/$y.journal"
done
} }
gnudate() { # GNU date, called gdate on mac yearfileopts() { # yearfileopts [N] - print -f options for all or the last N yearly journals
if hash gdate 2>/dev/null; then gdate "$@"; else date "$@"; fi for y in $(yearfiles "$1"); do
echo -f"$y"
done
} }
# years [N] CMD.. - run hledger CMD on all or just the last N yearly journals combined
# eg:
# years stats
# years 2 stats
years() {
N="$1"
if [[ "$N" =~ ^[0-9]+$ ]]; then
shift
else
N=
fi
# shellcheck disable=SC2046
hledger $(yearfileopts "$N" | xargs) "$@"
}
# eachyear [N] [n|p|P] "SHELLCMD" - run SHELLCMD with $LEDGER_FILE set,
# for each or just the last N yearly journals,
# optionally printing the file name with 0, 1 or 2 line breaks.
# Accepts shell commands, extra quoting may be needed.
# eg:
# eachyear 10 hledger bal -0 -N cur:\\\\$
# eachyear p files
# eachyear P 'files | wc -l'
# eachyear 5 P 5 'hledger stats | tail -1'
# eachyear 7 p 'comm | rg ^...$'
eachyear() {
N="$1"
if [[ "$N" =~ ^[0-9]+$ ]]; then
shift
else
N=
fi
P="$1"
if [[ "$P" =~ ^[npP]$ ]]; then
shift
else
P=
fi
for f in $(yearfiles "$N"); do
if [[ -n "$P" ]]; then
if [[ $P == P ]]; then echo; fi
printf "%s: " "$(basename "$f")"
if [[ $P != n ]]; then echo; fi
fi
bash -ic "(LEDGER_FILE=$f; $*)" # XXX loses some quoting
done
}
# time # time
# all in one big journal: #export TIMELOG=$FINDIR/time.journal
#export TIMELOG=~/personal/time.journal export TIMELOG=$FINDIR/time/time-2024.journal
export TIMEDOT=$FINDIR/time/time-2024.timedot
alias hours="hledger -f $TIMELOG" alias hours="hledger -f $TIMELOG"
alias today='hours -p today' alias today='hours -p today'
@ -59,115 +172,3 @@ alias sephours="hours -p sep"
alias octhours="hours -p oct" alias octhours="hours -p oct"
alias novhours="hours -p nov" alias novhours="hours -p nov"
alias dechours="hours -p dec" alias dechours="hours -p dec"
alias 2008hours="hours -p 2008"
alias 2009hours="hours -p 2009"
alias 2010hours="hours -p 2010"
alias 2011hours="hours -p 2011"
alias 2012hours="hours -p 2012"
alias 2013hours="hours -p 2013"
alias 2014hours="hours -p 2014"
alias 2015hours="hours -p 2015"
alias weeklyhours="hours -p 'weekly this year' register --empty"
alias monthlyhours="hours -p 'monthly this year' register --empty"
alias weeklybillablehours="weeklyhours jobs not:unbilled --depth 3"
alias monthlybillablehours="monthlyhours jobs not:unbilled --depth 3"
# money
# one journal per year, included by current and all journals:
#export LEDGER_FILE=~/personal/current.journal
#export LEDGER_FILE=~/personal/all.journal
alias jan="hledger -p jan"
alias feb="hledger -p feb"
alias mar="hledger -p mar"
alias apr="hledger -p apr"
alias may="hledger -p may"
alias jun="hledger -p jun"
alias jul="hledger -p jul"
alias aug="hledger -p aug"
alias sep="hledger -p sep"
alias oct="hledger -p oct"
alias nov="hledger -p nov"
alias dec="hledger -p dec"
alias 2006='hledger -f ~/personal/2006.journal'
alias 2007='hledger -f ~/personal/2007.journal'
alias 2008='hledger -f ~/personal/2008.journal'
alias 2009='hledger -f ~/personal/2009.journal'
alias 2010='hledger -f ~/personal/2010.journal'
alias 2011='hledger -f ~/personal/2011.journal'
alias 2012='hledger -f ~/personal/2012.journal'
alias 2013='hledger -f ~/personal/2013.journal'
alias 2014='hledger -f ~/personal/2014.journal'
alias 2015='hledger -f ~/personal/2015.journal'
alias all='hledger -f ~/personal/all.journal'
alias household='hledger -f ~/personal/household.journal'
alias add='hledger add'
alias bankbalances='hledger bal assets:bank liabilities:credit -E'
alias cashflow="hledger balance '^assets:(bank|cash)'"
alias incexp="hledger balance '(^income|^expenses|^equity:draw)'"
# show activity in these accounts this and last month
alias cash="hledger -d 'd>=[last month]' reg 'assets:cash' -B"
alias checking="hledger -d 'd>=[last month]' reg 'assets:bank:wells fargo:checking' -B"
# show daily cleared checking balance - for reconciling with online bank statement
alias checkingcleared="checking --cleared --period 'daily to tomorrow'"
# show checking balance from today forward
alias checkingfuture="checking -d 'd>=[yesterday]'"
# generate a chart and view it in emacs
chart () {
hledger chart $* && emacsclient -n hledger.png
}
# old ledger 2.6 scripts
BalanceSheet() {
echo "Balance sheet as of `date`"
echo "totals include sub-accounts"
echo
ledger -n --balance-format '%10T %2_%-a\n' --display "l<=3" --basis --subtotal $* balance assets
echo
ledger -n --balance-format '%10T %2_%-a\n' --display "l<=3" --basis --subtotal $* balance liabilities
echo
ledger -nE --balance-format '%10T %2_%-a\n' --display "l<=4" --basis --subtotal $* balance equity
echo
echo "`ledger --balance-format '%10T %2_%-a\n' --basis $* balance liabilities equity | tail -1`liabilities + equity"
echo
ledger --balance-format '%10T %2_%-a\n' --basis $* balance assets liabilities | tail -2
}
IncomeStatement() {
echo "Income statement for `date +%Y` as of `date`"
echo "totals include sub-accounts"
echo
ledger -n --balance-format '%10(-T) %2_%-a\n' --display "l<=3" --basis --subtotal $* balance income
echo
ledger -n --balance-format '%10(-T) %2_%-a\n' --display "l<=2" --basis --subtotal $* balance expenses -equity
echo
ledger --balance-format '%10(-T) %2_%-a\n' --basis $* balance income expenses -equity | tail -2
}
# function CashflowStatement () {
# echo "Cashflow statement for `date +%Y`"
# #echo "(totals include sub-accounts)"
# echo
# cat <<EOF
# cash flows from operating activities
# net income as on income statement
# add: depreciation
# add: allowance for doubtful accounts
# deduct: increase in inventory
# deduct: increase in prepaid expenses
# deduct: decrease in accounts payable
# cash flows from investing activities
# cash received from investments sold
# less: cash paid for store equipment
# cash flows from financing activities
# cash paid for dividends
#
# Increase in cash:
# Cash at the beginning of the year:
# Cash at the end of the year:
# EOF
# }

View File

@ -8,7 +8,7 @@ echo "building hledger libraries for scripts"
stack build hledger stack build hledger
echo "installing extra libraries for scripts" echo "installing extra libraries for scripts"
stack install string-qq stack install string-qq microlens
echo "compiling the hledger-* scripts" echo "compiling the hledger-* scripts"
for f in `git ls-files 'hledger-*.hs'`; do stack ghc -- "$f"; done for f in `git ls-files 'hledger-*.hs'`; do stack ghc -- "$f"; done

View File

@ -1,38 +0,0 @@
# some CSV-related make scripts
HLEDGER=hledger
YEAR:=$(shell date +%Y)
MONTH:=$(shell date +%m)
MONTHS:=$(shell ghc -e "(putStr . unwords . map show) [1..$(MONTH)]")
MONTHS2:=$(shell ghc -e "(putStr . unwords . map show) [2..$(MONTH)]")
###############################################################################
# convert latest bank csv downloads to journal files
BANKJOURNALS = \
mint.journal \
WellsFargoChecking1.journal \
WellsFargoSavings2.journal \
WellsFargoSavings3.journal \
WellsFargoCreditCard4.journal \
Paypal.journal
convert-csv: move-csv $(BANKJOURNALS)
# move and rename any newly downloaded bank csv files
DOWNLOADDIR=~/Desktop
move-csv:
@(F=$(DOWNLOADDIR)/transactions.csv; [ -e $$F ] && (mv $$F mint.csv; echo new mint.csv found) || exit 0)
@(F=$(DOWNLOADDIR)/Checking1.csv; [ -e $$F ] && (mv $$F WellsFargoChecking1.csv; echo new WellsFargoChecking1.csv found) || exit 0)
@(F=$(DOWNLOADDIR)/Savings2.csv; [ -e $$F ] && (mv $$F WellsFargoSavings2.csv; echo new WellsFargoSavings2.csv found) || exit 0)
@(F=$(DOWNLOADDIR)/Savings3.csv; [ -e $$F ] && (mv $$F WellsFargoSavings3.csv; echo new WellsFargoSavings3.csv found) || exit 0)
@(F=$(DOWNLOADDIR)/CreditCard4.csv; [ -e $$F ] && (mv $$F WellsFargoCreditCard4.csv; echo new WellsFargoCreditCard4.csv found) || exit 0)
@(F=$(DOWNLOADDIR)/Download.csv; [ -e $$F ] && (mv $$F Paypal.csv; echo new Paypal.csv found) || exit 0)
# convert a csv to a journal using the similarly named rules file
%.journal: %.csv %.rules
$(HLEDGER) convert $< >$@
%.rules:
touch '$@'

162
bin/ft Executable file
View File

@ -0,0 +1,162 @@
#!/usr/bin/env bash
# * ft - financial scripts, see below
# ** PREAMBLE
# shellcheck shell=bash disable=SC2317
# Customise as needed; consider keeping as a git checkout for merging updates.
# See also: justfile, an alternative.
set -e
rg="rg -IN --sort=path"
date=$(if [ "$(builtin type -p gdate)" ]; then echo gdate; else echo date; fi)
sed=$(if [ "$(builtin type -p gsed)" ]; then echo gsed; else echo sed; fi)
help() { # show this help
cat <<EOF
--------------------------------------------------------------------------------"; }
ft - finance tool: run financial reports and finance-related scripts
Usage: ft [COMMAND [ARGS]]
Commands:
$($rg '^\w.*\(\) *\{ *#' "$0" | $sed -e 's/() *{//' | column -t -s'#')
OTHERCMD [ARGS] run other hledger commands on the default journal
Add hledger options to customise reports.
EOF
}
# '(...|# \*\* [^#].*)' -or '$3 $1|$2'
# The main hledger file to import to and report on. It should exist.
JOURNAL="$LEDGER_FILE"
#DIR=${FINDIR:-~/finance}
DIR=$(dirname "$JOURNAL")
cd "$DIR"
PERIOD="1/1..tomorrow"
TODAY=$($date +%Y-%m-%d)
#TODAY=$(TZ=UTC $date +%Y-%m-%d)
#YEAR=$($date +%Y)
# ** IMPORT TXNS ------------------------------------------------------------
# where to import most hledger transactions from
IMPORTFILES=(\
bank1-checking.csv.rules \
bank1-savings.csv.rules \
paypal.csv \
)
# hledger .rules files(/globs) used for IMPORTFILES
IMPORTRULESFILES=$($sed -Ee 's/.csv /.csv.rules /g' <<< "${IMPORTFILES[*]}")
IMPORTRULESFILES+=(common.rules unify.rules wf.rules wf*checking.rules wf*savings.rules)
get-csv() { # download auto-downloadable CSVs (paypal)
paypaljson | paypaljson2csv > paypal.csv
}
import-dry() { # import new downloaded transactions to the journal, dry run
hledger -f "$JOURNAL" import "${IMPORTFILES[@]}" --dry-run
}
import() { # import new downloaded transactions to the journal, logging and not printing errors
date >>import.log
hledger -f "$JOURNAL" import "${IMPORTFILES[@]}" 2>>import.log || echo "Failed, check import.log"
echo "Use ledger-mode's M-q to align entries."
}
# ** IMPORT PRICES ------------------------------------------------------------
get-prices() { # [PRICEHISTFETCHOPTS] - download prices for main commodities (default: today's)
(pricehist fetch -o ledger -s "$TODAY" alphavantage EUR/USD "$@" | $sed -E 's/EUR/€/') &
(pricehist fetch -o ledger -s "$TODAY" alphavantage GBP/USD "$@" | $sed -E 's/GBP/£/') &
(pricehist fetch -o ledger -s "$TODAY" alphavantage JPY/USD "$@" | $sed -E 's/JPY/¥/')
# Parallelised for speed; do slowest last.
# Output order varies, can be sorted with LC_COLLATE=C.UTF-8 sort or hledger -f- prices.
}
# ** REPORTS ------------------------------------------------------------
# *** general ------------------------------------------------------------
bs() { # show balance sheet
hledger -f "$JOURNAL" bs --layout bare --pretty --drop 1 -p "$PERIOD" -E -5 "$@"
}
is() { # show income statement
hledger -f "$JOURNAL" is --layout bare --pretty --drop 1 -p "$PERIOD" -S "$@"
}
a() { # show assets
hledger -f "$JOURNAL" bal type:al -H --layout bare --pretty --drop 1 -p "$PERIOD" -E "$@"
}
r() { # show revenues
hledger -f "$JOURNAL" bal type:r --layout bare --pretty --drop 1 -p "$PERIOD" -S --invert "$@"
}
x() { # show expenses
hledger -f "$JOURNAL" bal type:x --layout bare --pretty --drop 1 -p "$PERIOD" -S --invert "$@"
}
ab() { # show assets bar chart
echo "Quarterly net worth:"
hledger-bar -v 200 -f "$JOURNAL" -Q type:al -H "$@"
}
rb() { # show revenues bar chart
echo "Quarterly revenues:"
hledger-bar -v 40 -f "$JOURNAL" -Q type:r --invert "$@"
}
xb() { # show expenses bar chart
echo "Quarterly expenses:"
hledger-bar -v 40 -f "$JOURNAL" -Q type:x --invert "$@"
}
# XXX with partial workaround for https://github.com/gooofy/drawilleplot/issues/4
al() { # show assets line chart
hledger -f "$JOURNAL" plot -- bal --depth=1 ^assets --historical --terminal --rcParams '{"figure.figsize":[8,3]}' --no-today -q --title "hledger assets" "$@" | $sed 's// /g'
}
rl() { # show revenues line chart
hledger -f "$JOURNAL" plot -- bal --depth=1 ^revenues --monthly --invert --terminal --rcParams '{"figure.figsize":[8,3]}' --drawstyle 'steps-mid' --no-today -q --title "hledger monthly revenues" "$@" | $sed 's// /g'
}
xl() { # show expenses line chart
hledger -f "$JOURNAL" plot -- bal --depth=1 ^expenses --monthly --terminal --rcParams '{"figure.figsize":[8,3]}' --drawstyle 'steps-mid' --no-today -q --title "hledger monthly expenses" "$@" | $sed 's// /g'
}
forecast() { # print transactions predicted by forecast rules from last week on
hledger print --auto --forecast=lastweek.. -I tag:_generated "$@"
}
household() { # show a draft month-end household adjustment transaction for last month
env household "$($date -v-1m +%b)"
}
# *** tax ------------------------------------------------------------
# estimated-tax:
# @echo "Federal estimated tax due for this year"
# $(HLEDGER) register liabilities:personal:tax:federal:$(YEAR) --width=130
# @echo State estimated tax due for this year:
# @$(HLEDGER) register liabilities:personal:tax:state:$(YEAR) --width=130
# @echo
# *** business ------------------------------------------------------------
consulting() { # show consulting revenue
hledger -f "$JOURNAL" reg --invert 'revenues:(client1|client2)' -p "$PERIOD" "$@"
}
# *** other ------------------------------------------------------------
bin() { # [PAT] show all scripts in $DIR/bin/[bashrc] (default: ~/finance/)
env bin "$@"
}
# ** END
if [[ $# -eq 0 ]]; then help # no args shows help
elif declare -f "$1" > /dev/null; then "$@"; # arg 1 selects a function above
else hledger -f "$JOURNAL" "$@"; fi # or fall through to hledger
exit

101
bin/gsheet-csv.hs Executable file
View File

@ -0,0 +1,101 @@
#!/usr/bin/env stack
{- stack --resolver=nightly-2025-09-30 script --compile --verbosity=error
--package "bytestring cassava gogol gogol-core gogol-sheets lens pretty-show text"
-}
-- or
#!/usr/bin/env cabal
{- cabal:
build-depends: aeson<1.6, bytestring, cassava, gogol, gogol-core, gogol-sheets, lens, pretty-show, text
-}
-- In 2023-02, this is hard to build; gogol is unmaintained and requires old aeson < 1.6,
-- which requires old bytestring which requires old GHC (8.10 or 9.0).
-- On modern macs these GHCs are difficult to run. This build most deps for me:
-- brew install llvm@12
-- ghcup set ghc 9.0.2
-- PATH=/opt/homebrew/opt/llvm@12/bin:$PATH CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/ffi cabal build gsheet-csv.hs
-- but failed on cryptonite with "error: instruction requires: sha3", an llvm 12 on arm bug
{-
gsheet-csv - download the CSV of a Google Sheet you have access to
INSTALL:
Get stack if needed, eg from https://haskell-lang.org/get-started
Run "./gsheet-csv.hs" once to compile. On Windows, run "stack gsheet-csv.hs".
SETUP:
Set up an account at https://console.developers.google.com/iam-admin/serviceaccounts, selecting or creating a project
Save the service account's email address
Create a key and download as json to ~/.config/gcloud/KEYFILE.json
Symlink this to ~/.config/gcloud/application_default_credentials.json
Share spreadsheets with the service account's email address
USAGE:
gsheet-csv SPREADSHEETID SHEETNAME - print specified sheet as CSV
-}
{-# LANGUAGE PackageImports #-}
module Main
where
import "lens" Control.Lens
import "bytestring" qualified Data.ByteString.Lazy as B
import "cassava" Data.Csv
import "text" qualified Data.Text as T
import "gogol" Network.Google
import "gogol-sheets" Network.Google.Sheets
import "base" System.Environment
import "base" System.IO
-- import "base" Debug.Trace
-- import "pretty-show" Text.Show.Pretty (pPrint, ppShow)
main = do
[spreadsheetId, sheetName] <- map T.pack <$> getArgs
let range = sheetName -- ++"!A1:J10"
lgr <- newLogger Info stdout
env <- newEnv <&> (envLogger .~ lgr) . (envScopes .~ spreadsheetsReadOnlyScope)
values <- view vrValues <$> (runResourceT . runGoogle env $ send (spreadsheetsValuesGet spreadsheetId range))
B.putStr $ Data.Csv.encode $ map (map bs) values
where bs = drop 8 . init . show -- no more time for hilariously craptastic haskell libs
------------------------------
-- notes
-- import Data.Aeson
-- import Data.Text (Text)
-- import Network.Google.Data.JSON
-- import Network.Google.Resource.Sheets.Spreadsheets.Get
{-
TODO:
gsheet-csv [-h] - show help
gsheet-csv SPREADSHEETID - get first sheet
gsheet-csv SPREADSHEETID SHEETNAME RANGE - get just the specified cells
-}
{-
Notes for developers of stack (1.9.1) scripts:
1. In the stack header above, flags' position and style are critical.
Minor variations cause very different behaviour.
2. For different run actions, adjust the stack command:
script --optimize - run compiled, after compiling if needed
script --compile - run compiled, after compiling if needed (without optimisation)
script - run interpreted (slower)
exec runghc - run interpreted using ambient GHC package db
exec ghc - compile
exec ghci - load in GHCI
exec ghcid - watch for compile errors
3. To silence "Using resolver:" output (but also deps install output), change --verbosity to warn
4. Declare which package each import is from, keep synced with --package; might as well be clear
5. Doc: https://docs.haskellstack.org/en/stable/topics/scripts
-}

View File

@ -1,77 +0,0 @@
#!/usr/bin/env stack
-- stack runghc --verbosity info --package hledger --package string-qq
--resolver nightly-2022-09-01
{-
hledger-addon-example - a hledger addon command template.
This an example of an addon command (an executable named hledger-*).
By default it reads your default journal and prints the number of
transactions. It supports many of the usual hledger options; run it
with -h/--help to see them. When you want to create a new hledger
command, save this script under a new name, somewhere in $PATH,
keeping it executable, and start tweaking the code.
Requirements:
This is a stack script, requiring stack to run. hledger addons do not
have to be stack scripts, but this one is, as they work well for this.
If you prefer you can adapt it to be a cabal script, or you can
install the required haskell libraries (see above) and then
run/compile it with a suitable runghc/ghc command.
The script may require specific versions of the libraries.
If run/compiled from inside the hledger source tree, it will use that hledger
version and the libs of the stackage resolver in stack.yaml.
If run/compiled from outside the hledger source tree, it will use the hledger
and libs of the resolver in ~/.stack/global-project/stack.yaml.
Or you can uncomment --resolver above to use another resolver.
Usage:
Executing this script will cause stack to run it in interpreted mode:
$ hledger-addon-example.hs
Or you can compile first:
$ stack ghc hledger-addon-example.hs --package hledger --package string-qq
$ hledger-addon-example
Whether compiled or not, you can also run it as a hledger subcommand, if it is in $PATH:
$ hledger addon-example
-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
import Data.String.QQ (s)
import Text.Printf
import Hledger
import Hledger.Cli
------------------------------------------------------------------------------
cmdmode = hledgerCommandMode
[s| addon-example
Print the number of transactions in the journal.
_FLAGS
|]
[]
[generalflagsgroup1]
[]
([], Nothing) -- Just $ argsFlag "[QUERY]")
------------------------------------------------------------------------------
main :: IO ()
main = do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode
withJournalDo opts $ \j -> do
d <- getCurrentDay
let
q = _rsQuery rspec
ts = filter (q `matchesTransaction`) $ jtxns $ journalApplyValuationFromOpts rspec j
printf "File %s: %d transactions\n" (journalFilePath j) (length ts)

View File

@ -0,0 +1,112 @@
#!/usr/bin/env stack
-- stack runghc --verbosity info --package hledger
-- Run from inside the hledger source tree, or compile with compile.sh.
-- See hledger-check-fancyassertions.hs.
-- {-# OPTIONS_GHC -Wno-missing-signatures #-}
{-| Construct two balance reports for two different time periods and use one of the as "budget" for
the other, thus comparing them
-}
import Data.Text.Lazy.IO qualified as TL
import System.Environment (getArgs)
import Hledger.Cli.Script
import Hledger.Cli.Commands.Balance
import qualified Data.Map as Map
import Data.List (sortOn)
------------------------------------------------------------------------------
cmdmode = hledgerCommandMode
(unlines ["balance-as-budget-multi"
,"Read two journal files and generate multiple balance reports that use first of them as budget for the second."
," "
,"Pass two journal names and a file that contains sets of 'hledger balance'-compatible options, one per line"
,"For example, to use Jan 2019 as budget for Jan 2020, use:"
,"2019.journal 2020.journal commands.txt"
,"and put '\"assets\" --depth 3 --value=$,then' in the commands.txt"
])
[]
[generalflagsgroup1]
[]
([], Just $ argsFlag "BUDGET_JOURNAL ACTUAL_JOURNAL COMMAND_FILE")
------------------------------------------------------------------------------
main :: IO ()
main = do
args <- getArgs
case args of
[budget_f, real_f, commands_f] -> runAllCommands budget_f real_f commands_f
_ -> error' "expected exactly three arguments"
runAllCommands :: String -> String -> String -> IO ()
runAllCommands budget_f real_f commands_f = do
d <- getCurrentDay
budget <- readJournalFile' budget_f
real <- readJournalFile' real_f
let styles = journalCommodityStylesWith HardRounding real
commands <- lines <$> readFile commands_f
forM_ commands $ \command -> do
let args = words' command
case args of
[] -> return ()
"echo":args -> putStrLn $ unwords args
_ -> do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts' balancemode args
let reportopts = _rsReportOpts rspec
-- Generate both reports from their respective journals (unchanged)
let budgetReport = multiBalanceReport rspec budget
actualReport = multiBalanceReport rspec real
-- Combine the reports
let combined = combineBudgetAndActual reportopts real budgetReport actualReport
writeOutputLazyText opts $ budgetReportAsText reportopts $ styleAmounts styles $ combined
-- | Combine two MultiBalanceReports into a BudgetReport, comparing them side by side.
-- The budget report uses the date periods from the actual (second) report.
combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport
combineBudgetAndActual ropts j
(PeriodicReport budgetperiods budgetrows (PeriodicReportRow _ budgettots budgetgrandtot budgetgrandavg))
(PeriodicReport actualperiods actualrows (PeriodicReportRow _ actualtots actualgrandtot actualgrandavg)) =
PeriodicReport actualperiods combinedrows totalrow
where
-- Build maps of amounts by account name
budgetMap = Map.fromList
[ (prrFullName row, (prrAmounts row, prrTotal row, prrAverage row))
| row <- budgetrows
]
actualMap = Map.fromList
[ (prrFullName row, (prrAmounts row, prrTotal row, prrAverage row))
| row <- actualrows
]
-- Accounts with actual amounts (and their budgets if available)
actualWithBudget =
[ PeriodicReportRow acct cells total avg
| PeriodicReportRow acct actualamts actualtot actualavg <- actualrows
, let budgetamts = maybe (replicate (length actualperiods) Nothing) (\(amts, _, _) -> map Just amts)
(Map.lookup (displayFull acct) budgetMap)
, let cells = zip (map Just actualamts) budgetamts
, let total = (Just actualtot, fmap (\(_, t, _) -> t) (Map.lookup (displayFull acct) budgetMap))
, let avg = (Just actualavg, fmap (\(_, _, a) -> a) (Map.lookup (displayFull acct) budgetMap))
]
-- Budget-only accounts (no actual amounts)
budgetOnly =
[ PeriodicReportRow acct cells total avg
| PeriodicReportRow acct budgetamts budgettot budgetavg <- budgetrows
, let acctName = displayFull acct
, not (acctName `Map.member` actualMap) -- Only include if not in actual
, let cells = zip (replicate (length actualperiods) (Just nullmixedamt)) (map Just budgetamts)
, let total = (Just nullmixedamt, Just budgettot)
, let avg = (Just nullmixedamt, Just budgetavg)
]
-- Combine and sort all rows by account name
combinedrows = sortOn prrFullName (actualWithBudget ++ budgetOnly)
totalrow = PeriodicReportRow ()
(zip (map Just actualtots) (map Just budgettots))
(Just actualgrandtot, Just budgetgrandtot)
(Just actualgrandavg, Just budgetgrandavg)

View File

@ -10,7 +10,10 @@
-} -}
import Data.Text.Lazy.IO as TL import Data.Text.Lazy.IO as TL
import System.Environment (getArgs) import System.Environment (getArgs)
import Hledger.Cli import Hledger.Cli.Script
import Hledger.Cli.Commands.Balance
import qualified Data.Map as Map
import Data.List (sortOn)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
cmdmode = hledgerCommandMode cmdmode = hledgerCommandMode
@ -34,13 +37,68 @@ main = do
args <- getArgs args <- getArgs
let report1args = takeWhile (/= "--") args let report1args = takeWhile (/= "--") args
let report2args = drop 1 $ dropWhile (/= "--") args let report2args = drop 1 $ dropWhile (/= "--") args
(_,_,report1) <- mbReport report1args
(ropts2,j,report2) <- mbReport report2args -- Get options for both reports
let pastAsBudget = combineBudgetAndActual ropts2 j report1{prDates=prDates report2} report2 opts1@CliOpts{reportspec_=rspec1} <- getHledgerCliOpts' balancemode report1args
TL.putStrLn $ budgetReportAsText ropts2 pastAsBudget opts2@CliOpts{reportspec_=rspec2} <- getHledgerCliOpts' balancemode report2args
withJournal opts1 $ \j1 -> do
withJournal opts2 $ \j2 -> do
-- Generate both reports with their respective date periods
let report1 = multiBalanceReport rspec1 j1 -- budget
report2 = multiBalanceReport rspec2 j2 -- actual
ropts2 = _rsReportOpts rspec2
styles = journalCommodityStylesWith HardRounding j2
-- Combine the reports (using report2's date periods for display)
let combined = combineBudgetAndActual ropts2 j2 report1 report2
writeOutputLazyText opts2 $ budgetReportAsText ropts2 $ styleAmounts styles $ combined
-- | Combine two MultiBalanceReports into a BudgetReport, comparing them side by side.
-- The budget report uses the date periods from the actual (second) report.
combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport
combineBudgetAndActual ropts j
(PeriodicReport budgetperiods budgetrows (PeriodicReportRow _ budgettots budgetgrandtot budgetgrandavg))
(PeriodicReport actualperiods actualrows (PeriodicReportRow _ actualtots actualgrandtot actualgrandavg)) =
PeriodicReport actualperiods combinedrows totalrow
where where
mbReport args = do -- Build maps of amounts by account name
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts' cmdmode args budgetMap = Map.fromList
d <- getCurrentDay [ (prrFullName row, (prrAmounts row, prrTotal row, prrAverage row))
(report,j) <- withJournalDo opts $ \j -> return (multiBalanceReport rspec j, j) | row <- budgetrows
return (_rsReportOpts rspec,j,report) ]
actualMap = Map.fromList
[ (prrFullName row, (prrAmounts row, prrTotal row, prrAverage row))
| row <- actualrows
]
-- Accounts with actual amounts (and their budgets if available)
actualWithBudget =
[ PeriodicReportRow acct cells total avg
| PeriodicReportRow acct actualamts actualtot actualavg <- actualrows
, let budgetamts = maybe (replicate (length actualperiods) Nothing) (\(amts, _, _) -> map Just amts)
(Map.lookup (displayFull acct) budgetMap)
, let cells = zip (map Just actualamts) budgetamts
, let total = (Just actualtot, fmap (\(_, t, _) -> t) (Map.lookup (displayFull acct) budgetMap))
, let avg = (Just actualavg, fmap (\(_, _, a) -> a) (Map.lookup (displayFull acct) budgetMap))
]
-- Budget-only accounts (no actual amounts)
budgetOnly =
[ PeriodicReportRow acct cells total avg
| PeriodicReportRow acct budgetamts budgettot budgetavg <- budgetrows
, let acctName = displayFull acct
, not (acctName `Map.member` actualMap) -- Only include if not in actual
, let cells = zip (replicate (length actualperiods) (Just nullmixedamt)) (map Just budgetamts)
, let total = (Just nullmixedamt, Just budgettot)
, let avg = (Just nullmixedamt, Just budgetavg)
]
-- Combine and sort all rows by account name
combinedrows = sortOn prrFullName (actualWithBudget ++ budgetOnly)
totalrow = PeriodicReportRow ()
(zip (map Just actualtots) (map Just budgettots))
(Just actualgrandtot, Just budgetgrandtot)
(Just actualgrandavg, Just budgetgrandavg)

137
bin/hledger-bar Executable file
View File

@ -0,0 +1,137 @@
#!/usr/bin/env bash
# hledger-bar - see below
usage() {
cat <<'EOS'
hledger-bar - show quick bar charts in the terminal
Usage:
hledger-bar [-h|--help]
hledger-bar [-v|-vv] [SCALE] BALARGS
hledger bar -- [-v|-vv] [SCALE] BALARGS # might need extra quoting
Requires bash (or osh) and hledger >= ~1.25.
With no arguments, shows this help.
Otherwise, runs hledger's 'balance' command, reporting monthly
balance changes by default, and shows the period totals as a bar chart
in the terminal, with positive amounts shown as '+' and negatives as '-'
(in green and red respectively, unless NO_COLOR is set).
Bars are not auto-sized; they will be (amount divided by SCALE) long, where
SCALE is 100 by default. This is overrideable by a numeric first argument.
Eg if bars are too long, try 200; if they are too short, try 50.
Most other options/arguments understood by the balance command can be
used, such as one or more account names, or different report intervals
like -W (weekly) or -Q (quarterly). There are two restrictions:
- You must ensure the report is for a single commodity. So use eg
'cur:€' or 'cur:\\$' or 'cur:\\\\$' or '-B' or '-X$ --infer-market-prices'
as needed.
- You can't use spaces in arguments (even quoted). If needed,
you could write '.' instead of space.
If you don't see the results you expect:
- Note that revenues appear negative and expenses positive,
as with the balance command; to flip signs, use --invert.
- Run as 'hledger-bar' to minimise command line quoting issues.
- Use -v as first argument to also show the (unscaled, rounded) amounts.
- Use -vv as first argument to show the amounts and the balance command
(approximately; you might need to add one level of quoting).
Tip: remove some of this command's first options to see a more
human-readable balance report.
- When you are reporting changes in asset/liability/equity accounts,
you will probably want to exclude opening/closing balance transactions,
eg with not:desc:'(opening|closing)' or not:tag:clopen if you use those.
Examples:
$ hledger-bar food # monthly food expenses
$ hledger-bar 1 --count food # monthly food posting counts
$ hledger-bar -v 1 -f $TIMELOG -D # daily hours, with numbers
$ hledger-bar type:c not:tag:clopen cur:\\$ -W # weekly cashflow, $ only
$ hledger-bar type:al not:tag:clopen cur:\\$ # monthly net worth change ($)
$ hledger-bar type:rx --invert cur:\\$ # monthly profit/loss ($)
$ hledger-bar type:rx --invert cur:\\$ --infer-market-prices --value=then,$
# monthly profit/loss ($, plus anything that can be converted to $,
# using conversion rates on transaction dates)
$ hledger-bar . cur:\\$ # all accounts' change ($)
$ hledger bar -- . cur:\\\\$ # as hledger subcommand
EOS
}
###############################################################################
set -e
defscale=100
negchar="-"
poschar="+"
# utils
# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit and 24-bit colors.
# Disable if stdout is not a terminal or NO_COLOR is defined.
if [[ ! -t 1 || -n ${NO_COLOR} ]]; then
red=''
green=''
nocol=''
else
red='\e[38;5;1m'
green="\e[38;5;2m"
nocol="\e[0m"
fi
unquote() { s="${1%\"}"; echo "${s#\"}"; }
# process command line
shownum=0
verbose=0
scale=${defscale}
if [[ $# -eq 0 || $1 == --help || $1 == -h ]]; then usage; exit; fi
if [[ $1 == -v ]]; then shownum=1; shift; elif [[ $1 == -vv ]]; then shownum=1; verbose=1; shift; fi
if [[ $1 =~ ^[0-9]+$ ]]; then scale=$1; shift; fi
# helpers
# The hledger reporting command. It should produce a two-column CSV
# report with one line per period and one currency. It must have a
# report interval for --transpose to work. shellcheck disable=SC2124
cmd="hledger balance -Ocsv --transpose -N -0 --layout=bare -M $*"
printcmd() {
echo "From command (might need added quotes):" # don't know how to print all the slashes
echo "${cmd}"
}
printamterr() {
cat <<EOS
Error: could not parse as a single-commodity amount: $1
The report must be restricted or converted to a single commodity.
Eg to report $, try: cur:\\\\$ or cur:\\\\\\\\$ or -B or -X$ --infer-market-prices
EOS
printcmd
}
# main
# shellcheck disable=SC2312
${cmd} | while IFS=, read -r period amount; do
if [[ ! ${amount} =~ [0-9] ]]; then continue; fi # ignore lines where amount has no digits
if [[ ${amount} =~ , ]]; then printamterr "${amount}"; exit 1; fi # check there is a single amount column
shopt -s inherit_errexit
int=$(printf '%.f' "$(unquote "${amount}")")
if [[ ${shownum} -gt 0 ]]; then num=$(printf "%10d " "${int}"); else num=""; fi
if [[ ${int} -lt 0 ]]; then c="${negchar}"; col=${red}; else c="${poschar}"; col=${green}; fi
n=$((int / scale))
absn=${n#-}
bar=$(while [[ ${absn} -gt 0 ]]; do printf "%s" "${c}"; absn=$((absn - 1)); done)
printf '%s\t%b%s%s%b\n' "$(unquote "${period}")" "${col}" "${num}" "${bar}" "${nocol}"
done
if [[ ${verbose} -gt 0 ]]; then printcmd; fi

14
bin/hledger-check-buynothing Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# hledger check-buynothing [-p PERIOD] [OTHERHLEDGERARGS]
# Check for no activity in Expense accounts on Buy Nothing Day (November 28th).
#
# You can specify a different date or period with -p.
# You can add other options/arguments to refine the query.
txns=$(hledger reg type:x -p 11/28 "$@")
if [[ ! "$txns" == "" ]]
then
echo "Buy Nothing failure!"
echo "$txns"
exit 1
fi

View File

@ -11,7 +11,7 @@
-- --
-- You could make this a standalone script that runs from anywhere and -- You could make this a standalone script that runs from anywhere and
-- recompiles itself when changed, by replacing "runghc" above with -- recompiles itself when changed, by replacing "runghc" above with
-- "script --compile --resolver lts-16" (eg). However this uses the -- "script --compile --resolver lts-22" (eg). However this uses the
-- hledger version from that stackage resolver, so in this case you -- hledger version from that stackage resolver, so in this case you
-- should check out the corresponding release-tagged version of this -- should check out the corresponding release-tagged version of this
-- script for compatibility (eg: git checkout 1.18.1). -- script for compatibility (eg: git checkout 1.18.1).
@ -111,18 +111,18 @@ import Data.Maybe (fromMaybe, mapMaybe)
import Data.Time.Calendar (toGregorian) import Data.Time.Calendar (toGregorian)
import Data.Time.Calendar.OrdinalDate (mondayStartWeek, sundayStartWeek, toOrdinalDate) import Data.Time.Calendar.OrdinalDate (mondayStartWeek, sundayStartWeek, toOrdinalDate)
import Data.Text (Text, isPrefixOf, pack, unpack) import Data.Text (Text, isPrefixOf, pack, unpack)
import qualified Data.Text as T import Data.Text qualified as T
import qualified Data.Text.IO as T import Data.Text.IO qualified as T
import qualified Hledger.Data as H import Hledger.Data qualified as H
import qualified Hledger.Query as H import Hledger.Query qualified as H
import qualified Hledger.Read as H import Hledger.Read qualified as H
import qualified Hledger.Utils.Parse as H import Hledger.Utils.Parse qualified as H
import Lens.Micro (set) import Lens.Micro (set)
import Options.Applicative import Options.Applicative
import System.Exit (exitFailure) import System.Exit (exitFailure)
import System.FilePath (FilePath) import System.FilePath (FilePath)
import qualified Text.Megaparsec as P import Text.Megaparsec qualified as P
import qualified Text.Megaparsec.Char as P import Text.Megaparsec.Char qualified as P
-- Don't know how to preserve newlines yet. -- Don't know how to preserve newlines yet.
helptxt = unlines [ helptxt = unlines [

View File

@ -14,20 +14,18 @@ import Data.String.QQ (s)
import Text.Printf import Text.Printf
import Control.Monad import Control.Monad
import Data.List import Data.List
import qualified Data.Text as T import Data.Text qualified as T
-- import Data.Time.Calendar -- import Data.Time.Calendar
import Safe import Safe
import System.Exit import System.Exit
import Hledger import Hledger
import Hledger.Cli import Hledger.Cli.Script
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
cmdmode :: Mode RawOpts cmdmode :: Mode RawOpts
cmdmode = hledgerCommandMode cmdmode = hledgerCommandMode
[s| check-postable [s| check-postable
Check that no postings are made to accounts with a postable:(n|no) tag. Check that no postings are made to accounts with a postable:(n|no) tag.
_FLAGS
|] |]
[] []
[generalflagsgroup1] [generalflagsgroup1]
@ -38,7 +36,7 @@ _FLAGS
main :: IO () main :: IO ()
main = do main = do
opts@CliOpts{reportspec_=_rspec} <- getHledgerCliOpts cmdmode opts@CliOpts{reportspec_=_rspec} <- getHledgerCliOpts cmdmode
withJournalDo opts $ \j -> do withJournal opts $ \j -> do
let let
postedaccts = journalAccountNamesUsed j postedaccts = journalAccountNamesUsed j
checkAcctPostable :: Journal -> AccountName -> Either AccountName () checkAcctPostable :: Journal -> AccountName -> Either AccountName ()

View File

@ -16,12 +16,12 @@ $ hledger check-tagfiles # compiles every time (?)
-} -}
import Control.Monad import Control.Monad
import qualified Data.Text as T import Data.Text qualified as T
import Hledger.Cli import Hledger.Cli.Script
import System.Directory import System.Directory
import System.Exit import System.Exit
main = withJournalDo defcliopts $ \j -> do main = withJournal defcliopts $ \j -> do
let filetags = [ (t,v) let filetags = [ (t,v)
| (t',v') <- concatMap transactionAllTags $ jtxns j | (t',v') <- concatMap transactionAllTags $ jtxns j
, let t = T.unpack t' , let t = T.unpack t'

View File

@ -17,12 +17,12 @@ $ hledger check-tagfiles # compiles if there's no compiled version
-} -}
import Control.Monad import Control.Monad
import qualified Data.Text as T import Data.Text qualified as T
import Hledger.Cli import Hledger.Cli.Script
import System.Directory import System.Directory
import System.Exit import System.Exit
main = withJournalDo defcliopts $ \j -> do main = withJournal defcliopts $ \j -> do
let filetags = [ (t,v) let filetags = [ (t,v)
| (t',v') <- concatMap transactionAllTags $ jtxns j | (t',v') <- concatMap transactionAllTags $ jtxns j
, let t = T.unpack t' , let t = T.unpack t'

View File

@ -8,10 +8,10 @@
{-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_GHC -Wno-missing-signatures #-}
import System.Environment (getArgs) import System.Environment (getArgs)
import Hledger.Cli import Hledger.Cli.Script
import qualified Data.Map as M import Data.Map qualified as M
import Data.Map.Merge.Strict import Data.Map.Merge.Strict
import qualified Data.Text.Lazy.IO as TL import Data.Text.Lazy.IO qualified as TL
appendReports :: MultiBalanceReport -> MultiBalanceReport -> MultiBalanceReport appendReports :: MultiBalanceReport -> MultiBalanceReport -> MultiBalanceReport
appendReports r1 r2 = appendReports r1 r2 =
@ -69,5 +69,5 @@ main = do
where where
mbReport args = do mbReport args = do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts' cmdmode args opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts' cmdmode args
report <- withJournalDo opts (return . multiBalanceReport rspec) report <- withJournal opts (return . multiBalanceReport rspec)
return (rspec,report) return (rspec,report)

43
bin/hledger-dc Executable file
View File

@ -0,0 +1,43 @@
#!/usr/bin/env bash
# hledger-dc JOURNALFILE CMD [ARGS]
# run a hledger command on a journal file which also supports Dr/Cr before the account name,
# instead of/in addition to amount signs.
# If a posting begins with Dr<WHITESPACE>, remove that.
# If it begins with Cr<WHITESPACE> and contains no number, remove that.
# If it begins with Cr<WHITESPACE>, remove that and add a minus sign before the next number, and if that leaves a double minus, cancel those out.
dc2sign() { sed -E -e 's/^(\s+)Dr\s+/\1/i' -e 's/^(\s+)Cr\s+([^0-9]+)$/\1\2/i' -e 's/^(\s+)Cr\s+([^0-9]+)([0-9])/\1\2-\3/i' -e 's/--([0-9])/\1/'; }
# Or with a two space delimiter after Dr/Cr, allowing account names like "Dr Michael:checkup":
#dc2sign() { sed -E -e 's/^(\s+)Dr\s\s+/\1/i' -e 's/^(\s+)Cr\s\s+([^0-9]+)$/\1\2/i' -e 's/^(\s+)Cr\s\s+([^0-9]+)([0-9])/\1\2-\3/i' -e 's/--([0-9])/\1/'; }
dc2sign <"$1" | hledger -f- "${@:2}"
# Example:
#
# $ cat sample.journaldc
# 2025-01-01 salary
# Cr revenues 800 USD
# Dr assets
#
# $ hledger -f sample.journaldc print
# 2025-01-01 salary
# Cr revenues 800 USD
# Dr assets
#
# $ hledger dc sample.journaldc print
# 2025-01-01 salary
# revenues -800 USD
# assets
# Dev notes:
# This is syntactic sugar.
# If useful, it should be possible to add this to journal format without too much breakage.
#
# Showing debits/credits separately in output, with a --dc flag, is more work.
# It could be prototyped as a single new report, eg an addon script providing variant of the simple balance report.
# I think both the report calculation and display code would need to change, to sum and show the positive amounts and negative amounts separately.
# It would be a nice feature: offering a more traditional view of things, and reducing sign vs dc doubts.
# "In France, you have to use a debit and a credit column, and can't use the positive/negative notation."
# Would it provide any real new error checking power ? I'm not sure.
# See also https://github.com/simonmichael/hledger/issues/71.

View File

@ -10,13 +10,16 @@ A git repo in the main file's directory will be autocreated if needed.
Subcommands: Subcommands:
hledger git record [MSG] - record the journal's files (as listed by 'files') hledger git [-h|--help] - show this help
hledger git status - show unrecorded changes (after first record) hledger git record [MSG] - record changes to journal's files (as listed by 'files')
hledger git log - list the journal's change history (after record) hledger git status - show unrecorded changes in journal's files (after first record)
hledger git - show this help hledger git log - list recorded changes in journal's files (after first record)
hledger git GITARGS - run another git command in this repo, on all files
Extra arguments are passed to git (git-specific flags should be preceded by --). The shorter r, s, l command aliases may be used instead.
You can install these as more convenient top-level commands by creating Extra/unrecognised arguments are passed to git. Git-specific flags should be preceded by --.
You can install this as more convenient top-level commands by creating
hledger-record, hledger-status, hledger-log scripts like: hledger-record, hledger-status, hledger-log scripts like:
#!/bin/sh #!/bin/sh
@ -24,9 +27,10 @@ hledger-record, hledger-status, hledger-log scripts like:
Examples: Examples:
hledger git status $ hledger git s # briefly show status of journal's files
hledger git log -10 $ hledger git l -10 # briefly list last 10 commits to journal's files
hledger git log -- -10 --stat $ hledger git l -- --stat # list commits to journal's files, with summaries
$ hledger git r 'txns' -- -n # commit changes, ignoring any pre-commit hooks
EOF EOF
} }
@ -58,12 +62,11 @@ EOF
fi fi
} }
# TODO: also look in parent directories
ensure_git_repo() { ensure_git_repo() {
if [[ ! -d "$DIR/.git" ]]; then if [[ $($GIT -C "$DIR" rev-parse --is-inside-work-tree 2> /dev/null) != true ]]; then
$GIT init "$DIR" $GIT init "$DIR"
echo "Created git repo in $DIR" echo "Created git repo in $DIR"
fi fi
} }
# * Commands # * Commands
@ -73,15 +76,24 @@ record() {
ensure_git ensure_git
ensure_git_repo ensure_git_repo
cd "$DIR" cd "$DIR"
for F in $FILES; do $GIT add -f "$F"; done for F in $FILES; do $GIT add "$F"; done || echo "(ignored)" >&2
MSG=${1:-$(date +'%Y-%m-%d %H:%M:%S %Z')}; shift MSG=${1:-$(date +'%Y-%m-%d %H:%M:%S %Z')}
$GIT record -m "$MSG" "$@" -- "$FILES" if [ $# -ge 1 ]; then
shift
fi
$GIT commit -m "$MSG" "$@" || (echo "error: commit failed" >&2; $GIT reset -q)
} }
r() { record "$@"; }
status() { status() {
ensure_git ensure_git
$GIT --work-tree "$DIR" status -sb "$@" -- "$FILES" # short status
$GIT --work-tree "$DIR" status -sb "$@" -- $FILES
echo
# diff
$GIT --work-tree "$DIR" diff "$@" -- $FILES
} }
s() { status "$@"; }
log() { log() {
ensure_git ensure_git
@ -91,8 +103,14 @@ log() {
# TODO: limit to hledger files # TODO: limit to hledger files
$GIT log --format='%ad %h %s' --date=short "$@" $GIT log --format='%ad %h %s' --date=short "$@"
} }
l() { log "$@"; }
# * Main # * Main
# NOTE intended to run Commands but will run any function above # NOTE intended to run Commands but will run any function above
if declare -f "$1" > /dev/null; then "$@"; else usage; fi if [[ "$1" == "-h" || "$1" == "--help" || $# == 0 ]]; then usage
elif declare -f "$1" > /dev/null; then "$@"
else
ensure_git
$GIT -C "$DIR" "$@"
fi

122
bin/hledger-jj Executable file
View File

@ -0,0 +1,122 @@
#!/usr/bin/env ysh # -*- sh -*-
# Tested with ysh 0.24
# https://oils.pub/release/latest/doc/ysh-tour.html
# https://oils.pub/release/latest/doc/ref/
# Tested with jj 0.26 with auto-track disabled, ie in ~/.jjconfig.toml:
# [snapshot]
# auto-track = "none()"
const HELP = '''
-------------------------------------------------------------------------------
hledger-jj [COMMAND [OPTS]] - easy version control for hledger journals
An easy CLI for keeping your data in version control, using jj and a git repo.
Works for $LEDGER_FILE and its subfiles only (-f is not yet supported).
A repo will be created if needed, in $LEDGER_FILE's directory.
You can run this tool from any directory. Commands may be abbreviated.
Options are passed to jj; you may need to write -- first.
''' #'
const HELP2 = '''
Examples:
$ hledger jj status
$ hledger jj diff
$ hledger jj commit
$ hledger jj c "new txns"
$ hledger jj log -- -n5
$ hledger-jj l -n5 --stat
'''
# You could install this as more convenient top level hledger commands by
# making hledger-commit, hledger-diff, hledger-status, hledger-log scripts like
#
# #!/bin/sh
# #hledger-commit
# hledger-jj commit "$@"
const S = /%start/
const E = /%end/
# const WS = /%word_start/
# const WE = /%word_end/
const FILE1 = ENV.LEDGER_FILE
const DIR = $(dirname "$FILE1")
const FILES = split( $(hledger -f "$FILE1" files) => replace(/ DIR '/' /, '') )
proc help() {
write -n -- """
$HELP
Commands:
"""
# grep -E '^(proc +)?\w.*\(\) *{ *#+' "$0" | sed -E -e 's/^proc +//' -e 's/\(\) *\{//' -e 's/#+ /\t /'
redir < $0 {
for l in (io.stdin) {
if (l ~ /S ('proc' space+)? <capture w dot* as name> '(' (![')'])* ')' dot* '###' space* <capture dot* as help>/) {
echo "$[_group('name')] $[_group('help')]"
}
}
}
write -n $HELP2
}
proc setup() { # do initial checks/setup
check_jj
ensure_journal_repo
}
proc check_jj() { # check that jj is installed
if ! hash jj 2>/dev/null {
write -n >&2 '''
This command requires jj, but it is not installed in $PATH.
Please install it and try again. https://jj-vcs.github.io
'''
exit 1
}
}
proc ensure_journal_repo() { # ensure that the journal file has a jj/git repo
cd "$DIR" {
if ! jj status >/dev/null 2>&1 {
jj git init --colocate
write "Created new colocated jj/git repo in $DIR"
}
}
}
proc status(...opts) { ### [OPTS] - show status of journal files
cd "$DIR" { jj status --color=always @opts @FILES | grep -vE '^Untracked paths:|\?' }
}
proc diff(...opts) { ### [OPTS] - show unrecorded changes in journal files
cd "$DIR" { jj diff @opts @FILES }
}
proc commit(...opts) { ### [MSG [OPTS]] - record changes to journal files
cd "$DIR" {
jj file track @FILES
var msg=${2:-$(date +'%Y-%m-%d %H:%M')}
# if [ $# -ge 1 ]; then
# shift
# fi
# shift
jj commit -m "$msg" @opts @FILES #"$@"
}
}
proc log(...opts) { ### [OPTS] - list recorded changes to journal files
cd "$DIR" { jj log @opts @FILES }
}
if (len(ARGV) < 1) {
help
} else {
var args = ARGV[1:]
case (ARGV[0]) {
/S ('h'('e'('l'('p')?)?)? | '-h' | '-'? '-help') E/ { help }
/S 's'('t'('a'('t'('u'('s')?)?)?)?)? E/ { setup; status @args }
/S 'd'('i'('f'('f')?)?)? E/ { setup; diff @args }
/S 'c'('o'('m'('m'('i'('t')?)?)?)?)? E/ { setup; commit @args }
/S 'l'('o'('g')?) ?E/ { setup; log @args }
(else) { echo "Unknown command: $[ARGV[0]]"; return 1 }
}
}

268
bin/hledger-move.hs Executable file
View File

@ -0,0 +1,268 @@
#!/usr/bin/env stack
-- stack runghc --verbosity info
-- --package hledger --package string-qq --package text --package time --package microlens
--
-- Using unreleased hledger: from inside the hledger source tree,
--
-- Run interpreted:
-- bin/hledger-move.hs
--
-- Compile:
-- stack ghc -- bin/hledger-move.hs -ihledger-lib -ihledger
-- or use bin/compile.sh
--
-- Debug:
-- stack ghci bin/hledger-move.hs --ghc-options=-'ihledger-lib -ihledger'
--
-- Watch compilation:
-- stack exec ghcid bin/hledger-move.hs -- --command="ghci -ihledger-lib -ihledger"
--
-- There are some tests in hledger/test/_move.test
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
import Control.Monad (when)
import Data.Function (on)
import Data.List (find, groupBy, mapAccumL)
import Data.Maybe (fromMaybe, isNothing)
import Data.String.QQ (s)
import Data.Time (addDays)
import Safe (headDef)
import System.Exit (exitFailure)
import System.IO (hPutStrLn, stderr)
import System.IO.Unsafe (unsafePerformIO)
import Lens.Micro ((^.))
import Text.Printf
import Data.Text qualified as T
import Data.Text.IO qualified as T
import Hledger.Cli.Script
------------------------------------------------------------------------------
cmdmode = hledgerCommandMode
-- Command name and help text goes here. Note blank lines will not be displayed.
[s| hledger-move
Print an entry to move funds between accounts, preserving costs and subaccounts
.
Usage: hledger-move AMT FROMACCT TOACCT
.
This command prints a journal entry which you can add to your journal,
representing a transfer of some amount from a source account (and/or
its subaccounts) to a destination account.
It is mainly intended for moving assets, especially investment assets
with subaccounts representing lots.
.
AMT is a positive hledger amount, including a commodity symbol.
.
FROMACCT is the source account (an account name, or a regular expression
whose alphanumerically first match is the source account).
.
TOACCT is the destination account (or account-matching regexp).
.
This command can also transfer from, and to, child accounts.
It will move amounts first out of FROMACCT if possible,
then as needed out of its subaccounts in alphanumerical order,
until the total requested amount is moved.
Ie, if subaccounts are named by acquisition date (eg ":YYYYMMDD"),
they will be withdrawn in FIFO order.
.
Any subaccounts withdrawn from will be recreated under TOACCT,
unless the --consolidate flag is used. With --consolidate,
all amounts are transferred to TOACCT, discarding lot information.
.
If there is not a sufficient positive balance in FROMACCT and its subaccounts
to supply the requested amount, the command will fail.
.
Examples:
.
$ hledger-move $50 assets:checking assets:cash # withdraw cash from bank
$ hledger-move ADA1000 ada:wallet1 ada:wallet2 # move 1000 ADA, keeping lots
|]
{- NOT YET IMPLEMENTED:
- As a convenience, no symbol means "move the account's only commodity";
this works when the source account contains just one commodity.
$ hledger-move 50 checking cash # the same, less typing
- A zero AMT means "move all of the specified commodity".
$ hledger-move $0 checking cash # move all $ from checking
- The "all" AMT does the same, but for any and all commodities present,
without having to write the commodity symbol(s).
It requires that all of the source account's commodities are positive.
$ hledger-move all savings checking # move all from savings
$ hledger-move all assets:broker1:FOO assets:broker2:FOO # move all FOO lots to broker2
- It is aware of account balances, and prevents overdraft or overpay:
it will fail if the requested transfer would change
the source account's balance from positive to negative (as when overdrawing an asset)
or the destination account's balance from negative to positive (as when over-paying a liability).
You can disable this validation by adding the --force flag.
- balance assertions
- respecting end date, for calculating balances and generated txn date
-}
------------------------------------------------------------------------------
[flagNone ["consolidate"] (setboolopt "consolidate") "don't recreate subaccounts"
-- ,flagNone ["force"] (setboolopt "force") "don't prevent overdraw/overpay"
]
[generalflagsgroup1]
[]
([arg "AMT"
,arg "FROMACCT"
,arg "TOACCT"
],
Nothing
)
where
arg name = flagArg (\val rawopts -> Right $ setopt name val rawopts) name
------------------------------------------------------------------------------
main :: IO ()
main = do
copts@CliOpts{rawopts_=rawopts, reportspec_=rspec0} <- getHledgerCliOpts cmdmode
withJournal copts $ \j -> do
-- d <- getCurrentDay
let
-- arg errors
-- clunky
shortusage = "Usage: hledger-move AMT FROMACCT TOACCT"
longusage = unlines
[ shortusage
, "AMT the total amount to move, as a hledger amount with commodity symbol"
, "FROMACCT the main account to move it from; subaccounts can also be drained"
, "TOACCT the main account to move it to; subaccounts can be recreated here"
]
-- No args should show usage, not "Error:" (but I guess still needs a failure exit code)
exitUsage = unsafePerformIO $ hPutStrLn stderr longusage >> exitFailure
mamtarg = maybestringopt "AMT" rawopts
mfromacctarg = maybestringopt "FROMACCT" rawopts
mtoacctarg = maybestringopt "TOACCT" rawopts
noargs = all isNothing [mamtarg, mfromacctarg, mtoacctarg]
amtarg = fromMaybe (error' $ "Please specify the amount to move as first argument.\n"++shortusage) mamtarg -- won't happen
fromacctarg = fromMaybe (error' $ "Please specify a source account name or pattern as second argument.\n"++shortusage) mfromacctarg
toacctarg = fromMaybe (error' $ "Please specify a destination account name or pattern as third argument.\n"++shortusage) mtoacctarg
consolidate = boolopt "consolidate" rawopts
force = boolopt "force" rawopts
-- parse the AMT arg as a cost-less Amount (any provided cost is ignored)
eamt = styleAmounts (journalCommodityStyles j) . amountStripCost <$> parseamount amtarg
amt = case eamt of
Left err ->
error' $ "could not parse " ++ show amtarg ++ " as a hledger amount\n" ++ customErrorBundlePretty err ++ "\n" ++shortusage
Right a | isNegativeAmount a ->
error' $ amtarg ++ " is negative, please specify a positive amount to move.\n"++shortusage
Right a -> a
comm = acommodity amt
-- when comparing with zero, it needs to have the same commodity
zero = amt{aquantity=0}
accts = journalAccountNamesDeclaredOrImplied j
fromacct = amt `seq` fromMaybe (error' $ fromacctarg ++ " did not match any account.") $ firstMatch (T.pack fromacctarg) accts
fromacctlen = length $ accountNameComponents fromacct
toacct = fromacct `seq` fromMaybe (error' $ toacctarg ++ " did not match any account.") $ firstMatch (T.pack toacctarg) accts
-- get account names and balances of fromacct and any subs, ordered by name
ropts = (_rsReportOpts rspec0){balanceaccum_=Historical, accountlistmode_=ALFlat}
rspec =
setDefaultConversionOp NoConversionOp -- ?
rspec0{
_rsReportOpts = ropts
,_rsQuery = Acct $ accountNameToAccountRegex $ fromacct
}
acctbals = fst $ balanceReport rspec j
availablebal =
headDef zero $ amounts $
filterMixedAmountByCommodity comm $
mixedAmountStripCosts $ sum $ map fourth4 acctbals
-- Take just enough of these account balances, in the order given,
-- to cover the requested AMT. Or if there is not enough, take what is there.
-- AMT is a single-commodity, cost-less amount.
-- Account balances can be multi-commodity, but only AMT's commodity will be moved.
-- An account balance could also possibly have multiple costs in that commodity;
-- in that case we raise an error, for now. (Could take amounts in order of cost's
-- commodity and amount).
(unmoved, moveamts) = go (dbgamt "requested amt to move" amt) [] acctbals
where
dbgamt lbl = id -- dbg0With (((lbl++": ")++).showAmount)
dbgmamt lbl = id -- dbg0With (((lbl++": ")++).showMixedAmountOneLine)
go :: Amount -> [(AccountName, MixedAmount)] -> [BalanceReportItem] -> (Amount, [(AccountName, MixedAmount)])
go stilltomove balscollected [] = (stilltomove, reverse balscollected)
go stilltomove balscollected ((acct,_,_,bal):rest)
| stilltomovenext > zero = go stilltomovenext ((acct,balincomm) : balscollected) rest
| otherwise =
let
-- the final balance portion to move
finalamt = dbgamt "final amt to move" $
(balincommsinglecost + stilltomovenext)
{acost=acost balincommsinglecost} -- + discards cost, need to restore it
in (0, reverse $ (acct, mixed [finalamt]) : balscollected)
where
-- how much of the requested commodity is in this account
comm = acommodity stilltomove
balincomm = filterMixedAmountByCommodity comm bal
-- for now, ensure there is at most one cost basis (and convert to Amount)
balincommsinglecost =
case amounts $ balincomm of
[b] -> dbgamt ("acct balance in "++show comm) b
_ -> error' $ "sorry, we can't yet move funds out of a multi-cost balance ("
++ showMixedAmountOneLine balincomm ++ ")"
-- subtract this from the amount remaining to move (ignoring cost)
stilltomovenext = dbgamt "remaining amt to move" $
stilltomove - amountStripCost balincommsinglecost
-- since balance assertion amounts are required to be exact, the
-- amounts in opening/closing transactions should be too (#941, #1137)
-- amountSetFullPrecision
fromps = [
posting{paccount = a
,pamount = mixedAmount $ negate b
-- ,pbalanceassertion = Just nullassertion{baamount=precise b{aquantity=0, acost=Nothing}}
}
| -- get the balances for each commodity and transaction price
(a,mixedb) <- moveamts
, let bs0 = amounts mixedb
-- mark the last balance in each commodity with True
, let bs2 = concat [reverse $ zip (reverse bs1) (True : repeat False)
| bs1 <- groupBy ((==) `on` acommodity) bs0]
, (b, islast) <- bs2
]
tops = if consolidate
then [
posting{paccount = toacct, pamount = mixed [amt]}
]
else [
posting{paccount = a', pamount = negate b}
| Posting{paccount=a, pamount=b} <- fromps
, let subacctcomps = drop fromacctlen $ accountNameComponents a
, let a' = accountNameFromComponents $ toacctcomps ++ subacctcomps
]
where
toacctcomps = accountNameComponents toacct
if
| noargs -> exitUsage
| unmoved > zero -> error' $
"could not move " ++ showAmount amt ++ ", only " ++ showAmount availablebal ++ " is available in commodity " ++ show comm
| otherwise ->
T.putStr $ showTransaction $ nulltransaction{
tdate = _rsDay rspec
,tdescription = ""
,tpostings = fromps ++ tops
}
firstMatch :: T.Text -> [T.Text] -> Maybe T.Text
firstMatch pat vals =
let re = toRegexCI' pat
in find (regexMatchText re) vals

5
bin/hledger-pricehist Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
# A hledger-* alias for pricehist to show it in hledger's commands list.
# https://pypi.org/project/pricehist
pricehist "$@"

View File

@ -1,50 +0,0 @@
#!/usr/bin/env stack
-- stack runghc --verbosity info --package hledger --package string-qq
-- Run from inside the hledger source tree, or compile with compile.sh.
-- See hledger-check-fancyassertions.hs.
{-
Quick script that adds file/line number tags to print output.
cf https://www.reddit.com/r/plaintextaccounting/comments/ddzn8o/finding_corresponding_journal_files_from_hledger/
$ hledger print-location -f examples/sample.journal desc:eat
2008/06/03 * eat & shop
; location: /Users/simon/src/hledger/examples/sample.journal:30
expenses:food $1
expenses:supplies $1
assets:cash
-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
import Data.String.QQ (s)
import qualified Data.Text as T
import Hledger.Cli
------------------------------------------------------------------------------
cmdmode = hledgerCommandMode
[s| print-location
Like print, but adds tags showing the file path and location of transactions.
_FLAGS
|]
[]
[generalflagsgroup1]
[]
([], Just $ argsFlag "[QUERY]")
------------------------------------------------------------------------------
main :: IO ()
main = do
opts <- getHledgerCliOpts cmdmode
withJournalDo opts $ \j ->
print' opts j{jtxns = map addLocationTag $ jtxns j}
addLocationTag :: Transaction -> Transaction
addLocationTag t = t{tcomment = tcomment t `commentAddTagNextLine` loctag}
where
loctag = ("location", T.pack . sourcePosPairPretty $ tsourcepos t)
-- Like showSourcePosPair in Hledger.Data.Transaction, but show just the starting line number.
showSourcePosPairLine :: (SourcePos, SourcePos) -> String
showSourcePosPairLine (SourcePos f line _, _) = f ++ ":" ++ show line

56
bin/hledger-register-max.hs Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env stack
-- stack runghc
-- (requires hledger > 1.34)
-- -- stack script --compile --resolver nightly-2025-09-30 --verbosity error --package hledger-lib --package hledger --package text --package safe
-- hledger-register-max - runs "hledger register" and prints the posting with largest running total/balance.
-- Usage:
-- hledger-register-max [REGISTERARGS]
-- hledger register-max -- [REGISTERARGS]
-- For historical balances, add -H. To see the smallest, add --invert. For value, add -V --infer-market-prices, etc.
-- Examples:
-- $ hledger-register-max -f examples/bcexample.hledger -H checking
-- 2013-01-03 Hoogle | Payroll Assets:US:BofA:Checking 1350.60 USD 8799.22 USD
-- $ hledger register-max -- -f examples/bcexample.hledger income --invert
-- 2014-10-09 Hoogle | Payroll Income:US:Hoogle:Vacation 4.62 VACHR 52000.00 IRAUSD, 365071.44 USD, 337.26 VACHR
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
import Control.Monad
import Data.List
import Data.Maybe
import Data.Ord
import qualified "text" Data.Text as T
import Data.Text.IO qualified as T
import Safe
import System.Environment
import Hledger.Cli.Script
-- XXX needs --help, see hledger-addon-example.hs
main = do
args <- getArgs
opts <- argsToCliOpts ("register" : args) []
withJournal opts $ \j -> do
let
r = postingsReport (reportspec_ opts) j
getamt = pamount.fourth5
maxbal = getamt $ maximumBy (comparing getamt) r
is = filter ((== maxbal).getamt) r
mapM_ printItem is
printItem (_, _, _, p, bal) = do
let
d = postingDate p
mt = ptransaction p
desc = fmt 30 $ maybe "-" tdescription mt
acct = fmt 30 $ paccount p
amt = fmta 12 $ T.pack $ showMixedAmountOneLine $ pamount p
baltxt = fmta 12 $ T.pack $ showMixedAmountOneLine bal
T.putStrLn $ T.unwords [showDate d, desc, "", acct, "", amt, " ", baltxt]
where
fmt w = formatText True (Just w) (Just w) . textElideRight w
fmta w = formatText False (Just w) Nothing

52
bin/hledger-register-max2.hs Executable file
View File

@ -0,0 +1,52 @@
#!/usr/bin/env stack
-- stack runghc --verbosity error --package hledger
-- stack runghc --verbosity error --package hledger --package hledger-lib --package text --package safe
-- stack script --compile --resolver nightly-2025-09-30 --verbosity error --package hledger --package text
-- stack script --compile --resolver nightly-2025-09-30 --verbosity error --package hledger --package hledger-lib --package text --package safe
-- The topmost stack command above is used to run this script.
-- stack script uses released hledger, stack runghc uses local hledger source.
-- This script currently requires local hledger source, for Hledger.Cli.Script.
------------------------------------78----------------------------------------
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
import Hledger.Cli.Script
import qualified "text" Data.Text as T
import qualified "text" Data.Text.IO as T
cmdmode = hledgerCommandMode (unlines
-- Command name, then --help text. Note, empty help lines get stripped.
["register-match"
,"Show the register item(s) with maximum (or with --invert, minimum) balance."
,"Usage: hledger-register-max [REGISTERARGS]"
,"or: hledger register-max -- [REGISTERARGS]"
,"For historical balances, add -H. For value, add -V --infer-market-prices."
,"Examples:"
,"$ hledger-register-max -f examples/bcexample.hledger -H checking"
,"2013-01-03 Payroll Assets:US:BofA:Checking 1350.60 USD 8799.22 USD"
------------------------------------78----------------------------------------
])
[] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]") -- or Nothing
main = do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode
withJournal opts $ \j -> do
let
r = postingsReport rspec j
maxbal = fifth5 $ maximumBy (comparing fifth5) r
is = filter ((== maxbal).fifth5) r
mapM_ printItem is
printItem (_, _, _, p, bal) = do
let
d = postingDate p
mt = ptransaction p
desc = fmt 30 $ maybe "-" tdescription mt
acct = fmt 30 $ paccount p
amt = fmta 12 $ T.pack $ showMixedAmountOneLine $ pamount p
baltxt = fmta 12 $ T.pack $ showMixedAmountOneLine bal
T.putStrLn $ T.unwords [showDate d, desc, "", acct, "", amt, " ", baltxt]
where
fmt w = formatText True (Just w) (Just w) . textElideRight w
fmta w = formatText False (Just w) Nothing

62
bin/hledger-report1.hs Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env stack
-- stack runghc --verbosity error --package hledger --package hledger-lib --package text --package safe
-- (use the local hledger source)
-- -- stack script --compile --resolver nightly-2025-09-30 --verbosity info --package hledger --package text
-- -- (use a released hledger from stackage)
-- A custom compound report - like incomestatement but with different,
-- customisable subheadings/subreports. More verbose and haskelly than
-- hledger-report1.sh but also more robust and powerful.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
import Hledger.Cli.Script
import qualified "text" Data.Text as T
import qualified "text" Data.Text.IO as T
cmdmode = hledgerCommandMode (unlines
["report1"
,"A custom compound report - like the incomestatement command but easier to customise."
,"Usage: hledger-report1 [OPTS] [ARGS]"
,"or: hledger report1 -- [OPTS] [ARGS]"
]) [] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]")
main = do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode
withJournal opts $ flip compoundBalanceCommand opts $
-- see https://hackage.haskell.org/package/hledger/docs/Hledger-Cli-CompoundBalanceCommand.html
-- and https://hackage.haskell.org/package/hledger-lib-1.31/docs/Hledger-Query.html
CompoundBalanceCommandSpec {
cbcdoc = "report1 help text",
cbctitle = "Report1 Statement",
cbcaccum = PerPeriod,
cbcqueries = [
CBCSubreportSpec{
cbcsubreporttitle="Revenues"
,cbcsubreportquery=Type [Revenue]
,cbcsubreportoptions=(\ropts -> ropts{normalbalance_=Just NormallyNegative})
,cbcsubreporttransform=fmap maNegate
,cbcsubreportincreasestotal=True
}
,CBCSubreportSpec{
cbcsubreporttitle="Operating Expenses"
,cbcsubreportquery=And [Type [Expense], Acct $ toRegex' "Operating"]
,cbcsubreportoptions=(\ropts -> ropts{normalbalance_=Just NormallyPositive})
,cbcsubreporttransform=id
,cbcsubreportincreasestotal=False
}
,CBCSubreportSpec{
cbcsubreporttitle="Other Expenses"
,cbcsubreportquery=And [Type [Expense], Not $ Acct $ toRegex' "Operating"]
,cbcsubreportoptions=(\ropts -> ropts{normalbalance_=Just NormallyPositive})
,cbcsubreporttransform=id
,cbcsubreportincreasestotal=False
}
]
}

18
bin/hledger-report1.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# A custom compound report - like incomestatement but with different
# subheadings/subreports. A bit hacky but quick and short.
# See also hledger-report1.hs.
echo "Report1 Statement $(date +%Y-%m-%d)"
printf "\nRevenues\n"
hledger bal expr:"type:r and $@" | tail +2
printf "\nOperating Expenses\n"
hledger bal expr:"type:x and operating and $@" | tail +2
printf "\nOther expenses\n"
hledger bal expr:"type:x and not:operating and $@" | tail +2
printf "\nGrand Total\n"
hledger bal expr:"type:rx and $@" | tail -1

View File

@ -0,0 +1,33 @@
#!/usr/bin/env stack
-- stack runghc --package hledger
{-
script-example - my new script
-}
{-# LANGUAGE OverloadedStrings #-}
import Hledger.Cli.Script
import Data.Text qualified as T
import Data.Text.IO qualified as T
cmdmode = hledgerCommandMode (unlines
---------------------------standard terminal width-----------------------------
["script-example"
,"Usage: hledger-script-example [OPTS] [ARGS]"
,"or: hledger script-example -- [OPTS] [ARGS]"
,"Examples:"
,"$ hledger-script-example # do the thing"
,"$ hledger-script-example --help # print help"
])
[] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]")
main = do
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode
withJournal opts $ \j -> do
putStrLn "hello"

131
bin/hledger-script-example.hs Executable file
View File

@ -0,0 +1,131 @@
#!/usr/bin/env stack
-- stack runghc --package hledger
-------------------------------------------------------------------------------
-- About this script. You can remove this text. See also hledger-script-example-short.hs.
--
-- This is an example of a hledger addon command (an executable named hledger-*),
-- implemented as a haskell script which can use hledger's API.
-- Save it as a different name, give it execute permission, and customise it.
--
-- This script is run by stack. You can use any of the commands below:
--
-- The `stack runghc` command runs within a hledger source tree, using that local hledger version.
-- It installs haskell packages and GHC if needed, from the stackage snapshot configured in the stack.yaml file.
-- stack runghc --package hledger
--
-- The `stack script` command installs known hledger, haskell package and GHC versions from a specified stackage snapshot.
-- This is the most robust setup. --verbosity=info shows install progress. --compile makes a standalone binary.
-- stack script --snapshot lts-23.0 --verbosity=error --package hledger
-- stack script --snapshot nightly-2024-12-16 --compile --verbosity=error --package hledger
--
-- Or the script can be run by cabal, which installs packages if needed (but not GHC).
-- #!/usr/bin/env cabal
-- {- cabal:
-- build-depends: base, directory, text, hledger
-- -}
--
-- If compiled to a binary, the script will run without stack or cabal or haskell packages.
-- (It will still require certain C libraries.)
-------------------------------------------------------------------------------
{-
script-example - my new script
-}
-- Haskell language customisations. OverloadedStrings is a useful one.
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/intro.html
{-# LANGUAGE OverloadedStrings #-}
-- Import things from haskell packages - the ones specified above, or included with the GHC specified above,
-- eg https://downloads.haskell.org/ghc/latest/docs/users_guide/9.10.1-notes.html#included-libraries
-- This provides most of hledger's API that's useful for scripts.
import Hledger.Cli.Script
-- Haskell has a built-in String type; hledger also uses the more efficient Text type.
import Data.Text qualified as T
import Data.Text.IO qualified as T
-- If you use hledgerCommandMode, and getHledgerCliOpts below, your script will
-- support -h/--help, -f/--file and other common hledger options.
cmdmode = hledgerCommandMode (unlines
---------------------------standard terminal width-----------------------------
-- command name on first line:
["script-example"
-- then --help text:
,"Usage: hledger-script-example [OPTS] [ARGS]"
,"or: hledger script-example -- [OPTS] [ARGS]"
,"Examples:"
,"$ hledger-script-example # do the thing"
,"$ hledger-script-example --help # print help"
])
-- you can add or change options here (see CliOptions.hs); usually not needed
[] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]")
-- Most scripts have three steps:
main = do
-- 1. process command line options/arguments
opts@CliOpts{reportspec_=rspec} <- getHledgerCliOpts cmdmode
-- 2. read the journal file
withJournal opts $ \j -> do
-- 3. do something with it.
putStrLn $ (show $ length $ jtxns j) <> " transactions in " <> (show $ journalFilePath j)
-------------------------------------------------------------------------------
{-
Script code examples. You can remove this text.
See also: bin/*.hs
Show a count of transactions, possibly filtered by a query:
d <- getCurrentDay
let
q = _rsQuery rspec
ts = filter (q `matchesTransaction`) $ jtxns $ journalApplyValuationFromOpts rspec j
printf "File %s: %d transactions\n" (journalFilePath j) (length ts)
Run a postings report (like hledger register) and print the posting(s) with highest amount
(like hledger-register-max.hs):
let
postingReportItems = postingsReport rspec j
maxbal = fifth5 $ maximumBy (comparing fifth5) r
is = filter ((== maxbal).fifth5) r
mapM_ printItem is
printItem (_, _, _, p, bal) = do
let
d = postingDate p
mt = ptransaction p
desc = fmt 30 $ maybe "-" tdescription mt
acct = fmt 30 $ paccount p
amt = fmta 12 $ T.pack $ showMixedAmountOneLine $ pamount p
baltxt = fmta 12 $ T.pack $ showMixedAmountOneLine bal
T.putStrLn $ T.unwords [showDate d, desc, "", acct, "", amt, " ", baltxt]
where
fmt w = formatText True (Just w) (Just w) . textElideRight w
fmta w = formatText False (Just w) Nothing
Use the [s|...|] multiline string syntax (requires --package string-qq and {-# LANGUAGE QuasiQuotes #-}):
cmdmode = hledgerCommandMode (unlines
-- Command name, then --help text. Note, empty help lines get stripped.
[s| script-example
This is an example of a (hledger-lib-using) hledger script."
Usage: hledger-script-example [OPTS] [ARGS]"
or: hledger script-example -- [OPTS] [ARGS]"
Save it under another name and customise it."
The hledger- name makes it appear in hledger's commands list."
Examples:"
$ hledger-script-example --help"
(this help)"
|]
------------------------------------78----------------------------------------
[] [generalflagsgroup1] [] ([], Just $ argsFlag "[ARGS]") -- or Nothing
-}

View File

@ -3,8 +3,10 @@
# total of `hledger balance`, optionally with arguments, as a single # total of `hledger balance`, optionally with arguments, as a single
# machine-readable number. Requires hledger 1.24 or newer. # machine-readable number. Requires hledger 1.24 or newer.
set -o pipefail
VALUATION_COMMODITY="$" VALUATION_COMMODITY="$"
hledger bal -0 -N -X "$VALUATION_COMMODITY" --infer-market-prices -c "$VALUATION_COMMODITY 1000" --layout=bare "$@" | awk '{print $1}' hledger -n bal -0 -N -X "${VALUATION_COMMODITY}" --infer-market-prices -c "${VALUATION_COMMODITY} 1000" --layout=bare "$@" | awk '{print $1}'
# Tired of complex financial reports ? This is a silly but fun and # Tired of complex financial reports ? This is a silly but fun and
# occasionally useful script showing how to get "one number" semi-robustly # occasionally useful script showing how to get "one number" semi-robustly

View File

@ -20,11 +20,11 @@
import Data.List import Data.List
import Data.Maybe import Data.Maybe
import Data.String.QQ (s) import Data.String.QQ (s)
import qualified Data.Text as T import Data.Text qualified as T
import Data.Time.Calendar import Data.Time.Calendar
import Safe import Safe
-- import Hledger -- import Hledger
import Hledger.Cli import Hledger.Cli.Script
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
cmdmode = hledgerCommandMode cmdmode = hledgerCommandMode
@ -43,8 +43,6 @@ It can differ from the others.
Useful for preprocessing a journal to smooth out irregular revenues or Useful for preprocessing a journal to smooth out irregular revenues or
expenses in daily/weekly/monthly reports, eg: expenses in daily/weekly/monthly reports, eg:
hledger smooth revenues:consulting | hledger -f- incomestatement -W hledger smooth revenues:consulting | hledger -f- incomestatement -W
_FLAGS
|] |]
[] []
[generalflagsgroup1] [generalflagsgroup1]
@ -65,7 +63,7 @@ main = do
-- Don't let our ACCT argument be interpreted as a query by print -- Don't let our ACCT argument be interpreted as a query by print
,reportspec_ = rspec{_rsReportOpts=ropts{querystring_=[]}} ,reportspec_ = rspec{_rsReportOpts=ropts{querystring_=[]}}
} }
withJournalDo copts' $ \j -> do withJournal copts' $ \j -> do
today <- getCurrentDay today <- getCurrentDay
let let
menddate = reportPeriodLastDay rspec menddate = reportPeriodLastDay rspec

Some files were not shown because too many files have changed in this diff Show More