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

directives from included files have are ignored #2191

Closed
redneb opened this issue Mar 31, 2024 · 4 comments
Closed

directives from included files have are ignored #2191

redneb opened this issue Mar 31, 2024 · 4 comments

Comments

@redneb
Copy link

redneb commented Mar 31, 2024

This is a relatively minor issue, but hledger seems to ignore some (all?) directives that are included from some other file.

Here's a minimal example. Create the following 2 files:

; file1.journal
D 1,000.00 USD

and

; file2.journal
include file1.journal
2024-03-31 Test
	expense:test              1234.5
	asset:bank

If you do an hledger print on this file you'll get the following output:

$ hledger -f file2.journal print
2024-03-31 Test
    expense:test          1234.5
    asset:bank

I would have expected the output to look like this:

2024-03-31 Test
    expense:test    1,234.50 USD
    asset:bank

I am trying this with:

$ hledger --version
hledger 1.32.3, linux-x86_64
@simonmichael
Copy link
Owner

simonmichael commented Apr 1, 2024 via email

@simonmichael
Copy link
Owner

To be precise: at https://hledger.org/1.32/hledger.html#directive-effects, D's "Sets a default commodity" effect has "Y" for "ends at file end?". But at https://hledger.org/1.32/hledger.html#d-directive, "This effect lasts until ... end of the journal" seems ambiguous, I'll change it to "end of the file".

@redneb
Copy link
Author

redneb commented Apr 1, 2024

Ah, it seems my meticulous document-reading skills took a day off just when I needed them the most! Apologies for the spam!

To be precise: at https://hledger.org/1.32/hledger.html#directive-effects, D's "Sets a default commodity" effect has "Y" for "ends at file end?". But at https://hledger.org/1.32/hledger.html#d-directive, "This effect lasts until ... end of the journal" seems ambiguous, I'll change it to "end of the file".

I concur with the suggested change, thanks!

@redneb redneb closed this as completed Apr 1, 2024
@simonmichael
Copy link
Owner

No problem.. there are are a lot of docs. Thanks for the report.

simonmichael added a commit that referenced this issue Apr 4, 2024
simonmichael added a commit that referenced this issue Apr 4, 2024
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

2 participants