Commit Graph

11688 Commits

Author SHA1 Message Date
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