Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've tried to implement, for the CLI, the possibility to give a config file containing an existing set of options as discussed in #411 . It tries to read and parse the file, using yaml structure, then transforms it into a CLI-like list of arguments, which are then reevaluated. Then, it adds it to the arguments, and if there is a collision, it takes the actual arguments passed to the CLI.
The parsing is done in
src/cli/configToOptions.ts, and the CLI now calls the added function insrc/cli/argsToOptions.ts; the split was done to keep the sync behaviour of the original function, so that all previous tests should pass as usual. I've also added a test file which should cover all the cases I could think of, and that maybe better explains the intended behaviour.As for now, I've not added this behaviour with the api, nor added the possiblity to export from the web interface a config file, although I would be happy to try to implement this if this could be a nice add. Nested config files (i.e., one config file with an option to read another) are not evaluated.
Let me know if this PR suits the project, or if there are some edge cases that I forgot to consider !