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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -