From 7a6de00bba8091f9bddbdb65eb12e7c9e16c58ff Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 7 Jun 2023 16:57:37 +0100 Subject: [PATCH] Sort versions and define that versions < 3000 can have a `.0` Signed-off-by: Pedro Algarvio --- src/saltrewrite/salt/fix_docstrings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/saltrewrite/salt/fix_docstrings.py b/src/saltrewrite/salt/fix_docstrings.py index c55cdb7..f91fefc 100644 --- a/src/saltrewrite/salt/fix_docstrings.py +++ b/src/saltrewrite/salt/fix_docstrings.py @@ -124,7 +124,7 @@ def _handle_convert_version_names_to_numbers_match(match): else: versions.add(_vs) parsed_versions = [] - for version in versions: + for version in sorted(versions): try: version = SaltStackVersion.from_name(version).string except ValueError: @@ -531,6 +531,8 @@ def can_have_dot_zero(self, major): """ determine if using new versioning scheme """ + if int(major) < 3000: + return True return bool(int(major) >= 3006 and int(major) < VERSION_LIMIT) @classmethod