Short version: see https://github.com/yast/yast-yast2/pull/859
The Rubocop version we currently use (0.41.2) is quite old (~2.5 years) and Github
even reports a low severity security issue with this version . So I'd like to
propose upgrading the Rubocop to the latest version.
I have created a RFC PR with the updated global configuration , but besides the
option renames and specifying Ruby 2.5 there is nothing interesting. More interesting
is the testing run in the "yast2" package (I deliberately used one of the
oldest packages), see .
I have collected and commented some new checks which we should probably disable or at
least discuss the default values. Of course, we can later fine tune the config per
package, so if we decide to enable something globally we can still disable it in
specific packages (even only for specific files, we can be less strict for the legacy
Ruby YCP code).
The newer version adds many more checks but either I find them useful so they should
be enabled or at least I did not find a reason why they should be disabled. But feel
free to discuss any issue not mentioned in the list.
Also you might try running it in some other packages (yast2-storage-ng might be a
good candidate), it might report other issues not present in yast2. But you need to
install the gem manually with "gem install rubocop". No RPM yet, even
devel:languages:ruby:extensions does not contain the latest one.
Please check PR  and discuss the possible issues there.
I started testing the upgrade with Rubocop 0.59.2 but in the meantime they released
version 0.60.0. The change log  does not list any new checks or major changes so I
expect the upgrade to 0.60.0 should be basically the same.
(But maybe I'd wait with the upgrade a bit, usually after releasing the x.0 version
they quite often release a bug fix version x.1 or even x.2 in few days/weeks ;-))
The Travis integration will be easy, we use Docker images and we install the Rubocop
gem as RPM from YaST:Head. We can build a different version for Tumbleweed/Factory in
OBS and keep the old version for 15.0 (and older).
We run Rubocop only in Travis, that means the Jenkins autosubmission or OBS builds
will not be affected by this change.
The only problem is running Rubocop locally during development. Rubygems can be
easily packaged to RPMs with multiversion support, you could install more versions in
parallel. (This will possibly require a small fix in the current YaST:Head package.)
The problem is how to distinguish which version to run in a Git checkout. We define
"rake check:rubocop" task so we could modify it to somehow automatically find
which version to use. I think we could use a similar approach as we use for the osc
target in Rakefile, something like:
We would add this only in "master". For the backward compatibility we would
version "0.41.2" if the option is not set so we do not have to touch all
Obviously if you run rubocop directly (without the rake wrapper) then you have to
know which exact version to run, no magic.
Any comments, ideas?
SUSE LINUX, s.r.o.
18600 Praha 8
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: yast-devel+owner(a)opensuse.org