-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/generate defaults #81
Feature/generate defaults #81
Conversation
For writing defaults a new function will be created and to keep the purpose clear "write" was renamed to "write_doc".
We need to check for None. A default value could for example be the number 0. With just "if value" this would not pass and not write the default.
Not sorting should be a saner default. That way the defaults will be in the order as they are specified in the argument_specs.
This addresses yaml/pyyaml#234. PyYAML is currently ignoring the indent for lists when dumping. Since ansible-lint expects the indent, this is problematic.
Thanks for your work! I took your comments from issue #77 and discuss them here:
When there are no How about we add the description as comments atop the variables? There are some
|
Thanks for the hint! I completely missed the pre-commit config.
I like the idea. It makes the defaults a lot clearer without having to reference the argument_specs. I will check out what needs to be done and how it plays with pyyaml being used.
I agree here as well. I think we could use what the user defined for their As for the other topics, I will move the options and add the missing test case. I would also start adapting the README so it covers what is changed. |
Pyyaml and ruamel.yaml are im my experience mostly compatible, so swapping out PyYAML for ruamel.yaml should be possible.
Agree. I just checked my locally existing Ansible-code and One last thing: if you want to (no need!), you could try moving the |
I'm glad you mention this actually. I was thinking about it since the cli.py is getting quite busy. But without the go ahead I didn't want to restructure parts that are not part of the feature 😄. But I agree, it makes sense to have a |
Restructuring the project since it is growing in size. Functionality is now split in cli, core, markdown and defaults modules.
@moritzrp, if the PR is ready, you can set it to ready. |
Hey @rndmh3ro , now the most most parts are done from my side.
This is still open. Moving the options (and adjusting the test cases) still somehow breaks the The options have no negative effects on the defaults command. So from my side it would be fine to go without it for now. To change it I need to spend some time debugging what is going on there. It's not specific to other changes I made. If you move the options on the main branch the same thing will happen. |
Alright, now I am happy. I overlooked some changes from ruamel.yaml and finished up the structure. |
Thanks for this PR! Awesome work. I'll do a follow-up PR shortly to address some things that you can then review. |
Thank you, awesome work! |
This PR addresses #77 by adding a new command to generate defaults.