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

Checking for rules file after preprocessing? #124

Open
a-t-0 opened this issue Nov 23, 2024 · 1 comment
Open

Checking for rules file after preprocessing? #124

a-t-0 opened this issue Nov 23, 2024 · 1 comment

Comments

@a-t-0
Copy link

a-t-0 commented Nov 23, 2024

Thank you for sharing this work with the world!
Is your feature request related to a problem? Please describe.
While using a small bunch of python code to perform my preprocessing, I auto-generate the rules file from that preprocessing logic. However, in the first run, if I delete the old .rules file, hledger-flow, rightfully indicates the .rules file is missing (because it is not created yet).

Version and Runtime Information

Please mention the version number of hledger-flow you are using:

hledger-flow --version
hledger-flow 0.15.0 linux x86_64 ghc 9.0 2b025fee477538a493cb7b5eaf163fd959aaec42

Is this the latest version?

yes.

If your request includes commands you ran and the output, please also include
the runtime options with --show-options e.g:

clear && hledger-flow import

Can you give examples of what you would like by running hledger-flow on these files?

Describe the solution you'd like
0 .I would like hledger to first run the preprocessing and then, when it needs to apply the rules, check if the rules exist.

  1. Or, if you deliberately prefer fail-fast/early etc. Perhaps an additional argument like --create-rules that triggers the create_rules script to be ran.
  2. Or, an override argument like --preprocess-first that ensures the preprocessing script to be ran before checking if the rules exist.

Describe alternatives you've considered
0. Running the hledger-flow command twice. However, I think it is an important characteristic of hledger-flow that running the same thing yields the same output.

  1. Running a separate create_rules script/command. However, why do more manual work than necessary.

Nogmaals dank voor de effort die je geleverd hebt om hledger-flow te maken!

@a-t-0
Copy link
Author

a-t-0 commented Nov 25, 2024

My apologies, after trying to create a pull request with the requested feature, I saw in the code that you included a construct script. After migrating my "create rules" script into that script, the import worked flawlessly. Then I saw your construct script description is included in your README.md

-------- Edit----------
I read the construct script is assumed to convert the 2-preprocessed files into 3-journal files itself, however I would like to use your software for this. Hence I created a pull request that: allows calling a createRules script that creates the .rules file for the bank.

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

1 participant