Fixed Offenses.

Added coveralls and code climate gems.
parent 82d7ac53
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-01-19 23:11:26 +0100 using RuboCop version 0.36.0.
# on 2016-01-19 23:50:34 +0100 using RuboCop version 0.36.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
......@@ -96,7 +96,7 @@ Metrics/BlockNesting:
Metrics/CyclomaticComplexity:
Max: 36
# Offense count: 290
# Offense count: 292
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
......@@ -110,7 +110,7 @@ Metrics/MethodLength:
# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 491
Max: 493
# Offense count: 9
Metrics/PerceivedComplexity:
......@@ -344,7 +344,7 @@ Style/FormatString:
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 6
# Offense count: 5
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
......@@ -439,11 +439,6 @@ Style/MultilineMethodCallIndentation:
Style/MultilineOperationIndentation:
Enabled: false
# Offense count: 1
Style/MultilineTernaryOperator:
Exclude:
- 'lib/annotate/annotate_models.rb'
# Offense count: 21
# Cop supports --auto-correct.
Style/MutableConstant:
......@@ -703,7 +698,7 @@ Style/SpaceInsideStringInterpolation:
Style/SpecialGlobalVars:
EnforcedStyle: use_perl_names
# Offense count: 363
# Offense count: 357
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
......
......@@ -17,6 +17,8 @@ group :development, :test do
gem 'terminal-notifier-guard', require: false
gem 'simplecov', require: false
gem 'rubocop', require: false unless RUBY_VERSION =~ /^1.8/
gem 'coveralls'
gem 'codeclimate-test-reporter'
platforms :mri do
gem 'pry', require: false
......
......@@ -375,12 +375,14 @@ module AnnotateModels
old_content.sub!(magic_comment_matcher, '')
old_content.sub!(PATTERN, '')
new_content = %w(after bottom).include?(options[position].to_s) ?
(magic_comments.join + (old_content.rstrip + "\n\n" + wrapped_info_block)) :
(magic_comments.join + wrapped_info_block + "\n" + old_content)
if %w(after bottom).include?(options[position].to_s)
new_content = magic_comments.join + (old_content.rstrip + "\n\n" + wrapped_info_block)
else
new_content = magic_comments.join + wrapped_info_block + "\n" + old_content
end
end
File.open(file_name, "wb") { |f| f.puts new_content }
File.open(file_name, 'wb') { |f| f.puts new_content }
return true
end
else
......@@ -391,14 +393,13 @@ module AnnotateModels
def remove_annotation_of_file(file_name)
if File.exist?(file_name)
content = File.read(file_name)
content.sub!(PATTERN, '')
File.open(file_name, "wb") { |f| f.puts content }
File.open(file_name, 'wb') { |f| f.puts content }
return true
true
else
return false
false
end
end
......
require 'coveralls'
require 'codeclimate-test-reporter'
require 'simplecov'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
Coveralls::SimpleCov::Formatter,
SimpleCov::Formatter::HTMLFormatter,
CodeClimate::TestReporter::Formatter
]
SimpleCov.start
require 'rubygems'
......@@ -21,10 +30,7 @@ module Annotate
module Integration
ABSOLUTE_GEM_ROOT=File.expand_path('../../', __FILE__)
CRUFT_PATTERNS=[
"%SCENARIO%/bin/*", "%SCENARIO%/log/*", "%SCENARIO%/tmp/*",
"%SCENARIO%/.bundle"
]
CRUFT_PATTERNS= %w(%SCENARIO%/bin/* %SCENARIO%/log/* %SCENARIO%/tmp/* %SCENARIO%/.bundle)
SCENARIO_HOME=File.join(File.dirname(__FILE__), 'integration')
SCENARIOS=Dir.glob("#{SCENARIO_HOME}/*").
select { |candidate| File.directory?(candidate) }.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment