Skip to content

Commit

Permalink
Update Rubocop and move to Github Actions (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlarraz authored Mar 15, 2022
1 parent dd95d76 commit 052e934
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
push:
branches:
- master
- github_actions
pull_request:

jobs:
RuboCop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- run: |
bundle exec rubocop --color --format github --format clang
6 changes: 4 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
inherit_from: .rubocop_todo.yml

AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.2
TargetRubyVersion: 2.7
Exclude:
- 'vendor/**/*'

Expand All @@ -20,7 +22,7 @@ Metrics/CyclomaticComplexity:
Metrics/MethodLength:
Enabled: false

Metrics/LineLength:
Layout/LineLength:
Enabled: false

Metrics/PerceivedComplexity:
Expand Down
106 changes: 106 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-03-14 22:30:45 UTC using RuboCop version 1.26.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'odbc_adapter.gemspec'

# Offense count: 6
# This cop supports safe auto-correction (--auto-correct).
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/odbc_adapter/adapters/postgresql_odbc_adapter.rb'
- 'lib/odbc_adapter/column_metadata.rb'
- 'lib/odbc_adapter/quoting.rb'
- 'lib/odbc_adapter/registry.rb'
- 'lib/odbc_adapter/schema_statements.rb'

# Offense count: 16
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'lib/odbc_adapter/column_metadata.rb'
- 'lib/odbc_adapter/registry.rb'
- 'lib/odbc_adapter/schema_statements.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'lib/odbc_adapter/adapters/null_odbc_adapter.rb'

# Offense count: 1
Lint/MissingSuper:
Exclude:
- 'test/registry_test.rb'

# Offense count: 2
# Configuration parameters: Max, CountKeywordArgs.
Metrics/ParameterLists:
MaxOptionalParameters: 4

# Offense count: 35
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 5
# This cop supports safe auto-correction (--auto-correct).
Style/IfUnlessModifier:
Exclude:
- 'lib/odbc_adapter/adapters/mysql_odbc_adapter.rb'
- 'lib/odbc_adapter/quoting.rb'
- 'lib/odbc_adapter/schema_statements.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/active_record/connection_adapters/odbc_adapter.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/odbc_adapter/column.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
Style/RedundantRegexpEscape:
Exclude:
- 'lib/odbc_adapter/quoting.rb'

# Offense count: 4
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/odbc_adapter/column_metadata.rb'
- 'lib/odbc_adapter/schema_statements.rb'

# Offense count: 2
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'lib/odbc_adapter/adapters/mysql_odbc_adapter.rb'
- 'lib/odbc_adapter/quoting.rb'
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'bundler/gem_tasks'

task default: %i[rubocop test]
task default: %i[test]

desc 'Run rubocop'
task :rubocop do
Expand Down
2 changes: 1 addition & 1 deletion odbc_adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.10'
spec.add_development_dependency 'pry', '~> 0.11'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rubocop', '<= 0.58'
spec.add_development_dependency 'rubocop', '~> 1.26.0'
spec.add_development_dependency 'simplecov', '~> 0.14'
end

0 comments on commit 052e934

Please sign in to comment.