Skip to content

Commit

Permalink
Collection removal metadata: remove bad check (#172)
Browse files Browse the repository at this point in the history
* Remove bad check.

* Ignore new linting rule.
  • Loading branch information
felixfontein committed Sep 20, 2024
1 parent 3a13944 commit 467923c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions .pylintrc.automated
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ disable=
too-many-locals,
too-many-return-statements,
too-many-statements,
too-many-positional-arguments,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/172-removal-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Collection metadata removal schema valiation: remove bad check that deprecated redirect replacement major version must be in the future (https://github.com/ansible-community/antsibull-core/pull/172)."
18 changes: 0 additions & 18 deletions src/antsibull_core/collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@ def _validate_removal(
f" must not be larger than the current major version {self.major_release}"
)

if removal.redirect_replacement_major_version is not None:
if removal.redirect_replacement_major_version <= self.major_release:
self.errors.append(
f"{prefix} redirect_replacement_major_version: Redirect removal version"
f" {removal.redirect_replacement_major_version} must be larger than"
f" current major version {self.major_release}"
)
if (
removal.major_version != "TBD"
and removal.redirect_replacement_major_version # pyre-ignore[58]
>= removal.major_version
):
self.errors.append(
f"{prefix} redirect_replacement_major_version: Redirect removal major version"
f" {removal.redirect_replacement_major_version} must be smaller than"
f" the removal major version {removal.major_version}"
)

if removal.reason == "renamed" and removal.new_name == collection:
self.errors.append(f"{prefix} new_name: Must not be the collection's name")

Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
"collections -> bad.bar1 -> removal -> major_version: Removal major version 7 must be larger than current major version 9",
"collections -> bad.bar1: Collection not in ansible.in",
"collections -> bad.bar2 -> removal -> new_name: Must not be the collection's name",
"collections -> bad.bar2 -> removal -> redirect_replacement_major_version: Redirect removal version 9 must be larger than current major version 9",
"collections -> bad.bar2: Collection not in ansible.in",
"collections -> baz.bam -> repository: Required field not provided",
"collections -> baz.bam: Collection not in ansible.in",
Expand Down

0 comments on commit 467923c

Please sign in to comment.