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
Add support for acceptable command options #1457
Conversation
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
I'm just asking this out of curiosity, what will happen when |
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
If the Ansible |
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Label check fails, https://github.com/ansible-community/ansible-lint/pull/1457/checks?check_run_id=2087012753#step:4:13, but I don't seem to be able to add a label. |
@konstruktoid Can you fix current issues, I want to merge this PR as I see beneficial. Removing few false-positives will make the rule more useful. |
Will fix later today. |
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
@konstruktoid I am closing this as not being updated but if you can find time to work on it, I will gladly reopen. |
What do you mean not being updated @ssbarnea? |
Last change was 11 days ago and it was reporting red on CI. I reopened it but it already missed being included in 5.0.5 |
Yeah, I was waiting for #1457 (comment) and multiple tests fails on https://github.com/ansible-community/ansible-lint/runs/2174036019?check_suite_focus=true#step:9:695 ( But I can resubmit a PR later if wanted. |
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 3.9.1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- [...]/ansible-lint/.tox/py39-ansible29/bin/python
cachedir: .tox/py39-ansible29/.pytest_cache
rootdir: [...]/ansible-lint, configfile: pytest.ini
plugins: flaky-3.7.0, cov-2.11.1, xdist-2.2.1, forked-1.3.0
collected 314 items / 308 deselected / 6 selected
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_apt_get[CommandsInsteadOfModulesRule] PASSED [ 16%]
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_restart_sshd[CommandsInsteadOfModulesRule] PASSED [ 33%]
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_git_log[CommandsInsteadOfModulesRule] PASSED [ 50%]
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_git_branch[CommandsInsteadOfModulesRule] PASSED [ 66%]
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_systemd_environment[CommandsInsteadOfModulesRule] PASSED [ 83%]
.tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_systemd_runlevel[CommandsInsteadOfModulesRule] PASSED [100%]
----------------------------------------------------- generated xml file: [...]/ansible-lint/.tox/junit.py39-ansible29.xml -----------------------------------------------------
=========================================================================================== slowest 10 durations ===========================================================================================
0.77s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_apt_get[CommandsInsteadOfModulesRule]
0.68s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_restart_sshd[CommandsInsteadOfModulesRule]
0.67s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_git_log[CommandsInsteadOfModulesRule]
0.66s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_git_branch[CommandsInsteadOfModulesRule]
0.65s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_systemd_environment[CommandsInsteadOfModulesRule]
0.65s call .tox/py39-ansible29/lib/python3.9/site-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py::test_systemd_runlevel[CommandsInsteadOfModulesRule]
(4 durations < 0.005s hidden. Use -vv to show these durations.)
==================================================================================== 6 passed, 308 deselected in 4.84s =====================================================================================
_________________________________________________________________________________________________ summary __________________________________________________________________________________________________
py39-ansible29: commands succeeded
congratulations :) but |
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
* master: Recommend using pipx to install ansible-lint (#1520) Ignore templated files (#1524) src/ansiblelint/utils.py: Ensure that the role file is not a file (#1522) Fixed docs edit links (#1525) Fix role name handling in prerun.py (#1490) More type (3) (#1498) Retry prepare environment three times before failing (#1517) Add ansible-role-bootstrap (#1503) Fix meta-incorrect rule to report correctly (#1515) Update dependencies (#1516) Add DebOps project to eco test pipeline (#1500)
Obsoleted by #1544 |
This PR is meant to reduce the number of false positives when
command:
is required due to missing module functionality.E.g.
command: systemctl set-default
(#682) is acceptable since the Ansible systemd module don't have runlevel support.Added
'git': 'branch',
and'systemctl': ['set-default', 'show-environment']
as initial examples.Fixes: #682