提交 7ce8a6af 编写于 作者: R Ryuta Kamizono

Enable `Style/DefWithParentheses` rubocop rule

The def with blank `()` was newly added in #31176, but we have not used
the blank `()` style in most part of our code base.
So I've enabled `Style/DefWithParentheses` to prevent to newly added the
code.
上级 28333d62
......@@ -76,6 +76,9 @@ Layout/SpaceAroundOperators:
Layout/SpaceBeforeFirstArg:
Enabled: true
Style/DefWithParentheses:
Enabled: true
# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true
......
......@@ -218,7 +218,7 @@ def form_with(*)
@post = Post.new
@comment = Comment.new
def @post.errors()
def @post.errors
Class.new {
def [](field); field == "author_name" ? ["can't be empty"] : [] end
def empty?() false end
......
......@@ -105,7 +105,7 @@ def form_for(*)
@post = Post.new
@comment = Comment.new
def @post.errors()
def @post.errors
Class.new {
def [](field); field == "author_name" ? ["can't be empty"] : [] end
def empty?() false end
......
......@@ -256,7 +256,7 @@ def country_zones(country_code)
@country_zones[code] ||= load_country_zones(code)
end
def clear() #:nodoc:
def clear #:nodoc:
@lazy_zones_map = Concurrent::Map.new
@country_zones = Concurrent::Map.new
@zones = nil
......
......@@ -210,7 +210,7 @@ def test_array_should_pass_encoding_options_to_children_in_to_json
People = Class.new(BasicObject) do
include Enumerable
def initialize()
def initialize
@people = [
{ name: "John", address: { city: "London", country: "UK" } },
{ name: "Jean", address: { city: "Paris" , country: "France" } }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册