Skip to content

Commit

Permalink
Import ignored lint violations from CodeClimate
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jan 2, 2024
1 parent 2d862a1 commit 67c479d
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
inherit_from:
- .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.4

Expand Down Expand Up @@ -39,6 +42,7 @@ Style/BracesAroundHashParameters:
Exclude:
- 'spec/fixtures/migrate/**.rb'
- 'spec/integration/**.rb'
- 'spec/lhm/adapter/**.rb'

Style/CommandLiteral:
Exclude:
Expand Down
111 changes: 111 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-02 13:03:20 -0300 using RuboCop version 0.49.1.
# 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: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Exclude:
- 'spec/integration/indexes_spec.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Layout/IndentArray:
EnforcedStyle: consistent

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
Layout/IndentationWidth:
Exclude:
- 'spec/integration/indexes_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 123

# Offense count: 1
# Cop supports --auto-correct.
Security/YAMLLoad:
Exclude:
- 'configuration.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'spec/fixtures/migrate/**.rb'
- 'spec/integration/**.rb'
- 'spec/lhm/adapter/add_unique_index_spec.rb'
- 'spec/lhm/adapter/remove_index_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Exclude:
- 'spec/fixtures/migrate/0029_disable_departure.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'
- 'spec/fixtures/migrate/0030_data_migration_with_upsert_all.rb'
- 'spec/integration/data_migrations_spec.rb'
- 'spec/integration/foreign_keys_spec.rb'
- 'spec/lhm/column_with_sql_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Exclude:
- 'spec/departure/runner_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInLiteral:
Exclude:
- 'spec/integration/data_migrations_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'
4 changes: 2 additions & 2 deletions lib/active_record/connection_adapters/percona_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def adapter
end

class SchemaCreation < ActiveRecord::ConnectionAdapters::MySQL::SchemaCreation
def visit_DropForeignKey(name) # rubocop:disable Naming/MethodName
def visit_DropForeignKey(name) # rubocop:disable Style/MethodName
fk_name =
if name =~ /^__(.+)/
Regexp.last_match(1)
Expand Down Expand Up @@ -188,7 +188,7 @@ def full_version

# This is a method defined in Rails 6.0, and we have no control over the
# naming of this method.
def get_full_version # rubocop:disable Naming/AccessorMethodName
def get_full_version # rubocop:disable Style/AccessorMethodName
mysql_adapter.raw_connection.server_info[:version]
end

Expand Down
2 changes: 1 addition & 1 deletion spec/integration/indexes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Comment < ActiveRecord::Base; end

it 'executes the percona command' do
if ActiveRecord::Base.connection.send(:supports_rename_index?)
expect_percona_command('RENAME INDEX `index_comments_on_some_id_field` TO `new_index_comments_on_some_id_field`')
expect_percona_command('RENAME INDEX `index_comments_on_some_id_field` TO `new_index_comments_on_some_id_field`') # rubocop:disable Metrics/LineLength
else
expect_percona_command('ADD INDEX `new_index_comments_on_some_id_field` (`some_id_field`)')
expect_percona_command('DROP INDEX `index_comments_on_some_id_field`')
Expand Down

0 comments on commit 67c479d

Please sign in to comment.