Added Rubocop.
This commit is contained in:
parent
12e2987420
commit
a529d2808a
52
.rubocop.yml
Normal file
52
.rubocop.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
require:
|
||||||
|
- rubocop-performance
|
||||||
|
# - rubocop-rspec
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/SymbolArray:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/WordArray:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# RSpec/DescribedClass:
|
||||||
|
# Enabled: false
|
||||||
|
|
||||||
|
# TODO: Fix these...
|
||||||
|
Style/Documentation:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/GuardClause:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ConditionalAssignment:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ClassAndModuleChildren:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/AssignmentInCondition:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Metrics/ModuleLength:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Layout/LineLength:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Metrics:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/PredicateName:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/AccessorMethodName:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Performance/TimesMap:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# RSpec/BeforeAfterAll:
|
||||||
|
# Enabled: false
|
||||||
15
Rakefile
Normal file
15
Rakefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
require 'bundler/gem_tasks'
|
||||||
|
require 'rspec/core/rake_task'
|
||||||
|
require 'rubocop/rake_task'
|
||||||
|
|
||||||
|
desc('Codestyle check and linter')
|
||||||
|
RuboCop::RakeTask.new('rubocop') do |task|
|
||||||
|
task.fail_on_error = true
|
||||||
|
task.patterns = [
|
||||||
|
'lib/**/*.rb',
|
||||||
|
'spec/**/*.rb'
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
RSpec::Core::RakeTask.new(spec: ['rubocop'])
|
||||||
|
task(default: :spec)
|
||||||
@ -12,3 +12,13 @@ require 'byebug'
|
|||||||
|
|
||||||
Dir[File.dirname(__FILE__) + '/shared/contexts/*.rb'].each {|file| require file }
|
Dir[File.dirname(__FILE__) + '/shared/contexts/*.rb'].each {|file| require file }
|
||||||
Dir[File.dirname(__FILE__) + '/shared/examples/*.rb'].each {|file| require file }
|
Dir[File.dirname(__FILE__) + '/shared/examples/*.rb'].each {|file| require file }
|
||||||
|
|
||||||
|
RSpec.configure do |config|
|
||||||
|
config.mock_with :rspec
|
||||||
|
config.filter_run_when_matching :focus
|
||||||
|
config.disable_monkey_patching!
|
||||||
|
|
||||||
|
config.expect_with :rspec do |c|
|
||||||
|
c.syntax = :expect
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user