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

YAML indentation for change types differs from examples and expected indentation #152

Closed
alisonlhart opened this issue Feb 16, 2024 · 2 comments · Fixed by #160
Closed
Labels
enhancement New feature or request

Comments

@alisonlhart
Copy link

alisonlhart commented Feb 16, 2024

Under each change type section in the generated changelog.yml - bugfixes, major_changes, minor_changes, breaking_changes, etc - the list of changes are placed at the same hierarchical level as the change type title.

For example, in the changelog.yaml example here, the spacing is shown to be:

releases:
  1.0.0:
    release_date: '2020-04-01'
    codename: White Rabbit
    changes:
      release_summary: This is the initial White Rabbit release. Enjoy!
      major_changes:
        - The authentication method handling has been rewritten.   # Two spaces indented from `major changes`

In the actual generated changelog.yaml, all fragment details listed appear to be placed at the same indentation level as the change type.

For example:

releases:
  1.0.0:
    release_date: '2020-04-01'
    codename: White Rabbit
    changes:
      release_summary: This is the initial White Rabbit release. Enjoy!
      major_changes:
      - The authentication method handling has been rewritten.   # No indention from `major changes`

No config.yml setting seems to have an affect on this behavior. If there's a way to prevent this behavior in the config or if this is intentional, feel free to close out this issue!

@felixfontein
Copy link
Collaborator

The format used is the default output format used by PyYAML. There's no way to prevent the current behavior via configuration (if someone wants to change that, I'll happily review + merge PRs that do it in a backwards compatible way) except by reformatting the generated YAML file after it has been written by antsibull-changelog (prettier can reformat YAML files IIRC, then there's yamlfmt, and there are likely many more programs which can do that).

The examples in https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelog.yaml-format.md#release-information are semantically equivalent (as YAML files) to what the program writes, but not syntactically equivalent.

@felixfontein felixfontein added the enhancement New feature or request label Feb 16, 2024
@alisonlhart
Copy link
Author

@felixfontein Thank you for the details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants