How to solve ruby formatting error in rubocop? -
the error -
inspecting 1 file c offenses: hellotk.rb:7:17: c: not use semicolons terminate expressions. pack { padx 15; pady 15; side 'left'; } ^ 1 file inspected, 1 offense detected
the file -
#!/usr/bin/ruby require 'tk' root = tkroot.new { title 'hello, world!' } tklabel.new(root) text 'hello, world!' pack { padx 15; pady 15; side 'left'; } end tkbutton.new text 'quit' command 'exit' pack('fill' => 'x') end tk.mainloop
what appropriate formatting eliminate ';' rubocop stops warning me writing file wrong? want eliminate offense in correct manner.
it wants put expressions on new lines, rather separating them semicolon
pack { padx 15 pady 15 side left }
or
pack padx 15 pady 15 side left end
Comments
Post a Comment