Mailinglist Archive: yast-devel (127 mails)

< Previous Next >
[yast-devel] ruby-lint
On Wed, Nov 18, 2015 at 01:39:16PM +0100, Lukas Ocilka wrote:
On 18.11.2015 13:33, Josef Reidinger wrote:
One I just found with a 5 minute Google search was this:

https://github.com/YorickPeterse/ruby-lint

Has anybody here tried that before? Maybe it's useful for us.

I don't try it, but looks interesting. I just do not think we should
make it "hard" requirement (like do not submit package when something
found). More like hints what can go wrong as for ruby with meta
programming only think you can say for sure, is that everything can be
changed :)

Looks like a good idea for HackWeek: December 7th to 11th.

Thanks for the pointer!

I've had a short look at ruby-lint. It seems it would be a bit of
work to get it working on our code because it needs to know all the
classes referenced in the code.

So I ran it on ruby-dbus which is non-trivial but almost self
contained, and ruby-lint did find a bug already:

$ ruby-lint lib/dbus/message_queue.rb
message_queue.rb: warning: line 37, column 14: unused local variable d
message_queue.rb: warning: line 37, column 17: unused local variable d
message_queue.rb: warning: line 64, column 49: unused argument m
(^ these unused vars are also detected by RuboCop)
message_queue.rb: error: line 95, column 61: undefined instance variable @path
message_queue.rb: error: line 100, column 39: undefined instance variable @path
(^ but this bug is not)

On the other hand, it also complains
type.rb: error: line 201, column 1: undefined method module_function
which is an elementary method in Module.

--
Martin Vidner, YaST Team
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
< Previous Next >