Add dev deps "rubocop", "rubocop-performance"
This commit is contained in:
parent
0e7aea453c
commit
310a3c412c
3 changed files with 90 additions and 2 deletions
73
.rubocop.yml
Normal file
73
.rubocop.yml
Normal file
|
@ -0,0 +1,73 @@
|
|||
require:
|
||||
- rubocop-performance
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
NewCops: enable
|
||||
DisplayCopNames: true
|
||||
|
||||
Layout/AccessModifierIndentation:
|
||||
EnforcedStyle: outdent
|
||||
|
||||
Layout/LineLength:
|
||||
Max: 80
|
||||
|
||||
# I return a nil value in the beginning of setter
|
||||
# to write it in a single line:
|
||||
#
|
||||
# def foo=(value)
|
||||
# return @foo = nil if value.blank?
|
||||
# # ...
|
||||
# end
|
||||
#
|
||||
Lint/ReturnInVoidContext:
|
||||
Enabled: false
|
||||
|
||||
Metrics/ClassLength:
|
||||
Max: 200
|
||||
|
||||
Performance/MethodObjectAsBlock:
|
||||
Enabled: false
|
||||
|
||||
# Performance/RedundantStringChars:
|
||||
# Enabled: false
|
||||
|
||||
Style/AndOr:
|
||||
EnforcedStyle: conditionals
|
||||
|
||||
Style/ArrayCoercion:
|
||||
Enabled: false
|
||||
|
||||
Style/AsciiComments:
|
||||
Enabled: false
|
||||
|
||||
Style/DoubleNegation:
|
||||
Enabled: false
|
||||
|
||||
Style/HashAsLastArrayItem:
|
||||
Enabled: false
|
||||
|
||||
Style/MixinUsage:
|
||||
Exclude:
|
||||
- 'bin/console'
|
||||
|
||||
Style/PerlBackrefs:
|
||||
Enabled: false
|
||||
|
||||
Style/RegexpLiteral:
|
||||
Enabled: false
|
||||
|
||||
Style/RescueStandardError:
|
||||
EnforcedStyle: implicit
|
||||
|
||||
Style/TrailingCommaInArguments:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
Style/VariableInterpolation:
|
||||
Enabled: false
|
13
Rakefile
13
Rakefile
|
@ -1,3 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'bundler/gem_tasks'
|
||||
|
||||
desc 'Run code analysis tools (RuboCop...)'
|
||||
task lint: :rubocop
|
||||
|
||||
desc 'Fix code style (rubocop --auto-correct)'
|
||||
task fix: 'rubocop:auto_correct'
|
||||
|
||||
begin
|
||||
require 'rubocop/rake_task'
|
||||
RuboCop::RakeTask.new
|
||||
rescue LoadError
|
||||
nil
|
||||
end
|
||||
|
|
|
@ -47,6 +47,8 @@ Gem::Specification.new do |spec|
|
|||
|
||||
spec.extensions << 'ext/digest/extconf.rb'
|
||||
|
||||
spec.add_development_dependency 'bundler', '~> 2.2'
|
||||
spec.add_development_dependency 'rake', '~> 13.0'
|
||||
spec.add_development_dependency 'bundler', '~> 2.2'
|
||||
spec.add_development_dependency 'rake', '~> 13.0'
|
||||
spec.add_development_dependency 'rubocop', '~> 1.7'
|
||||
spec.add_development_dependency 'rubocop-performance', '~> 1.9'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue