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

Added auto correct with -a flag #19

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

nicollis
Copy link

@nicollis nicollis commented Apr 2, 2016

added the ability to use rubocop's -a flag and only autocorrect the code that git diff views as added.

it does this by first mapping out the changed lines by some small edits to the patch.rb file

it then takes that those line numbers and adds rubocop en/disable comments to the files around the edited code disabling all other code from being processed by rubocop, while adding lines it maps out what lines its editing

after rubocop runs its validations we then go back though using the edited lines map we remove the added comments. We do this to avoid removing rubocop comments that might already exist in the project

@dhempy
Copy link

dhempy commented Apr 13, 2016

Yes, please, @m4i !

@jmondo
Copy link

jmondo commented Jul 5, 2016

yes plz

durandom added a commit to durandom/rubocop-git that referenced this pull request Mar 17, 2017
Added auto correct with -a flag
durandom added a commit to durandom/rubocop-git that referenced this pull request May 2, 2017
Added auto correct with -a flag
@rgould rgould mentioned this pull request Nov 13, 2017
@peterwilson
Copy link

Are there plans to add this to the main repo's master branch?

@dnamsons
Copy link

/cc @m4i

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

Successfully merging this pull request may close these issues.

5 participants