From 0d4977beec305e8f98ed155e7ac065f86e238839 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 24 May 2017 18:33:50 +0000 Subject: rubocop namespace changes from `Style` to `Layout` Refer https://github.com/bbatsov/rubocop/pull/4278/commits/54166bf76ba76b14f1bbc8a34165f175dbc3f227 for the commit ``` /path/to/rails/.rubocop.yml: Style/CaseIndentation has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/CommentIndentation has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/EmptyLines has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/EmptyLinesAroundClassBody has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/EmptyLinesAroundMethodBody has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/EmptyLinesAroundModuleBody has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/IndentationConsistency has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/IndentationWidth has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceAfterColon has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceAfterComma has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceAroundEqualsInParameterDefault has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceAroundKeyword has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceAroundOperators has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceBeforeFirstArg has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceBeforeBlockBraces has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceInsideBlockBraces has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceInsideHashLiteralBraces has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/SpaceInsideParens has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/Tab has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/TrailingBlankLines has the wrong namespace - should be Layout /path/to/rails/.rubocop.yml: Style/TrailingWhitespace has the wrong namespace - should be Layout ``` --- .rubocop.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 0d1d0c36ce..8a0c55d5d4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -18,27 +18,27 @@ Style/BracesAroundHashParameters: Enabled: true # Align `when` with `case`. -Style/CaseIndentation: +Layout/CaseIndentation: Enabled: true # Align comments with method definitions. -Style/CommentIndentation: +Layout/CommentIndentation: Enabled: true # No extra empty lines. -Style/EmptyLines: +Layout/EmptyLines: Enabled: true # In a regular class definition, no empty lines around the body. -Style/EmptyLinesAroundClassBody: +Layout/EmptyLinesAroundClassBody: Enabled: true # In a regular method definition, no empty lines around the body. -Style/EmptyLinesAroundMethodBody: +Layout/EmptyLinesAroundMethodBody: Enabled: true # In a regular module definition, no empty lines around the body. -Style/EmptyLinesAroundModuleBody: +Layout/EmptyLinesAroundModuleBody: Enabled: true # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. @@ -47,30 +47,30 @@ Style/HashSyntax: # Method definitions after `private` or `protected` isolated calls need one # extra level of indentation. -Style/IndentationConsistency: +Layout/IndentationConsistency: Enabled: true EnforcedStyle: rails # Two spaces, no tabs (for indentation). -Style/IndentationWidth: +Layout/IndentationWidth: Enabled: true -Style/SpaceAfterColon: +Layout/SpaceAfterColon: Enabled: true -Style/SpaceAfterComma: +Layout/SpaceAfterComma: Enabled: true -Style/SpaceAroundEqualsInParameterDefault: +Layout/SpaceAroundEqualsInParameterDefault: Enabled: true -Style/SpaceAroundKeyword: +Layout/SpaceAroundKeyword: Enabled: true -Style/SpaceAroundOperators: +Layout/SpaceAroundOperators: Enabled: true -Style/SpaceBeforeFirstArg: +Layout/SpaceBeforeFirstArg: Enabled: true # Defining a method with parameters needs parentheses. @@ -78,18 +78,18 @@ Style/MethodDefParentheses: Enabled: true # Use `foo {}` not `foo{}`. -Style/SpaceBeforeBlockBraces: +Layout/SpaceBeforeBlockBraces: Enabled: true # Use `foo { bar }` not `foo {bar}`. -Style/SpaceInsideBlockBraces: +Layout/SpaceInsideBlockBraces: Enabled: true # Use `{ a: 1 }` not `{a:1}`. -Style/SpaceInsideHashLiteralBraces: +Layout/SpaceInsideHashLiteralBraces: Enabled: true -Style/SpaceInsideParens: +Layout/SpaceInsideParens: Enabled: true # Check quotes usage according to lint rule below. @@ -98,15 +98,15 @@ Style/StringLiterals: EnforcedStyle: double_quotes # Detect hard tabs, no hard tabs. -Style/Tab: +Layout/Tab: Enabled: true # Blank lines should not have any spaces. -Style/TrailingBlankLines: +Layout/TrailingBlankLines: Enabled: true # No trailing whitespace. -Style/TrailingWhitespace: +Layout/TrailingWhitespace: Enabled: true # Use quotes for string literals when they are enough. -- cgit v1.2.3 From cfade1ec7ee7b5b51f3c1578e3474f9c156f2971 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Thu, 22 Jun 2017 22:59:18 -0400 Subject: Enforce frozen string in Rubocop --- .rubocop.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 8a0c55d5d4..fc4ee39572 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -97,6 +97,10 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always + # Detect hard tabs, no hard tabs. Layout/Tab: Enabled: true -- cgit v1.2.3 From 87b3e226d65ac1ed371620bfdcd2f950c87cfece Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Sun, 2 Jul 2017 02:15:17 +0930 Subject: Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa. --- .rubocop.yml | 4 ---- 1 file changed, 4 deletions(-) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index fc4ee39572..8a0c55d5d4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -97,10 +97,6 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes -Style/FrozenStringLiteralComment: - Enabled: true - EnforcedStyle: always - # Detect hard tabs, no hard tabs. Layout/Tab: Enabled: true -- cgit v1.2.3 From 72950568dde05bfe8a69ce4bbf6338fdebf3062f Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sun, 9 Jul 2017 15:06:36 +0300 Subject: Use frozen-string-literal in ActiveSupport --- .rubocop.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 8a0c55d5d4..9b5044a6fc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -77,6 +77,12 @@ Layout/SpaceBeforeFirstArg: Style/MethodDefParentheses: Enabled: true +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always + Include: + - 'activesupport/**/*' + # Use `foo {}` not `foo{}`. Layout/SpaceBeforeBlockBraces: Enabled: true -- cgit v1.2.3 From 14ece5e4292053e7a40e9bd80c447745f721e217 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sun, 9 Jul 2017 20:49:52 +0300 Subject: Use frozen-string-literal in ActiveJob --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 9b5044a6fc..b8b3eb8eea 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -82,6 +82,7 @@ Style/FrozenStringLiteralComment: EnforcedStyle: always Include: - 'activesupport/**/*' + - 'activejob/**/*' # Use `foo {}` not `foo{}`. Layout/SpaceBeforeBlockBraces: -- cgit v1.2.3 From 2adb2b19fce3a92f2e8e2d6e5a7915888cced09d Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 10 Jul 2017 22:36:57 +0900 Subject: Enable Layout/EmptyLineAfterMagicComment cop --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index b8b3eb8eea..2b874d8419 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -25,6 +25,9 @@ Layout/CaseIndentation: Layout/CommentIndentation: Enabled: true +Layout/EmptyLineAfterMagicComment: + Enabled: true + # No extra empty lines. Layout/EmptyLines: Enabled: true -- cgit v1.2.3 From d7b1521db83998fb57811ecc9d12b68e610a44bd Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sun, 16 Jul 2017 20:11:16 +0300 Subject: Use frozen string literal in activemodel/ --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 2b874d8419..8032ece333 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -85,6 +85,7 @@ Style/FrozenStringLiteralComment: EnforcedStyle: always Include: - 'activesupport/**/*' + - 'activemodel/**/*' - 'activejob/**/*' # Use `foo {}` not `foo{}`. -- cgit v1.2.3 From 4183d5dfa1d6d651232a4db44a1fcf71d220af4e Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 16 Jul 2017 18:11:03 +0900 Subject: Enable `Layout/FirstParameterIndentation` cop We have some indentation cops. But now there is a little inconsistent params indentations. Enable `Layout/FirstParameterIndentation` cop to prevent newly inconsistent indentation added and auto-correct to existing violations. --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.rubocop.yml') diff --git a/.rubocop.yml b/.rubocop.yml index 8032ece333..efd154156a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -44,6 +44,9 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true +Layout/FirstParameterIndentation: + Enabled: true + # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. Style/HashSyntax: Enabled: true -- cgit v1.2.3