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

Run non-autocorrectable linters in autocorrect mode; improve message #246

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

jeremycole
Copy link

Fixes #145

Run all configured/enabled linters even when in autocorrect mode, and improve the messaging somewhat when run in autocorrect mode.

I ran into this after configuring erb-lint with 12 total linters, of which only 9 are autocorrectable. The dev style command would run with autocorrect, but this may leave lint failures which were from non-autocorrectable linters. This would then cause CI to fail for the branch later, very annoyingly, when it's run without autocorrect mode.

This PR causes a behavior change for -a/--autocorrect, but it matches the behavior of Rubocop's autocorrect, and I think matches most users' expectations better.

The message from a real project looks like so:

Linting and autocorrecting 184 files with 12 linters (9 autocorrectable)...

Additionally I have added tests for the autocorrect message output (which didn't exist before).

@jeremycole
Copy link
Author

@rafaelfranca I added you as reviewer since you seem to be the one doing maintenance on this repository; feel free to reassign for review though!

@rafaelfranca rafaelfranca merged commit 12fba2c into main Jan 20, 2022
@rafaelfranca rafaelfranca deleted the better_autocorrect_20220105 branch January 20, 2022 03:28
@shopify-shipit shopify-shipit bot temporarily deployed to production June 15, 2022 23:51 Inactive
@mattbrictson
Copy link

I think this PR may have introduced a regression. I'd appreciate your thoughts on #263 . Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove filtering of linters when using --autocorrect
3 participants