mirror of https://github.com/rails/rails
Re-enable `Layout/SpaceAroundOperators` cop
We prefer space around operators, but `Layout/SpaceAroundOperators` cop was temporarily disabled in #36943 since that cop changed to check alignment strictly somehow. In RuboCop 1.0.0, that is fixed by https://github.com/rubocop-hq/rubocop/pull/8906. Related https://github.com/rails/rails/pull/38034#discussion_r359845661, https://github.com/rails/rails/pull/39770#discussion_r448829561.
This commit is contained in:
parent
7eb855bfbc
commit
92ff708476
|
@ -119,6 +119,9 @@ Layout/SpaceAroundEqualsInParameterDefault:
|
||||||
Layout/SpaceAroundKeyword:
|
Layout/SpaceAroundKeyword:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceAroundOperators:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/SpaceBeforeComma:
|
Layout/SpaceBeforeComma:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|
31
Gemfile.lock
31
Gemfile.lock
|
@ -370,7 +370,7 @@ GEM
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
os (1.1.1)
|
os (1.1.1)
|
||||||
parallel (1.19.2)
|
parallel (1.19.2)
|
||||||
parser (2.7.1.4)
|
parser (2.7.2.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
path_expander (1.1.0)
|
path_expander (1.1.0)
|
||||||
pg (1.2.3)
|
pg (1.2.3)
|
||||||
|
@ -410,7 +410,7 @@ GEM
|
||||||
rdoc (6.2.1)
|
rdoc (6.2.1)
|
||||||
redcarpet (3.2.3)
|
redcarpet (3.2.3)
|
||||||
redis (4.2.2)
|
redis (4.2.2)
|
||||||
regexp_parser (1.7.1)
|
regexp_parser (1.8.2)
|
||||||
representable (3.0.4)
|
representable (3.0.4)
|
||||||
declarative (< 0.1.0)
|
declarative (< 0.1.0)
|
||||||
declarative-option (< 0.2.0)
|
declarative-option (< 0.2.0)
|
||||||
|
@ -429,25 +429,26 @@ GEM
|
||||||
retriable (3.1.2)
|
retriable (3.1.2)
|
||||||
rexml (3.2.4)
|
rexml (3.2.4)
|
||||||
rouge (3.20.0)
|
rouge (3.20.0)
|
||||||
rubocop (0.90.0)
|
rubocop (1.0.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.7.1.1)
|
parser (>= 2.7.1.5)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.7)
|
regexp_parser (>= 1.8)
|
||||||
rexml
|
rexml
|
||||||
rubocop-ast (>= 0.3.0, < 1.0)
|
rubocop-ast (>= 0.6.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 2.0)
|
unicode-display_width (>= 1.4.0, < 2.0)
|
||||||
rubocop-ast (0.3.0)
|
rubocop-ast (1.0.1)
|
||||||
parser (>= 2.7.1.4)
|
parser (>= 2.7.1.5)
|
||||||
rubocop-packaging (0.4.0)
|
rubocop-packaging (0.5.1)
|
||||||
rubocop (~> 0.89)
|
rubocop (>= 0.89, < 2.0)
|
||||||
rubocop-performance (1.6.1)
|
rubocop-performance (1.8.1)
|
||||||
rubocop (>= 0.71.0)
|
rubocop (>= 0.87.0)
|
||||||
rubocop-rails (2.5.2)
|
rubocop-ast (>= 0.4.0)
|
||||||
activesupport
|
rubocop-rails (2.8.1)
|
||||||
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 0.72.0)
|
rubocop (>= 0.87.0)
|
||||||
ruby-progressbar (1.10.1)
|
ruby-progressbar (1.10.1)
|
||||||
ruby-vips (2.0.17)
|
ruby-vips (2.0.17)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
|
|
|
@ -34,7 +34,7 @@ module ActionDispatch
|
||||||
from = state_id[s]
|
from = state_id[s]
|
||||||
|
|
||||||
if u.all? { |pos| pos == DUMMY }
|
if u.all? { |pos| pos == DUMMY }
|
||||||
to = state_id[Object.new]
|
to = state_id[Object.new]
|
||||||
dtrans[from, to] = sym
|
dtrans[from, to] = sym
|
||||||
dtrans.add_accepting(to)
|
dtrans.add_accepting(to)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module ActionDispatch
|
||||||
|
|
||||||
private
|
private
|
||||||
def actionable_request?(request)
|
def actionable_request?(request)
|
||||||
request.get_header("action_dispatch.show_detailed_exceptions") && request.post? && request.path == endpoint
|
request.get_header("action_dispatch.show_detailed_exceptions") && request.post? && request.path == endpoint
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirect_to(location)
|
def redirect_to(location)
|
||||||
|
|
|
@ -75,7 +75,7 @@ module ActiveModel
|
||||||
usec = $7.to_i
|
usec = $7.to_i
|
||||||
usec_len = $7&.length
|
usec_len = $7&.length
|
||||||
if usec_len&.< 6
|
if usec_len&.< 6
|
||||||
usec *= 10 ** (6 - usec_len)
|
usec *= 10**(6 - usec_len)
|
||||||
end
|
end
|
||||||
|
|
||||||
if $8
|
if $8
|
||||||
|
|
|
@ -40,7 +40,7 @@ module ActiveRecord
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"default_env" => {
|
"default_env" => {
|
||||||
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
||||||
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,8 +73,8 @@ module ActiveRecord
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"default_env" => {
|
"default_env" => {
|
||||||
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
||||||
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
||||||
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
||||||
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,8 @@ module ActiveRecord
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"default_env" => {
|
"default_env" => {
|
||||||
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
||||||
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
||||||
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
||||||
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
||||||
}
|
}
|
||||||
|
@ -185,8 +185,8 @@ module ActiveRecord
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"default_env" => {
|
"default_env" => {
|
||||||
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
"primary" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3" },
|
||||||
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
"primary_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary.sqlite3", "replica" => true },
|
||||||
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
"primary_shard_one" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3" },
|
||||||
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
"primary_shard_one_replica" => { "adapter" => "sqlite3", "database" => "test/db/primary_shard_one.sqlite3", "replica" => true }
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,13 +57,13 @@ class DatabaseConfigurationsTest < ActiveRecord::TestCase
|
||||||
def test_find_db_config_returns_first_config_for_env
|
def test_find_db_config_returns_first_config_for_env
|
||||||
config = ActiveRecord::DatabaseConfigurations.new({
|
config = ActiveRecord::DatabaseConfigurations.new({
|
||||||
"test" => {
|
"test" => {
|
||||||
"config_1"=> {
|
"config_1" => {
|
||||||
"database" => "db"
|
"database" => "db"
|
||||||
},
|
},
|
||||||
"config_2"=> {
|
"config_2" => {
|
||||||
"database" => "db"
|
"database" => "db"
|
||||||
},
|
},
|
||||||
"config_3"=> {
|
"config_3" => {
|
||||||
"database" => "db"
|
"database" => "db"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1291,7 +1291,7 @@ module ActiveRecord
|
||||||
def test_charset_current
|
def test_charset_current
|
||||||
old_configurations = ActiveRecord::Base.configurations
|
old_configurations = ActiveRecord::Base.configurations
|
||||||
configurations = {
|
configurations = {
|
||||||
"production" => { "database" => "prod-db" }
|
"production" => { "database" => "prod-db" }
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveRecord::Base.configurations = configurations
|
ActiveRecord::Base.configurations = configurations
|
||||||
|
@ -1324,7 +1324,7 @@ module ActiveRecord
|
||||||
def test_collation_current
|
def test_collation_current
|
||||||
old_configurations = ActiveRecord::Base.configurations
|
old_configurations = ActiveRecord::Base.configurations
|
||||||
configurations = {
|
configurations = {
|
||||||
"production" => { "database" => "prod-db" }
|
"production" => { "database" => "prod-db" }
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveRecord::Base.configurations = configurations
|
ActiveRecord::Base.configurations = configurations
|
||||||
|
|
Loading…
Reference in New Issue