-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build data reformatting tool; improve changelog.yaml YAML represe…
…ntation; add changelog.yaml linter (#638) * Add reformatting tool. * Adjust Ansible changelog config for nicer and easier readable changelog.yaml. * Fix comment. * Add changelog.yaml linting step to lint-build-data. * Lint. * Use strict linting. Ref: ansible-community/antsibull-changelog#182 * Depend on antsibull-changelog 0.31.0+. * Fix docstrings.
- Loading branch information
1 parent
6cde5d8
commit 4f0365a
Showing
8 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
minor_changes: | ||
- "Add a subcommand ``reformat-build-data`` which reformats the changelog.yaml file (https://github.com/ansible-community/antsibull-build/pull/638)." | ||
- "Adjust the changelog config so that changelog.yaml has a nicer order and nicer layout (https://github.com/ansible-community/antsibull-build/pull/638)." | ||
- "Add changelog.yaml linting to ``lint-build-data`` (https://github.com/ansible-community/antsibull-build/pull/638)." | ||
- "Now depends on antsibull-changelog >= 0.31.0 (https://github.com/ansible-community/antsibull-build/pull/638)." |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Author: Felix Fontein <[email protected]> | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or | ||
# https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# SPDX-FileCopyrightText: Ansible Project, 2024 | ||
|
||
""" | ||
Code to reformat build data. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from antsibull_core import app_context | ||
|
||
from .changelog import ChangelogData | ||
|
||
|
||
def reformat_build_data() -> int: | ||
"""Reformat build data.""" | ||
app_ctx = app_context.app_ctx.get() | ||
|
||
data_dir: str = app_ctx.extra["data_dir"] | ||
|
||
# Reformat changelog.yaml | ||
changelog = ChangelogData.ansible(directory=data_dir) | ||
changelog.save() | ||
|
||
return 0 |
This file contains 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
This file contains 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