Skip to content

Commit

Permalink
Introduce Reek to our CI build.
Browse files Browse the repository at this point in the history
  • Loading branch information
troessner committed Feb 28, 2016
1 parent c6a9283 commit 40e9c05
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 2 deletions.
85 changes: 85 additions & 0 deletions .todo.reek
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
DuplicateMethodCall:
exclude:
- ActiveModel::Transitions#read_state
- ActiveModel::Transitions#reload
- ActiveModel::Transitions#set_initial_state
- ActiveModel::Transitions#set_initial_state
- Transitions::Event#error_message_for_invalid_transitions
- Transitions::Event#fire
- Transitions::Event#fire
- Transitions::Event#initialize
- Transitions::Event#initialize
- Transitions::Event#update
- Transitions::Machine#handle_event_success_callback
- Transitions::Machine#handle_event_success_callback
- Transitions::Machine#initial_state
- Transitions::State#define_state_query_method
IrresponsibleModule:
exclude:
- ActiveModel::Transitions
- Transitions::Machine
- Transitions::Presenter
- Transitions::State
- Transitions::StateTransition
- Transitions
- Transitions::ClassMethods
- Transitions::InvalidMethodOverride
- Transitions::InvalidTransition
NilCheck:
exclude:
- ActiveModel::Transitions#state_not_set?
- Transitions::Event#timestamp_defined?
- Transitions::StateTransition#execute
- Transitions#current_state
UncommunicativeVariableName:
exclude:
- ActiveModel::Transitions#state_included?
- Transitions::Event#can_execute_transition_from_state?
- Transitions::Event#fire
- Transitions::Event#transitions
- Transitions::Event#transitions_from_state?
- Transitions::Machine#fire_event
- Transitions::StateTransition#executable?
FeatureEnvy:
exclude:
- Transitions::Event#can_execute_transition_from_state?
- Transitions::Event#default_timestamp_name
- Transitions::Event#error_message_for_invalid_transitions
NestedIterators:
exclude:
- Transitions::Event#build_success_callback
TooManyInstanceVariables:
exclude:
- Transitions::Event
- Transitions::Machine
- Transitions::StateTransition
TooManyStatements:
exclude:
- Transitions::Event#build_success_callback
- Transitions::Event#fire
- Transitions::Machine#fire_event
- Transitions#current_state
Attribute:
exclude:
- Transitions::Machine#events
- Transitions::Machine#initial_state
- Transitions::Machine#state_index
- Transitions::Machine#states
DataClump:
exclude:
- Transitions::Machine
LongParameterList:
exclude:
- Transitions::Machine#fire_event
UtilityFunction:
exclude:
- Transitions::Machine#handle_event_failed_callback
- Transitions::Machine#handle_event_fired_callback
- Transitions::StateTransition#perform_guard
BooleanParameter:
exclude:
- Transitions#update_current_state
ControlParameter:
exclude:
- Transitions#update_current_state
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require 'bundler/gem_tasks'
require 'appraisal'
require 'rake/testtask'
require 'rubocop/rake_task'
require 'reek/rake/task'

Rake::TestTask.new(:test) do |test|
test.libs = %w(lib test)
Expand All @@ -15,5 +16,6 @@ RuboCop::RakeTask.new do |task|
task.patterns = ['lib/**/*.rb']
end

task default: :test
task default: :rubocop
Reek::Rake::Task.new

task default: [:test, :reek, :rubocop]
1 change: 1 addition & 0 deletions lib/transitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Transitions
class Event
attr_reader :name, :success, :timestamp

# :reek:TooManyStatements: { max_statements: 13 }
def initialize(machine, name, options = {}, &block)
@machine = machine
@name = name
Expand Down
1 change: 1 addition & 0 deletions transitions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'activerecord', ['>= 3.0', '<= 4.0']
spec.add_development_dependency 'rubocop', '~> 0.36.0'
spec.add_development_dependency 'reek'
end

0 comments on commit 40e9c05

Please sign in to comment.