objectionary / eo-phi-normalizer

Command Line Normalizer and Rewriter of đťś‘-calculus Expressions (part of EOLANG family)
https://www.objectionary.com/eo-phi-normalizer/
MIT License
7 stars 2 forks source link

target directory is not auto-created #497

Closed yegor256 closed 1 week ago

yegor256 commented 2 weeks ago

I'm doing this:

normalizer transform --rules /hone/simple.yml /target/generated-sources/phi/org/eolang/hone/package-info.phi --single -o /target/generated-sources/phi-optimized/org/eolang/hone/package-info.phi

The directory /target/generated-sources/phi-optimized/org/eolang/hone/ is absent, but /target/generated-sources is present. I'm getting:

normalizer: /target/generated-sources/phi-optimized/org/eolang/hone/package-info.phi: openFile: does not exist (No such file or directory)

Would be much better if Normalizer would create the target directory automatically.

yegor256 commented 2 weeks ago

@deemp please, take a look

yegor256 commented 2 weeks ago

@deemp we will appreciate if you resolve it ASAP, it's blocking us

deemp commented 2 weeks ago

@yegor256, As a quick fix, I suggest using the mkdir command before calling normalizer.

I will add support for directory creation and will release the new version of normalizer today.

deemp commented 2 weeks ago

@yegor256, I thought a bit more on the issue.

I think creating missing directories by default is not a good option because:

I can add the -p or --create-parent-directories flag to the transform command. When the flag is enabled, normalizer will create the missing directories.

@yegor256, do you need such a flag?

yegor256 commented 2 weeks ago

@deemp sounds like a good plan, let's add a flag. Even though, keep in mind, that for example javac compiler doesn't need a flag for that: it creates directories by default.

deemp commented 2 weeks ago

@yegor256, what is the reasoning behind this decision in the javac compiler?

Even though, keep in mind, that for example javac compiler doesn't need a flag for that: it creates directories by default.

deemp commented 2 weeks ago

@yegor256, I misunderstood your original request. I see that normalizer throws an error because there are no parent directories for the output file. I agree that the normalizer should create such directories without a flag.

0crat commented 2 weeks ago

@yegor256 Thank you for your submission! Unfortunately, it wasn't accepted by the team this time. As per our policy, this results in a -16 point deduction. Your current balance is -30. Don't be discouraged—your efforts to report bugs are valuable for improving our project quality. Please continue to submit issues, but try to be more precise next time. Your contributions are appreciated!

deemp commented 1 week ago