错误 -
Inspecting 1 file
C
Offenses:
hellotk.rb:7:17: C: Do not use semicolons to terminate expressions.
pack { padx 15; pady 15; side 'left'; }
^
1 file inspected, 1 offense detected
文件 -
#!/usr/bin/ruby
require 'tk'
root = TkRoot.new { title 'Hello, World!' }
TkLabel.new(root) do
text 'Hello, World!'
pack { padx 15; pady 15; side 'left'; }
end
TkButton.new do
text 'Quit'
command 'exit'
pack('fill' => 'x')
end
Tk.mainloop
消除“;”的适当格式是什么 以便 rubocop 停止警告我我的文件写错了?我想以正确的方式消除这种冒犯。