Skip to content

Commit

Permalink
Fix new Rubocop failures as of version 0.48.0
Browse files Browse the repository at this point in the history
This also adds a little bit of organization to the .rubocop.yml
configuration file. I also moved some specific rule exceptions out of
.rubocop.yml into the code itself.
  • Loading branch information
laserlemon committed Mar 31, 2017
1 parent 3458d12 commit 31efe66
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
46 changes: 21 additions & 25 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
Style/StringLiterals:
EnforcedStyle: double_quotes
# This should always correspond to the required Ruby version specified in the
# gemspec.
AllCops:
TargetRubyVersion: 2.0

# TODO: What should we do here?
Style/FrozenStringLiteralComment:
Enabled: false

# Allow some style changes in specs
Metrics/ModuleLength:
# Allow some style changes in the specs.
AmbiguousBlockAssociation:
Exclude:
- spec/**/*
Metrics/BlockLength:
Exclude:
- spec/**/*
Style/BlockDelimiters:
Metrics/ModuleLength:
Exclude:
- spec/**/*
Style/RescueModifier:
Style/BlockDelimiters:
Exclude:
- spec/**/*
Metrics/MethodLength:
Exclude:
- spec/interactor/hooks_spec.rb
Style/IndentArray:
Exclude:
- spec/integration_spec.rb
- spec/interactor/hooks_spec.rb

# Allow nice tree-like comments in specs
Style/AsciiComments:
Exclude:
- spec/integration_spec.rb

# Here inconsistent indentation helps to understand
# tree nature of callbacks.
# Here, inconsistent indentation helps to understand tree nature of callbacks.
Style/AlignArray:
Exclude:
- spec/integration_spec.rb

# This could be removed if throws are used instead of
# raising Failure in #fail!
# TODO: Remove when throw is used rather than raise in Interactor::Context.fail!
Lint/HandleExceptions:
Exclude:
- lib/interactor.rb
Style/RescueModifier:
Exclude:
- spec/**/*

# These style conventions are personal preference.
Style/EmptyMethod:
Enabled: false

AllCops:
TargetRubyVersion: 2.0
Style/IndentArray:
EnforcedStyle: consistent
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/SymbolArray:
Enabled: false
1 change: 1 addition & 0 deletions interactor.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8

require "English"

Gem::Specification.new do |spec|
Expand Down
4 changes: 4 additions & 0 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def unexpected_error!
organizer
end

# rubocop:disable Style/AsciiComments
#
# organizer
# ├─ organizer2
# │ ├─ interactor2a
Expand All @@ -33,6 +35,8 @@ def unexpected_error!
# │ ├─ interactor4b
# │ └─ interactor4c
# └─ interactor5
#
# rubocop:enable Style/AsciiComments

let(:organizer) {
interactors = [organizer2, interactor3, organizer4, interactor5]
Expand Down
2 changes: 1 addition & 1 deletion spec/interactor/hooks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Interactor
describe Hooks do
describe "#with_hooks" do
def build_hooked(&block)
def build_hooked(&block) # rubocop:disable Metrics/MethodLength
hooked = Class.new.send(:include, Interactor::Hooks)

hooked.class_eval do
Expand Down

0 comments on commit 31efe66

Please sign in to comment.