Hi all,


Short version:
--------------

Install the latest rubygem-yast-rake (>= 0.2.26) and use "rake check:rubocop" 
for
running Rubocop.


Long version:
-------------

some time ago I introduced support for parallel test to speed up running units 
tests,
see [1].

You probably noticed that running Rubocop also might take quite some, esp. in 
large
packages like yast2 or yast2-storage-ng. It is slow because Rubocop checks
the files sequentially one by one.

We can easily make it faster by running the checks in parallel. Just get the 
list of
files to check and split it into groups according to the number of processors. 
Then
pass each group to a separate Rubocop process. Check [2] if you want to see the 
details.

This parallel Rubocop is now available as the "rake check:rubocop" task. If you 
want
to automatically fix the found issues then run "rake 
check:rubocop:auto_correct".

I have enabled parallel Rubocop also in the Travis builds [3], it can help 
there a
bit as well, see below.


Some Numbers
------------

I have measured the speed up in the yast2-storage-ng package:

- Running Rubocop locally: the needed time went down from 44s to 12s (~3.6x 
faster
  on a quad core CPU with HT enabled)

- In Travis: from 69s to 47s (~1.5x faster - Travis machines have about 1.5x CPU
  power so this is the maximum we can get)


Enjoy!


[1] https://lists.opensuse.org/yast-devel/2018-06/msg00024.html
[2] https://github.com/yast/yast-rake/pull/57
[3] https://github.com/yast/docker-yast-ruby/pull/27


-- 
Ladislav Slezák
YaST Developer

SUSE LINUX, s.r.o.
Corso IIa
Křižíkova 148/34
18600 Praha 8
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to