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

Add progressive mode #1065

Merged
merged 1 commit into from Oct 31, 2020
Merged

Add progressive mode #1065

merged 1 commit into from Oct 31, 2020

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Oct 2, 2020

Adds a new option --progressive that ease adoption of the linter as it will only report failure if it detects an increase number of violations since previous commit.

An example of the output when run in progressive mode can be seen below:

WARNING  Total violation(s) reduced from 165 to 0 since previous commit. Will mark result as success
WARNING  Marked 99 previously known violation(s) as ignored due to progressive mode.
WARNING  Listing 99 violation(s) marked as ignored, likely already known

@ssbarnea ssbarnea added the feedback-needed Divergent oppinions, additional feedback is desired in order to unblock it. label Oct 5, 2020
@MarkusTeufelberger
Copy link
Contributor

If I have 5 errors of type A, fix them in one commit but create 4 new errors of type B in that fix, will this fail (since I introduced 4 new errors) or pass (since only 4 errors are now in the repository, even though they are new)?

@ssbarnea
Copy link
Member Author

ssbarnea commented Oct 5, 2020

If I have 5 errors of type A, fix them in one commit but create 4 new errors of type B in that fix, will this fail (since I introduced 4 new errors) or pass (since only 4 errors are now in the repository, even though they are new)?

I rewrote a lot of the implementation and now it will always fail if newer violations are introduced. Take a look and more important, test locally.

@geerlingguy
Copy link

This is an interesting feature, for sure—though the first run of Ansible Lint on an existing repo would fail, correct? Or I guess if it runs against a commit that had no new violations compared to the previous commit, then it wouldn't fail.

It would be useful for those who are adopting Ansible Lint on a repo that has a lot of history and needs a lot of cleanup.

lib/ansiblelint/__main__.py Outdated Show resolved Hide resolved
lib/ansiblelint/cli.py Outdated Show resolved Hide resolved
Adds a new option --progressive that ease adoption of the linter as
it will only report failure if it detects an increase number
of violations since previous commit.
@ssbarnea ssbarnea merged commit a4e6409 into master Oct 31, 2020
@ssbarnea ssbarnea removed the feedback-needed Divergent oppinions, additional feedback is desired in order to unblock it. label Oct 31, 2020
@ssbarnea ssbarnea deleted the feature/progressive branch December 15, 2020 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants