Skip to content

Commit

Permalink
Ref #7880: Rubocop fixes update
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed Oct 9, 2014
1 parent d5539d9 commit 3e3ad61
Show file tree
Hide file tree
Showing 77 changed files with 809 additions and 1,343 deletions.
20 changes: 20 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ inherit_from:
- .rubocop_todo.yml
# end TODO

AllCops:
RunRailsCops: false # automatically run rails cops
Exclude:
- test/**/**

MethodLength:
Description: 'Avoid methods longer than 30 lines of code.'
Max: 45 # TODO: set to 30
Expand Down Expand Up @@ -75,3 +80,18 @@ FormatString:

Style/WordArray:
Enabled: false # don't force usage of %w()

Style/LineLength:
Max: 120

Style/GuardClause:
Enabled: false

Style/ClassLength:
Max: 600

Style/CyclomaticComplexity:
Enabled: false

Style/StringLiterals:
Enabled: false
296 changes: 0 additions & 296 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,296 +0,0 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-10-09 10:45:26 -0400 using RuboCop version 0.24.1.
# 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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
Lint/BlockAlignment:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Lint/DeprecatedClassMethods:
Enabled: false

# Offense count: 2
# Configuration parameters: AlignWith, SupportedStyles.
Lint/EndAlignment:
Enabled: false

# Offense count: 10
Lint/HandleExceptions:
Enabled: false

# Offense count: 12
Lint/ParenthesesAsGroupedExpression:
Enabled: false

# Offense count: 8
# Cop supports --auto-correct.
Lint/RescueException:
Enabled: false

# Offense count: 7
# Cop supports --auto-correct.
Lint/StringConversionInInterpolation:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Lint/UnusedBlockArgument:
Enabled: false

# Offense count: 40
# Cop supports --auto-correct.
Lint/UnusedMethodArgument:
Enabled: false

# Offense count: 16
Lint/UselessAssignment:
Enabled: false

# Offense count: 1
Lint/Void:
Enabled: false

# Offense count: 7
Rails/Output:
Enabled: false

# Offense count: 2
Style/AccessorMethodName:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Style/AlignArray:
Enabled: false

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
Style/AlignHash:
Enabled: false

# Offense count: 42
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/BracesAroundHashParameters:
Enabled: false

# Offense count: 5
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
Style/CaseIndentation:
Enabled: false

# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassCheck:
Enabled: false

# Offense count: 3
# Configuration parameters: CountComments.
Style/ClassLength:
Max: 167

# Offense count: 25
Style/ClassVars:
Enabled: false

# Offense count: 32
# Cop supports --auto-correct.
# Configuration parameters: PreferredMethods.
Style/CollectionMethods:
Enabled: false

# Offense count: 1
# Configuration parameters: Keywords.
Style/CommentAnnotation:
Enabled: false

# Offense count: 7
Style/CyclomaticComplexity:
Max: 11

# Offense count: 3
# Cop supports --auto-correct.
Style/DeprecatedHashMethods:
Enabled: false

# Offense count: 1
Style/EachWithObject:
Enabled: false

# Offense count: 65
# Cop supports --auto-correct.
Style/EmptyLines:
Enabled: false

# Offense count: 185
# Cop supports --auto-correct.
Style/EmptyLinesAroundBody:
Enabled: false

# Offense count: 3
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Enabled: false

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/IndentHash:
Enabled: false

# Offense count: 7
# Cop supports --auto-correct.
Style/IndentationConsistency:
Enabled: false

# Offense count: 16
# Cop supports --auto-correct.
Style/IndentationWidth:
Enabled: false

# Offense count: 426
# Configuration parameters: AllowURI.
Style/LineLength:
Max: 149

# Offense count: 15
# Cop supports --auto-correct.
Style/MethodCallParentheses:
Enabled: false

# Offense count: 1
Style/MethodCalledOnDoEndBlock:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/MethodDefParentheses:
Enabled: false

# Offense count: 4
# Configuration parameters: CountComments.
Style/MethodLength:
Max: 45

# Offense count: 2
Style/MultilineBlockChain:
Enabled: false

# Offense count: 4
# Cop supports --auto-correct.
Style/NegatedIf:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Style/NegatedWhile:
Enabled: false

# Offense count: 8
# Cop supports --auto-correct.
Style/NilComparison:
Enabled: false

# Offense count: 3
# Cop supports --auto-correct.
Style/RedundantBegin:
Enabled: false

# Offense count: 1
Style/RegexpLiteral:
MaxSlashes: 0

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Style/Semicolon:
Enabled: false

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/SignalException:
Enabled: false

# Offense count: 33
# Cop supports --auto-correct.
Style/SingleSpaceBeforeFirstArg:
Enabled: false

# Offense count: 7
# Cop supports --auto-correct.
Style/SpaceAfterComma:
Enabled: false

# Offense count: 75
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false

# Offense count: 122
# Cop supports --auto-correct.
Style/SpaceAroundOperators:
Enabled: false

# Offense count: 51
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/SpaceBeforeBlockBraces:
Enabled: false

# Offense count: 95
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
Style/SpaceInsideBlockBraces:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
Style/SpaceInsideBrackets:
Enabled: false

# Offense count: 423
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/StringLiterals:
Enabled: false

# Offense count: 1
Style/Tab:
Enabled: false

# Offense count: 32
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/TrailingBlankLines:
Enabled: false

# Offense count: 24
# Cop supports --auto-correct.
Style/TrailingWhitespace:
Enabled: false

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
Style/TrivialAccessors:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Style/WhileUntilDo:
Enabled: false
20 changes: 10 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rake/testtask"
require 'bundler/gem_tasks'
require 'rake/testtask'

def clear_cassettes
`rm -rf test/fixtures/vcr_cassettes/*.yml`
Expand All @@ -9,9 +9,8 @@ def clear_cassettes
print "Cassettes cleared\n"
end


namespace :test do
"Runs the unit tests"
desc 'Runs the unit tests'
Rake::TestTask.new :unit do |t|
t.pattern = 'test/unit/test_*.rb'
end
Expand All @@ -27,9 +26,9 @@ namespace :test do
options[:logging] = ENV['logging']

if !['new_episodes', 'all', 'none', 'once'].include?(options[:mode])
puts "Invalid test mode"
puts 'Invalid test mode'
else
require "./test/test_runner"
require './test/test_runner'

test_runner = PulpMiniTestRunner.new

Expand All @@ -41,13 +40,13 @@ namespace :test do

clear_cassettes if options[:mode] == 'all' && options[:test_name].nil? && ENV['record'] != 'false'
test_runner.run_tests(task_name, options)
Rake::Task[:update_test_version].invoke if options[:mode] == "all" && ENV['record'] != 'false'
Rake::Task[:update_test_version].invoke if options[:mode] == 'all' && ENV['record'] != 'false'
end
end
end
end

desc "Updats the version of Pulp tested against in README"
desc 'Updats the version of Pulp tested against in README'
task :update_test_version do
text = File.open('README.md').read

Expand All @@ -60,12 +59,12 @@ task :update_test_version do
end
end

desc "Clears out all cassette files"
desc 'Clears out all cassette files'
task :clear_cassettes do
clear_cassettes
end

desc "Runs all tests"
desc 'Runs all tests'
task :test do
Rake::Task['test:unit'].invoke
Rake::Task['test:models'].invoke
Expand All @@ -77,4 +76,5 @@ begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new
rescue
puts "Rubocop not loaded"
end
Loading

0 comments on commit 3e3ad61

Please sign in to comment.