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

Avoid upgrade recommendation for bleeding edge users #2630

Merged
merged 1 commit into from Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ansiblelint/__main__.py
Expand Up @@ -187,7 +187,9 @@ def main(argv: list[str] | None = None) -> int: # noqa: C901
console.print(
f"ansible-lint [repr.number]{__version__}[/] using ansible [repr.number]{ansible_version()}[/]"
)
console.print(get_version_warning())
msg = get_version_warning()
if msg:
console.print(msg)
sys.exit(0)

initialize_logger(options.verbosity)
Expand Down
6 changes: 3 additions & 3 deletions src/ansiblelint/config.py
Expand Up @@ -285,8 +285,8 @@ def get_version_warning() -> str:
elif current_version < new_version:
msg = f"""[warning]A new release of ansible-lint is available: [red]{current_version}[/] → [green][link={html_url}]{new_version}[/][/][/]"""

pip = guess_install_method()
if pip:
msg += f" Upgrade by running: [info]{pip}[/]"
pip = guess_install_method()
if pip:
msg += f" Upgrade by running: [info]{pip}[/]"

return msg