Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ansible-lint for openSUSE:Factory checked in at 2022-10-14 15:42:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ansible-lint (Old) and /work/SRC/openSUSE:Factory/.ansible-lint.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ansible-lint" Fri Oct 14 15:42:46 2022 rev:6 rq:1010628 version:6.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ansible-lint/ansible-lint.changes 2022-10-11 18:05:41.094097910 +0200 +++ /work/SRC/openSUSE:Factory/.ansible-lint.new.2275/ansible-lint.changes 2022-10-14 15:44:01.800067754 +0200 @@ -1,0 +2,11 @@ +Fri Oct 14 04:52:59 UTC 2022 - Johannes Kastl <ka...@b1-systems.de> + +- update to 6.8.2: + * Bugfixes + - Fix strict mode (#2601) @ssbarnea + - Fix config file outside project_dir bug (#2600) @ssbarnea + - Add win_command/win_shell to no-free-form modules (#2596) @nre-ableton + - Docs: Add MD for var-naming (#2594) @oraNod + - Fix role-name correct code example (#2591) @branic + +------------------------------------------------------------------- Old: ---- ansible-lint-6.8.1.tar.gz New: ---- ansible-lint-6.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ansible-lint.spec ++++++ --- /var/tmp/diff_new_pack.rfApVx/_old 2022-10-14 15:44:02.256068515 +0200 +++ /var/tmp/diff_new_pack.rfApVx/_new 2022-10-14 15:44:02.260068522 +0200 @@ -20,7 +20,7 @@ %global lib_name ansiblelint %{?python_enable_dependency_generator} Name: ansible-lint -Version: 6.8.1 +Version: 6.8.2 Release: 0%{?dist} Summary: Best practices checker for Ansible License: MIT ++++++ ansible-lint-6.8.1.tar.gz -> ansible-lint-6.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/.github/workflows/tox.yml new/ansible-lint-6.8.2/.github/workflows/tox.yml --- old/ansible-lint-6.8.1/.github/workflows/tox.yml 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/.github/workflows/tox.yml 2022-10-13 19:25:35.000000000 +0200 @@ -166,7 +166,7 @@ WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:TOX_PARALLEL_NO_SPINNER # Number of expected test passes, safety measure for accidental skip of # tests. Update value if you add/remove tests. - PYTEST_REQPASS: 705 + PYTEST_REQPASS: 707 steps: - name: Activate WSL1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/PKG-INFO new/ansible-lint-6.8.2/PKG-INFO --- old/ansible-lint-6.8.1/PKG-INFO 2022-10-10 23:33:53.351993000 +0200 +++ new/ansible-lint-6.8.2/PKG-INFO 2022-10-13 19:25:55.447939000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ansible-lint -Version: 6.8.1 +Version: 6.8.2 Summary: Checks playbooks for practices and behavior that could potentially be improved Home-page: https://github.com/ansible-community/ansible-lint Author: Will Thames diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/examples/playbooks/strict-mode.yml new/ansible-lint-6.8.2/examples/playbooks/strict-mode.yml --- old/ansible-lint-6.8.1/examples/playbooks/strict-mode.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/ansible-lint-6.8.2/examples/playbooks/strict-mode.yml 2022-10-13 19:25:35.000000000 +0200 @@ -0,0 +1,7 @@ +--- +- name: Fixture for test_strict + hosts: localhost + tasks: + - ansible.builtin.debug: # <-- name should be first key (warning) + msg: "Hello World" + name: Display debug information diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansible_lint.egg-info/PKG-INFO new/ansible-lint-6.8.2/src/ansible_lint.egg-info/PKG-INFO --- old/ansible-lint-6.8.1/src/ansible_lint.egg-info/PKG-INFO 2022-10-10 23:33:53.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansible_lint.egg-info/PKG-INFO 2022-10-13 19:25:55.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ansible-lint -Version: 6.8.1 +Version: 6.8.2 Summary: Checks playbooks for practices and behavior that could potentially be improved Home-page: https://github.com/ansible-community/ansible-lint Author: Will Thames diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansible_lint.egg-info/SOURCES.txt new/ansible-lint-6.8.2/src/ansible_lint.egg-info/SOURCES.txt --- old/ansible-lint-6.8.1/src/ansible_lint.egg-info/SOURCES.txt 2022-10-10 23:33:53.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansible_lint.egg-info/SOURCES.txt 2022-10-13 19:25:55.000000000 +0200 @@ -154,6 +154,7 @@ examples/playbooks/rule-var-naming-fail.yml examples/playbooks/schema-error-string.yml examples/playbooks/skiptasks.yml +examples/playbooks/strict-mode.yml examples/playbooks/syntax-error-string.yml examples/playbooks/syntax-error.yml examples/playbooks/task-has-name-failure.yml @@ -368,6 +369,7 @@ src/ansiblelint/rules/schema.py src/ansiblelint/rules/syntax_check.md src/ansiblelint/rules/syntax_check.py +src/ansiblelint/rules/var_naming.md src/ansiblelint/rules/var_naming.py src/ansiblelint/rules/yaml.md src/ansiblelint/rules/yaml_rule.py @@ -424,6 +426,7 @@ test/test_skip_inside_yaml.py test/test_skip_playbook_items.py test/test_skiputils.py +test/test_strict.py test/test_task_includes.py test/test_transform_mixin.py test/test_transformer.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/__main__.py new/ansible-lint-6.8.2/src/ansiblelint/__main__.py --- old/ansible-lint-6.8.1/src/ansiblelint/__main__.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/__main__.py 2022-10-13 19:25:35.000000000 +0200 @@ -214,8 +214,9 @@ if options.write_list: _do_transform(result, options) - mark_as_success = False + mark_as_success = True if result.matches and options.progressive: + mark_as_success = False _logger.info( "Matches found, running again on previous revision in order to detect regressions" ) @@ -247,6 +248,9 @@ ignored, ) + if options.strict and result.matches: + mark_as_success = False + app.render_matches(result.matches) _perform_mockings_cleanup() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/_version.py new/ansible-lint-6.8.2/src/ansiblelint/_version.py --- old/ansible-lint-6.8.1/src/ansiblelint/_version.py 2022-10-10 23:33:53.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/_version.py 2022-10-13 19:25:55.000000000 +0200 @@ -1,5 +1,5 @@ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -__version__ = version = '6.8.1' -__version_tuple__ = version_tuple = (6, 8, 1) +__version__ = version = '6.8.2' +__version_tuple__ = version_tuple = (6, 8, 2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/app.py new/ansible-lint-6.8.2/src/ansiblelint/app.py --- old/ansible-lint-6.8.1/src/ansiblelint/app.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/app.py 2022-10-13 19:25:35.000000000 +0200 @@ -193,17 +193,23 @@ "because 'yaml' is in 'skip_list'." ) + if summary.failures: + mark_as_success = False + if not self.options.quiet: console_stderr.print(render_yaml(msg)) - self.report_summary(summary, changed_files_count, files_count) + self.report_summary( + summary, changed_files_count, files_count, is_success=mark_as_success + ) - if not self.options.strict and (mark_as_success or not summary.failures): - return SUCCESS_RC - return VIOLATIONS_FOUND_RC + return SUCCESS_RC if mark_as_success else VIOLATIONS_FOUND_RC @staticmethod def report_summary( # pylint: disable=too-many-branches,too-many-locals - summary: SummarizedResults, changed_files_count: int, files_count: int + summary: SummarizedResults, + changed_files_count: int, + files_count: int, + is_success: bool, ) -> None: """Report match and file counts.""" # sort the stats by profiles @@ -269,10 +275,10 @@ console_stderr.print(table) console_stderr.print() - if summary.failures: - msg = "[red][bold]Failed[/][/] after " - else: + if is_success: msg = "[green]Passed[/] with " + else: + msg = "[red][bold]Failed[/][/] after " if summary.passed_profile: msg += f"[bold]{summary.passed_profile}[/] profile" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/cli.py new/ansible-lint-6.8.2/src/ansiblelint/cli.py --- old/ansible-lint-6.8.1/src/ansiblelint/cli.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/cli.py 2022-10-13 19:25:35.000000000 +0200 @@ -529,13 +529,16 @@ f"'rich' or 'md' are supported with -f." ) + # save info about custom config file, as options.config_file may be modified by merge_config + has_custom_config = not options.config_file + file_config = load_config(options.config_file) config = merge_config(file_config, options) options.rulesdirs = get_rules_dirs(options.rulesdir, options.use_default_rules) - if options.project_dir == ".": + if has_custom_config and options.project_dir == ".": project_dir = guess_project_dir(options.config_file) options.project_dir = os.path.expanduser(normpath(project_dir)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/rules/no_free_form.py new/ansible-lint-6.8.2/src/ansiblelint/rules/no_free_form.py --- old/ansible-lint-6.8.1/src/ansiblelint/rules/no_free_form.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/rules/no_free_form.py 2022-10-13 19:25:35.000000000 +0200 @@ -61,8 +61,14 @@ elif isinstance(action_value, str) and "=" in action_value: fail = False if task["action"].get("__ansible_module__") in ( + "ansible.builtin.command", + "ansible.builtin.shell", + "ansible.windows.win_command", + "ansible.windows.win_shell", "command", "shell", + "win_command", + "win_shell", ): if self.cmd_shell_re.match(action_value): fail = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/rules/only_builtins.py new/ansible-lint-6.8.2/src/ansiblelint/rules/only_builtins.py --- old/ansible-lint-6.8.1/src/ansiblelint/rules/only_builtins.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/rules/only_builtins.py 2022-10-13 19:25:35.000000000 +0200 @@ -52,6 +52,7 @@ """Test rule matches.""" result = run_ansible_lint( "--config-file=/dev/null", + "--strict", "--warn-list=", "--enable-list", "only-builtins", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/rules/role_name.md new/ansible-lint-6.8.2/src/ansiblelint/rules/role_name.md --- old/ansible-lint-6.8.1/src/ansiblelint/rules/role_name.md 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/rules/role_name.md 2022-10-13 19:25:35.000000000 +0200 @@ -26,7 +26,7 @@ - name: Example playbook hosts: localhost roles: - - myRole1 # <- Starts with an alphabetic character. + - myrole1 # <- Starts with an alphabetic character. - myrole2 # <- Contains only alphanumeric characters. - myrole_3 # <- Contains only lowercase alphabetic characters. ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/rules/var_naming.md new/ansible-lint-6.8.2/src/ansiblelint/rules/var_naming.md --- old/ansible-lint-6.8.1/src/ansiblelint/rules/var_naming.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ansible-lint-6.8.2/src/ansiblelint/rules/var_naming.md 2022-10-13 19:25:35.000000000 +0200 @@ -0,0 +1,32 @@ +# var-naming + +This rule checks variable names to ensure they conform with requirements. + +Variable names must contain only lowercase alphanumeric characters and the underscore `_` character. +Variable names must also start with either an alphabetic or underscore `_` character. + +For more information see the [creating valid variable names](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#creating-valid-variable-names) topic in Ansible documentation. + +## Problematic Code + +```yaml +--- +- name: Example playbook + hosts: localhost + vars: + CamelCase: true # <- Contains a mix of lowercase and uppercase characters. + ALL_CAPS: bar # <- Contains only uppercase characters. + v@r!able: baz # <- Contains special characters. +``` + +## Correct Code + +```yaml +--- +- name: Example playbook + hosts: localhost + vars: + lowercase: true # <- Contains only lowercase characters. + no_caps: bar # <- Does not contains uppercase characters. + variable: baz # <- Does not contain special characters. +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/runner.py new/ansible-lint-6.8.2/src/ansiblelint/runner.py --- old/ansible-lint-6.8.1/src/ansiblelint/runner.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/runner.py 2022-10-13 19:25:35.000000000 +0200 @@ -124,7 +124,7 @@ continue try: lintable.data - except RuntimeError as exc: + except (RuntimeError, FileNotFoundError) as exc: matches.append( MatchError( filename=lintable, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/src/ansiblelint/utils.py new/ansible-lint-6.8.2/src/ansiblelint/utils.py --- old/ansible-lint-6.8.1/src/ansiblelint/utils.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/src/ansiblelint/utils.py 2022-10-13 19:25:35.000000000 +0200 @@ -859,6 +859,10 @@ _logger.debug("Ignored %s due to: %s", path, exc) continue + if path.is_symlink() and not path.exists(): + _logger.warning("Ignored broken symlink %s -> %s", path, path.resolve()) + continue + lintables.append(Lintable(path)) # stage 2: guess roles from current lintables, as there is no unique diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/test/test_rule_properties.py new/ansible-lint-6.8.2/test/test_rule_properties.py --- old/ansible-lint-6.8.1/test/test_rule_properties.py 2022-10-10 23:33:31.000000000 +0200 +++ new/ansible-lint-6.8.2/test/test_rule_properties.py 2022-10-13 19:25:35.000000000 +0200 @@ -2,7 +2,7 @@ from ansiblelint.rules import RulesCollection -def test_serverity_valid(default_rules_collection: RulesCollection) -> None: +def test_severity_valid(default_rules_collection: RulesCollection) -> None: """Test that rules collection only has allow-listed severities.""" valid_severity_values = [ "VERY_HIGH", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansible-lint-6.8.1/test/test_strict.py new/ansible-lint-6.8.2/test/test_strict.py --- old/ansible-lint-6.8.1/test/test_strict.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ansible-lint-6.8.2/test/test_strict.py 2022-10-13 19:25:35.000000000 +0200 @@ -0,0 +1,23 @@ +"""Test strict mode.""" +import pytest + +from ansiblelint.testing import run_ansible_lint + + +@pytest.mark.parametrize( + ("strict", "returncode", "message"), + ( + pytest.param(True, 2, "Failed", id="on"), + pytest.param(False, 0, "Passed", id="off"), + ), +) +def test_strict(strict: bool, returncode: int, message: str) -> None: + """Test running from inside meta folder.""" + args = ["examples/playbooks/strict-mode.yml"] + if strict: + args.insert(0, "--strict") + result = run_ansible_lint(*args) + assert result.returncode == returncode + assert "key-order[task]" in result.stdout + summary_line = result.stderr.splitlines()[-1] + assert message in summary_line