Clarify progressive mode documentation #2708
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello.
In this PR I have fixed two issues regarding the progressive mode.
The default config lacks progressive mode, it is only mentioned in the cli help. I have added
progressive: false
with a comment (which is modified from the original, see 2.)The logic behind progressive marking a success is a comparison of sets. The help says that the number of violations must be reduced, which is not true, because keeping the same number of violations is still a success:
len({1,2,3} - {1,2,3})
evaluates to0
(src/ansiblelint/__main__.py#233
). Therefore ansible-lint returns success if the number of violations has not increased. This takes no change in number into account. Once again, reducing means that every commit needs to remove at least 1 violation. Note, that the warning in__main__.py
states correctly thatTotal violations not increased since previous commit
, so does thedocs/usage.md
:as long the total number of violations did not increase since the previous commit.
I have read
test_progressive.py
file and came to the conclusion that these are issues of purely documentation nature, there's no need to additionally test, but I will continue to verify that once resolvelib dependency is fixed in my distro...