Skip to content

Run RuboCop in GitHub Actions #2439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2025
Merged

Run RuboCop in GitHub Actions #2439

merged 2 commits into from
Jun 16, 2025

Conversation

yahonda
Copy link
Collaborator

@yahonda yahonda commented Jun 14, 2025

This commit runs RuboCop in GitHub Actions.

$ bundle exec rubocop -a
Inspecting 73 files
...................W.......C..............CC.............................

Offenses:

lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:49:13: C: [Corrected] Layout/IndentationWidth: Use 2 (not 32) spaces for indentation.
                                            "\"#{name.upcase}\""
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:50:43: C: [Corrected] Layout/ElseAlignment: Align else with QUOTED_COLUMN_NAMES[name].
                                          else
                                          ^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:51:45: C: [Corrected] Layout/CommentIndentation: Incorrect indentation detected (column 44 instead of 14).
                                            # remove double quotes which cannot be used inside quoted identifier
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:52:13: C: [Corrected] Layout/IndentationWidth: Use 2 (not 32) spaces for indentation.
                                            "\"#{name.delete('"')}\""
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:53:43: W: [Corrected] Layout/EndAlignment: end at 53, 42 is not aligned with QUOTED_COLUMN_NAMES[name] ||= if at 48, 12.
                                          end
                                          ^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:60:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body end.
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:110:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:66:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body beginning.
lib/arel/visitors/oracle_common.rb:6:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body beginning.
spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:13:86: C: [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
    @conn = ActiveRecord::Base.establish_connection(CONNECTION_PARAMS.merge(adapter: 'oracle'))
                                                                                     ^^^^^^^^

73 files inspected, 10 offenses detected, 10 offenses corrected
$

@yahonda yahonda force-pushed the run_rubocop branch 3 times, most recently from b820400 to d611de3 Compare June 15, 2025 00:56
yahonda added 2 commits June 16, 2025 08:52
- Create `:rubocop` group in Gemfile
Add `BUNDLE_ONLY` available since Bundler 2.3.19

https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md#2319-july-27-2022
- Use Ruby 3.4
- No need to install Oracle Instant Client to run RuboCop
```ruby
$ bundle exec rubocop -a
Inspecting 73 files
...................W.......C..............CC.............................

Offenses:

lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:49:13: C: [Corrected] Layout/IndentationWidth: Use 2 (not 32) spaces for indentation.
                                            "\"#{name.upcase}\""
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:50:43: C: [Corrected] Layout/ElseAlignment: Align else with QUOTED_COLUMN_NAMES[name].
                                          else
                                          ^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:51:45: C: [Corrected] Layout/CommentIndentation: Incorrect indentation detected (column 44 instead of 14).
                                            # remove double quotes which cannot be used inside quoted identifier
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:52:13: C: [Corrected] Layout/IndentationWidth: Use 2 (not 32) spaces for indentation.
                                            "\"#{name.delete('"')}\""
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:53:43: W: [Corrected] Layout/EndAlignment: end at 53, 42 is not aligned with QUOTED_COLUMN_NAMES[name] ||= if at 48, 12.
                                          end
                                          ^^^
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:60:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body end.
lib/active_record/connection_adapters/oracle_enhanced/quoting.rb:110:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:66:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body beginning.
lib/arel/visitors/oracle_common.rb:6:1: C: [Corrected] Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body beginning.
spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:13:86: C: [Corrected] Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
    @conn = ActiveRecord::Base.establish_connection(CONNECTION_PARAMS.merge(adapter: 'oracle'))
                                                                                     ^^^^^^^^

73 files inspected, 10 offenses detected, 10 offenses corrected
$
```
@yahonda yahonda changed the title [diag] Let RuboCop run Run RuboCop in GitHub Actions Jun 16, 2025
@yahonda yahonda marked this pull request as ready for review June 16, 2025 00:49
@yahonda yahonda merged commit 9b67960 into rsim:master Jun 16, 2025
11 checks passed
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Jun 16, 2025
This environment variable is not necessary anymore since rsim#2439
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.

1 participant