aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-08 08:11:38 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-12-13 18:06:04 +0900
commitf907b418aecfb6dab4e30149b88a8593ddd321b9 (patch)
tree210c5d835be75e876ac69e4a3aafd90ca188e140
parentd0bb649cbf415093dd1cc3f08b7b746dab5ad32f (diff)
downloadrails-f907b418aecfb6dab4e30149b88a8593ddd321b9.tar.gz
rails-f907b418aecfb6dab4e30149b88a8593ddd321b9.tar.bz2
rails-f907b418aecfb6dab4e30149b88a8593ddd321b9.zip
Enable `Layout/SpaceAfterSemicolon` cop to avoid newly adding odd spacing
Ref https://github.com/rails/rails/commit/59ff1ba30d9f4d34b4d478104cc3f453e553c67a#diff-38fb97fba84b1ef0f311c4110a597c44R35
-rw-r--r--.rubocop.yml7
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb6
-rw-r--r--activesupport/test/deprecation_test.rb2
3 files changed, 9 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 033f7adf49..6eca479d9d 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -99,6 +99,9 @@ Layout/SpaceAfterColon:
Layout/SpaceAfterComma:
Enabled: true
+Layout/SpaceAfterSemicolon:
+ Enabled: true
+
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
@@ -109,10 +112,10 @@ Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceBeforeComma:
- Enabled: true
+ Enabled: true
Layout/SpaceBeforeFirstArg:
- Enabled: true
+ Enabled: true
Style/DefWithParentheses:
Enabled: true
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 77c3ed954a..bd535357ee 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -374,7 +374,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
end
def test_delete_association
- assert_queries(2) { posts(:welcome);people(:michael); }
+ assert_queries(2) { posts(:welcome); people(:michael); }
assert_queries(1) do
posts(:welcome).people.delete(people(:michael))
@@ -601,7 +601,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
end
def test_replace_association
- assert_queries(4) { posts(:welcome);people(:david);people(:michael); posts(:welcome).people.reload }
+ assert_queries(4) { posts(:welcome); people(:david); people(:michael); posts(:welcome).people.reload }
# 1 query to delete the existing reader (michael)
# 1 query to associate the new reader (david)
@@ -740,7 +740,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
end
def test_clear_associations
- assert_queries(2) { posts(:welcome);posts(:welcome).people.reload }
+ assert_queries(2) { posts(:welcome); posts(:welcome).people.reload }
assert_queries(1) do
posts(:welcome).people.clear
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 95e7174391..f25c704586 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -32,7 +32,7 @@ class Deprecatee
deprecate :f=
deprecate :g
- def g ;end
+ def g; end
module B
C = 1