On Thu, 3 Dec 2015 16:01:00 +0100 Martin Vidner <mvidner@suse.cz> wrote:
On Tue, Nov 17, 2015 at 03:01:30PM +0100, Stefan Hundhammer wrote:
We just had to deal with a P1 bug caused by a stray 'next' statement in the Ruby code that did not return a value:
https://bugzilla.suse.com/show_bug.cgi?id=955216#c11
[...] Maybe there is some tool out there that can automate that for us.
((77c4c57...)) mvidner@mrakoplas:yast-bootloader$ ~/svn/rubocop/bin/rubocop --only Lint/ReduceNextNil Inspecting 63 files ....................................W..........................
Offenses:
src/modules/BootStorage.rb:158:9: W: Lint/ReduceNextNil: Use next with an accumulator argument in a reduce. next unless partitions ^^^^
63 files inspected, 1 offense detected
WIP in https://github.com/bbatsov/rubocop/compare/master...mvidner:reduce-next-nil?...
Nice, I think it can be easily accepted upstream. BTW only think I do not like is skipping after first instance found. Better to not skip subsequent offenders. Josef