Skip to content

Prettify and fix yaml indentations #448

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

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

denzhel
Copy link
Contributor

@denzhel denzhel commented Jul 28, 2022

Having the following example playbooks vars:

    datadog_checks:
      rabbitmq:
        init_config:
        instances:
          - rabbitmq_api_url: 'http://localhost:15672/api/'
            user: 'admin'
            password: 'password'

Will output this default template behavior(ugly and unclean yaml structure):

    init_config: null
    instances:
    -   password: password
        rabbitmq_api_url: http://localhost:15672/api/
        user: admin

Because of:

{{ datadog_checks[item] | to_nice_yaml }}

Adding indent=2 results in a much better and cleaner output:

   init_config: null
   instances:
   - password: password
     rabbitmq_api_url: http://localhost:15672/api/
     user: admin

@denzhel denzhel requested a review from a team as a code owner July 28, 2022 07:56
Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋 thanks for the PR. LGTM, I'm merging.

@bkabrda bkabrda merged commit ee617c6 into DataDog:main Aug 15, 2022
@denzhel denzhel deleted the fix-checks-yaml-indentation branch August 17, 2022 22:36
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

Successfully merging this pull request may close these issues.

2 participants