Skip to content

Commit 6a4d443

Browse files
committed
Style/NumericPredicate
1 parent 3f4187e commit 6a4d443

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ Style/GlobalVars:
7878
Style/NumericLiterals:
7979
MinDigits: 20
8080

81-
# Offense count: 2
82-
# Cop supports --auto-correct.
83-
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
84-
# SupportedStyles: predicate, comparison
85-
Style/NumericPredicate:
86-
Exclude:
87-
- 'spec/**/*'
88-
- 'benchmark/setup_db.rb'
89-
- 'lib/mysql2.rb'
90-
9181
# Offense count: 15
9282
# Cop supports --auto-correct.
9383
# Configuration parameters: PreferredDelimiters.
@@ -117,11 +107,3 @@ Style/SignalException:
117107
# SupportedStyles: single_quotes, double_quotes
118108
Style/StringLiterals:
119109
Enabled: false
120-
121-
# Offense count: 1
122-
# Cop supports --auto-correct.
123-
# Configuration parameters: EnforcedStyle, SupportedStyles.
124-
# SupportedStyles: all_comparison_operators, equality_operators_only
125-
Style/YodaCondition:
126-
Exclude:
127-
- 'lib/mysql2.rb'

benchmark/setup_db.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def insert_record(args)
112112
enum_test: %w(val1 val2).sample,
113113
set_test: %w(val1 val2 val1,val2).sample,
114114
)
115-
if n % 100 == 0
115+
if (n % 100).zero?
116116
$stdout.putc '.'
117117
$stdout.flush
118118
end

lib/mysql2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
if dll_path
2525
require 'Win32API'
2626
LoadLibrary = Win32API.new('Kernel32', 'LoadLibrary', ['P'], 'I')
27-
if 0 == LoadLibrary.call(dll_path)
27+
if LoadLibrary.call(dll_path).zero?
2828
abort "Failed to load libmysql.dll from #{dll_path}"
2929
end
3030
end

0 commit comments

Comments
 (0)