or: Static Analysis of nil Values in Ruby Code used in YaST.

YaST is written in Ruby. A large part of the code is Ruby that was transpiled from the YCP language during the YCP Killer project. To preserve behavior in various edge-case situations, mostly when nil was passed around, helper libraries were used. The resulting code is often long and hard to work with.

Example from SlideShow.rb:

total_time = Ops.add( total_time, Ops.divide(Ops.get_integer(stage, "value", 0), 3495) )

The plan is to find patterns in Y2R-generated code which can be safely translated into more native Ruby code and translate them. In many cases this will require proving that the edge cases mentioned above can't happen (e.g. that passed parameters can't be nil). This will be done using static analysis on the code.

We have started this during HackWeek 11 with the Zombie Killer project, but did not finish back then.

Since that time, we started using RuboCop in the team to keep a consistent code style. It is a natural match to bring RuboCop and Zombie Killer together, since both are based on the Parser library. RuboCop-YaST was started by Ladislav Slezak, but Zombie Killer is not fully integrated and working.

During HackWeek 13 the goal is to have a safely working RuboCop-YaST that is able to resocialize some zombies in production code.

Looking for mad skills in:

ruby compiler

This project is part of:

Hack Week 13

Activity

  • over 2 years ago: IGonzalezSosa liked Teach RuboCop to Resocialize Zombies
  • over 2 years ago: mvidner added keyword "compiler" to Teach RuboCop to Resocialize Zombies
  • over 2 years ago: mvidner added keyword "ruby" to Teach RuboCop to Resocialize Zombies
  • over 2 years ago: mvidner started Teach RuboCop to Resocialize Zombies
  • over 2 years ago: mvidner originated Teach RuboCop to Resocialize Zombies
  • Show History

    Comments

    Similar Projects

    Inqlude, the Qt software archive by cschum

    During Hack Week 7 I worked on an archive of Qt...


    Get rid of perl-apparmor by goldwynr

    Perl-apparmor is obsolete in the apparmor commu...


    Research/Development: `Doc as Code` Using Asciidoctor, Jekyll, gh-pages, TravisCI, Bootstrap v4 and any Additional Tech Discovered Along the Way by JCayouette

    Doc as Code with Asciidoctor, Jekyll, an...


    Work reports 2.0 by kalabiyau

    Micro-service for - making a report - distri...


    Make ruby-ui usable for YaST by dmacvicar

    ruby-ui was a hackweek project with jreidinger ...