Closed simonmichael closed 1 year ago
Some discussion/proposals for different scoping of account aliases: https://www.reddit.com/r/plaintextaccounting/comments/n53ehk/getting_hledger_to_apply_aliases_globally_not/
These issues were documented at https://hledger.org/hledger.html#directives.
Here are some confusing issues about how directives work, that need better functionality and/or docs:
1. the scope of effect of directives
Some affect a region between begin end directives. Some affect to the end of the current file. Some affect the whole current file. Maybe some affect all files ? This should be made clear for each one.
2. how directives interact with multiple files
Some (most ?) directives affect the file they are in (or the part of it after the directive), and any files included from that region, but they don't affect other sibling files or including parent files. So currently in a command like:
market prices, commodity directives etc. in file A won't affect journal entries in file B. To get directives in one to affect the other, you have to inline or include A in B, or vice versa. This was a design choice for simplicity and more predictable results, on the basis that otherwise it's too easy to quietly alter reports, annoyingly break assertions etc. by reordering file arguments or moving include directives. But it's unintuitive.
~3. position of this commodity directive has a surprising effect~
seems fixed
The following three examples are all parsed differently. (Maybe specific to space digit group separators and #749.)
No commodity directive:
output:
Commodity directive at top:
output:
Commodity directive at bottom:
output: