Fixed Offenses.

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