rubocop-git icon indicating copy to clipboard operation
rubocop-git copied to clipboard

Incorrect exit code if there isn't any offenses detected

Open madslundholmdk opened this issue 7 years ago • 2 comments

When I run the following command, and it says no offenses detected but the exit code is 1.

$ bundle exec rubocop-git origin/master HEAD
12 files inspected, no offenses detected
$ echo $?
1

rubocop-git version:

$ rubocop-git -v
0.1.3

rubocop version:

$ rubocop -v
0.52.1

ruby version:

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin17]

madslundholmdk avatar Feb 09 '18 08:02 madslundholmdk

After some debugging, I figured out that this is the cause of the issue:

# rubocop:disable Metrics/BlockLength

This could be fixed for me if #33 is merged, since I just can disable the cop for the whole spec directory.

However, I think this should be fixed later, so it also supports comments to disable/enable cops.

madslundholmdk avatar Feb 09 '18 08:02 madslundholmdk

if anyone is still using this, i've release a forked gem, rubocop-git2, with this and other fixes included

jaynetics avatar Mar 24 '23 21:03 jaynetics