You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit [https://github.com/bbatsov/rubocop/commit/15191030e9d8fad9fc93860d2bd732eb485ee2a1] will break our rubocop workflow.
So till now(upto 0.27.1) it worked like this:
Apart from everyone in the team manually running rubocop we let rubocop run in a pre-commit hook.
This hook passes all changed(and to-be-commited) files to rubocop to check and auto-correct them. After that it simply passed the exit code from rubocop to git which would abort the commit if there where any issues regardless if they could be auto-corrected.
Since 0.28.0 if all issues could be auto-corrected the exit code is now 0 which will in our case not stop the commit and even worse will commit the files before rubocop cleaned up the issues.
So currently I only see two options for our hook to handle the new behavior which both do not sound appealing:
just automatically add the changes to the current commit before moving on. Meaning calling git add on the fixed file. This has at least the problem that it would break git add --patch as the hidden git add would just add the hole file.
I add a bunch of code to parse the output(or the json) from rubocop to determine the exit-code which should be passed to git ( currently our hook only has to know how to call rubocop )
The IMHO nicer solution would be to make the exit-code in case of corrected issues be configurable by the --fail-level option
The text was updated successfully, but these errors were encountered:
This commit [https://github.com/bbatsov/rubocop/commit/15191030e9d8fad9fc93860d2bd732eb485ee2a1] will break our rubocop workflow.
So till now(upto
0.27.1
) it worked like this:Apart from everyone in the team manually running rubocop we let rubocop run in a pre-commit hook.
This hook passes all changed(and to-be-commited) files to rubocop to check and auto-correct them. After that it simply passed the exit code from rubocop to git which would abort the commit if there where any issues regardless if they could be auto-corrected.
Since
0.28.0
if all issues could be auto-corrected the exit code is now 0 which will in our case not stop the commit and even worse will commit the files before rubocop cleaned up the issues.So currently I only see two options for our hook to handle the new behavior which both do not sound appealing:
git add
on the fixed file. This has at least the problem that it would breakgit add --patch
as the hiddengit add
would just add the hole file.The IMHO nicer solution would be to make the exit-code in case of corrected issues be configurable by the
--fail-level
optionThe text was updated successfully, but these errors were encountered: