Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse all ledger errors / warnings #1

Open
purcell opened this issue Dec 8, 2013 · 7 comments
Open

Parse all ledger errors / warnings #1

purcell opened this issue Dec 8, 2013 · 7 comments

Comments

@purcell
Copy link
Owner

purcell commented Dec 8, 2013

This initial version of flycheck-ledger was mainly developed in order to display errors for unbalanced transactions, e.g.

In file included from "master.ledger", line 8:
While parsing file "bank.ledger", line 13:
While balancing transaction from "bank.ledger", lines 11-13:
> 2012/06/01 Bank charges
>     Personal:Expenses:Bank:Fees                 3.23 EUR
>     Personal:Assets:Bank                       = 8.51 EUR
Unbalanced remainder is:
           -3.04 EUR
Amount to balance against:
            3.23 EUR
Error: Transaction does not balance

However, other ledger error messages are laid out differently, e.g.

In file included from "master.ledger", line 8:
While parsing file "bank.ledger", line 8:
While parsing posting:
  Personal:Expenses:Bank:Fees    ASLKJDSFLKDSJ
                                 ^^^^^^^^^^^^^
Error: No quantity specified for amount

I'd love to get feedback from @jwiegley on whether it might make sense to review ledger's error/warning output with a view to making it consistent and easily machine-readable. Or perhaps there's already such a solution available.

@purcell
Copy link
Owner Author

purcell commented Dec 8, 2013

Also, there are no column numbers printed by ledger, but the info is clearly available, as the second example above shows. Perhaps we can get that printed out too?

@jwiegley
Copy link

jwiegley commented Dec 8, 2013

Ledger's output right now is a kind of "stack", which you're right, does not indicate columnar information since that info is implicit in the layout. We could perhaps add a "--machine-readable" option or something, which would output error messages intended for programmatic consumption?

@purcell
Copy link
Owner Author

purcell commented Dec 8, 2013

Yeah, that'd be nice if it's easy to do, but I wouldn't want you to add any extra complexity on my account.

It's really satisfying to get this feedback inline in the buffer, and perhaps supporting machine-readable output directly would lead to better tools...

Please let me know if you give flycheck-ledger a spin and have any suggestions. :-)

Oh, and thanks for ledger. It made last week as enjoyable for me as a week of accounting could ever be.

@jwiegley
Copy link

jwiegley commented Dec 9, 2013

That's awesome that you're doing this, @purcell, I really appreciate it. :) I will definitely get flycheck-ledger a spin!

@purcell
Copy link
Owner Author

purcell commented Dec 9, 2013

I haven't looked in the ledger repo, but perhaps it has some files with example errors?

@jwiegley
Copy link

jwiegley commented Dec 9, 2013

There are a few expected-failing cases in the regression test directory, but they aren't just pure input files.

@cpitclaudel
Copy link
Contributor

This would be really great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants