Skip to content

Commit

Permalink
Use new ansible-compat verbosity levels (#3975)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ssbarnea and pre-commit-ci[bot] authored Jan 10, 2024
1 parent 7b2f701 commit ea5ea04
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .config/lock-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile --no-annotate --output-file=.config/lock-requirements.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
#
ansible-compat==4.1.10
ansible-compat==4.1.11
ansible-core==2.16.0
attrs==23.1.0
black==23.10.1
Expand Down
2 changes: 1 addition & 1 deletion .config/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile --extra=docs --extra=test --no-annotate --output-file=.config/requirements.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib pyproject.toml
#
ansible-compat==4.1.10
ansible-compat==4.1.11
ansible-core==2.16.0
astroid==3.0.1
attrs==23.1.0
Expand Down
2 changes: 1 addition & 1 deletion .config/runtime-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Special order section for helping pip:
will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'
ansible-core>=2.12.0 # GPLv3
ansible-compat>=4.1.10 # GPLv3
ansible-compat>=4.1.11 # GPLv3
# alphabetically sorted:
black>=22.8.0 # MIT
filelock>=3.3.0 # The Unlicense
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ repos:
# empty args needed in order to match mypy cli behavior
args: [--strict]
additional_dependencies:
- ansible-compat>=4.1.10
- ansible-compat>=4.1.11
- black>=22.10.0
- cryptography>=39.0.1
- filelock>=3.12.2
Expand Down Expand Up @@ -180,7 +180,7 @@ repos:
args:
- --output-format=colorized
additional_dependencies:
- ansible-compat>=4.1.10
- ansible-compat>=4.1.11
- ansible-core>=2.14.0
- black>=22.10.0
- docutils
Expand Down
6 changes: 5 additions & 1 deletion src/ansiblelint/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def __init__(self, options: Options):
self.formatter = formatter_factory(options.cwd, options.display_relative_path)

# Without require_module, our _set_collections_basedir may fail
self.runtime = Runtime(isolated=True, require_module=True)
self.runtime = Runtime(
isolated=True,
require_module=True,
verbosity=options.verbosity,
)

def render_matches(self, matches: list[MatchError]) -> None:
"""Display given matches (if they are not fixed)."""
Expand Down
4 changes: 4 additions & 0 deletions test/test_verbosity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

from ansiblelint.testing import run_ansible_lint
from ansiblelint.text import strip_ansi_escape


# substrs is a list of tuples, where:
Expand Down Expand Up @@ -83,6 +84,9 @@ def test_verbosity(
else:
result = run_ansible_lint(str(fakerole), cwd=project_path)

result.stderr = strip_ansi_escape(result.stderr)
result.stdout = strip_ansi_escape(result.stdout)
assert result.returncode == 2, result
for substr, invert in substrs:
if invert:
assert substr not in result.stderr, result.stderr
Expand Down

0 comments on commit ea5ea04

Please sign in to comment.