Skip to content

Conversation

@yahonda
Copy link
Collaborator

@yahonda yahonda commented Jul 2, 2021

This pull request enables Layout/ClosingParenthesisIndentation cop.

$ bundle exec rubocop
Inspecting 70 files
........C..............C..............................................

Offenses:

lib/active_record/connection_adapters/oracle_enhanced/context_index.rb:163:17: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 14 (not 16)
                } BEGIN
                ^
lib/active_record/connection_adapters/oracle_enhanced/context_index.rb:197:19: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 16 (not 18)
                  }
                  ^
lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb:672:23: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 12 (not 22)
                      )
                      ^

70 files inspected, 3 offenses detected, 3 offenses auto-correctable

Refer rails/rails@d7fce6c
https://github.com/rubocop/rubocop/blame/master/relnotes/v1.18.0.md#L11

@yahonda yahonda requested a review from koic July 2, 2021 09:24
@yahonda
Copy link
Collaborator Author

yahonda commented Jul 2, 2021

@koic Would you review this pull request ?

end.join
end.join
} BEGIN
} BEGIN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following may make the pair of parentheses even clearer.

@@ -153,14 +153,14 @@ module ActiveRecord
                 (p_rowid IN          ROWID,
                 p_clob IN OUT NOCOPY CLOB) IS
                 -- add_context_index_parameters #{(column_names + select_queries).inspect}#{!options.empty? ? +', ' << options.inspect[1..-2] : ''}
-                #{
+              #{
                 selected_columns.map do |cols|
                   cols.map do |col|
                     raise ArgumentError, "Alias #{col} too large, should be 28 or less characters long" unless col.length <= 28
                     "l_#{col} VARCHAR2(32767);\n"
                   end.join
                 end.join
-                } BEGIN
+              } BEGIN
                 FOR r1 IN (
                   SELECT #{quoted_column_names.join(', ')}
                   FROM  #{quoted_table_name}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. Updated and pushed.

Copy link
Collaborator

@koic koic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Can you squash your commits into one?

* Performed auto correct

```ruby
$ bundle exec rubocop
Inspecting 70 files
........C..............C..............................................

Offenses:

lib/active_record/connection_adapters/oracle_enhanced/context_index.rb:163:17: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 14 (not 16)
                } BEGIN
                ^
lib/active_record/connection_adapters/oracle_enhanced/context_index.rb:197:19: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 16 (not 18)
                  }
                  ^
lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb:672:23: C: [Correctable] Layout/ClosingParenthesisIndentation: Indent ) to column 12 (not 22)
                      )
                      ^

70 files inspected, 3 offenses detected, 3 offenses auto-correctable
```

* Correct open brace location manually
```
$
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb b/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb
index e7626f0..ab04cc1 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced/context_index.rb
@@ -153,7 +153,7 @@ module ActiveRecord
                 (p_rowid IN          ROWID,
                 p_clob IN OUT NOCOPY CLOB) IS
                 -- add_context_index_parameters #{(column_names + select_queries).inspect}#{!options.empty? ? +', ' << options.inspect[1..-2] : ''}
-                #{
+              #{
                 selected_columns.map do |cols|
                   cols.map do |col|
                     raise ArgumentError, "Alias #{col} too large, should be 28 or less characters long" unless col.length <= 28
```

Refer rails/rails@d7fce6c
https://github.com/rubocop/rubocop/blame/master/relnotes/v1.18.0.md#L11
@yahonda yahonda force-pushed the enable_layout_closing_parensis_indentation branch from 589fdb5 to 0c5a7df Compare July 4, 2021 13:27
@yahonda
Copy link
Collaborator Author

yahonda commented Jul 4, 2021

Thanks. Squashed commits.

@koic koic merged commit 070b1f1 into rsim:master Jul 4, 2021
@koic
Copy link
Collaborator

koic commented Jul 4, 2021

Thanks!

@yahonda yahonda deleted the enable_layout_closing_parensis_indentation branch June 9, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants