Skip to content

Commit 67c479d

Browse files
committed
Import ignored lint violations from CodeClimate
1 parent 2d862a1 commit 67c479d

File tree

4 files changed

+118
-3
lines changed

4 files changed

+118
-3
lines changed

.rubocop.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
inherit_from:
3+
- .rubocop_todo.yml
4+
25
AllCops:
36
TargetRubyVersion: 2.4
47

@@ -39,6 +42,7 @@ Style/BracesAroundHashParameters:
3942
Exclude:
4043
- 'spec/fixtures/migrate/**.rb'
4144
- 'spec/integration/**.rb'
45+
- 'spec/lhm/adapter/**.rb'
4246

4347
Style/CommandLiteral:
4448
Exclude:

.rubocop_todo.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2024-01-02 13:03:20 -0300 using RuboCop version 0.49.1.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 3
10+
# Cop supports --auto-correct.
11+
# Configuration parameters: EnforcedStyle, SupportedStyles.
12+
# SupportedStyles: leading, trailing
13+
Layout/DotPosition:
14+
Exclude:
15+
- 'spec/integration/indexes_spec.rb'
16+
17+
# Offense count: 4
18+
# Cop supports --auto-correct.
19+
# Configuration parameters: SupportedStyles, IndentationWidth.
20+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
21+
Layout/IndentArray:
22+
EnforcedStyle: consistent
23+
24+
# Offense count: 1
25+
# Cop supports --auto-correct.
26+
# Configuration parameters: Width, IgnoredPatterns.
27+
Layout/IndentationWidth:
28+
Exclude:
29+
- 'spec/integration/indexes_spec.rb'
30+
31+
# Offense count: 2
32+
# Cop supports --auto-correct.
33+
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
34+
# SupportedStyles: space, no_space, compact
35+
# SupportedStylesForEmptyBraces: space, no_space
36+
Layout/SpaceInsideHashLiteralBraces:
37+
Exclude:
38+
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'
39+
40+
# Offense count: 2
41+
# Cop supports --auto-correct.
42+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
43+
Lint/UnusedMethodArgument:
44+
Exclude:
45+
- 'lib/active_record/connection_adapters/for_alter.rb'
46+
- 'spec/spec_helper.rb'
47+
48+
# Offense count: 1
49+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
50+
# URISchemes: http, https
51+
Metrics/LineLength:
52+
Max: 123
53+
54+
# Offense count: 1
55+
# Cop supports --auto-correct.
56+
Security/YAMLLoad:
57+
Exclude:
58+
- 'configuration.rb'
59+
60+
# Offense count: 12
61+
# Cop supports --auto-correct.
62+
# Configuration parameters: EnforcedStyle, SupportedStyles.
63+
# SupportedStyles: braces, no_braces, context_dependent
64+
Style/BracesAroundHashParameters:
65+
Exclude:
66+
- 'spec/fixtures/migrate/**.rb'
67+
- 'spec/integration/**.rb'
68+
- 'spec/lhm/adapter/add_unique_index_spec.rb'
69+
- 'spec/lhm/adapter/remove_index_spec.rb'
70+
71+
# Offense count: 1
72+
# Cop supports --auto-correct.
73+
# Configuration parameters: EnforcedStyle, SupportedStyles.
74+
# SupportedStyles: compact, expanded
75+
Style/EmptyMethod:
76+
Exclude:
77+
- 'spec/fixtures/migrate/0029_disable_departure.rb'
78+
79+
# Offense count: 12
80+
# Cop supports --auto-correct.
81+
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
82+
# SupportedStyles: single_quotes, double_quotes
83+
Style/StringLiterals:
84+
Exclude:
85+
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'
86+
- 'spec/fixtures/migrate/0030_data_migration_with_upsert_all.rb'
87+
- 'spec/integration/data_migrations_spec.rb'
88+
- 'spec/integration/foreign_keys_spec.rb'
89+
- 'spec/lhm/column_with_sql_spec.rb'
90+
91+
# Offense count: 1
92+
# Cop supports --auto-correct.
93+
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
94+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
95+
Style/TrailingCommaInArguments:
96+
Exclude:
97+
- 'spec/departure/runner_spec.rb'
98+
99+
# Offense count: 1
100+
# Cop supports --auto-correct.
101+
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
102+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
103+
Style/TrailingCommaInLiteral:
104+
Exclude:
105+
- 'spec/integration/data_migrations_spec.rb'
106+
107+
# Offense count: 1
108+
# Cop supports --auto-correct.
109+
Style/UnneededInterpolation:
110+
Exclude:
111+
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'

lib/active_record/connection_adapters/percona_adapter.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def adapter
5252
end
5353

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

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

spec/integration/indexes_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Comment < ActiveRecord::Base; end
6767

6868
it 'executes the percona command' do
6969
if ActiveRecord::Base.connection.send(:supports_rename_index?)
70-
expect_percona_command('RENAME INDEX `index_comments_on_some_id_field` TO `new_index_comments_on_some_id_field`')
70+
expect_percona_command('RENAME INDEX `index_comments_on_some_id_field` TO `new_index_comments_on_some_id_field`') # rubocop:disable Metrics/LineLength
7171
else
7272
expect_percona_command('ADD INDEX `new_index_comments_on_some_id_field` (`some_id_field`)')
7373
expect_percona_command('DROP INDEX `index_comments_on_some_id_field`')

0 commit comments

Comments
 (0)