aliases from included files are not applied in including files #1007
I'm playing with account hierarchy to learn accounting, and I noticed that aliases defined in a ledger file included in a global file are not applied to the global file. I'm using the following file structure:
I'm using this hierarchy because when running hledger-web or hledger-ui from the main files, new transactions made from the UI are appended to the main file. However, I want the account hierarchy to be separate, simply because I might modify it while I'm using hledger-web or ui at the same time.
When I declare aliases in
The fact that aliases are not propagated to including files is not in the documentation.
Perhaps the documentation should be updated, and perhaps aliases should be allowed to span to including files. having them restricted to the files they are in is also understandable, but perhaps use case around this should be discussed more.
'Tis mentioned a bit, at https://hledger.org/manual.html#basic-aliases, and particularly at https://hledger.org/manual.html#directives - see the notes there. Basically
I see how this can be surprising/unsatisfying. I often find it annoying myself. Why does it work this way? It's to preserve these properties, which I think are worthwhile:
As a practical matter for right now,
Aliases actually propagated to included files. Since migration to hledger I changed my layout to something like:
Though it is only chain and I cannot have anymore currencies/accounts/aliases split in different files it works for me.
I guess this is come-back of #510 . Maybe it worth to consider