Skip to content

Commit

Permalink
Autocorrect Style Rubocop offenses
Browse files Browse the repository at this point in the history
Do not autocorrect Style/FrozenStringLiteralComment as it breaks the
test suite.
  • Loading branch information
Ana06 committed Jan 4, 2019
1 parent 400897a commit 4b6ce32
Show file tree
Hide file tree
Showing 13 changed files with 312 additions and 557 deletions.
242 changes: 2 additions & 240 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-01-04 12:52:42 +0100 using RuboCop version 0.62.0.
# on 2019-01-04 13:30:27 +0100 using RuboCop version 0.62.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
Expand Down Expand Up @@ -114,28 +114,6 @@ Security/YAMLLoad:
Exclude:
- 'Rakefile'

# Offense count: 66
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
# SupportedStyles: line_count_based, semantic, braces_for_chaining
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
# FunctionalMethods: let, let!, subject, watch
# IgnoredMethods: lambda, proc, it
Style/BlockDelimiters:
Exclude:
- 'examples/00-even-numbers/spec/tests.rb'
- 'examples/01-circular_buffer/spec/tests.rb'
- 'test/rantly_test.rb'
- 'test/shrinks_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'test/rantly_test.rb'

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
Expand All @@ -151,19 +129,6 @@ Style/ClassAndModuleChildren:
- 'test/rantly_test.rb'
- 'test/shrinks_test.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/ColonMethodCall:
Exclude:
- 'lib/rantly/shrinks.rb'
- 'test/shrinks_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Dir:
Exclude:
- 'lib/rantly.rb'

# Offense count: 14
Style/Documentation:
Exclude:
Expand All @@ -179,14 +144,6 @@ Style/Documentation:
- 'lib/rantly/spec.rb'
- 'lib/rantly/testunit_extensions.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Exclude:
- 'lib/rantly/silly.rb'

# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
Expand All @@ -200,40 +157,11 @@ Style/GuardClause:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'Gemfile'
- 'lib/rantly/generator.rb'

# Offense count: 6
Style/IdenticalConditionalBranches:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/rantly/shrinks.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
Exclude:
- 'test/shrinks_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'

# Offense count: 27
Style/MultilineBlockChain:
Exclude:
Expand All @@ -246,29 +174,7 @@ Style/MultipleComparison:
Exclude:
- 'test/rantly_test.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: both, prefix, postfix
Style/NegatedIf:
Exclude:
- 'lib/rantly/property.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: MinDigits, Strict.
Style/NumericLiterals:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'

# Offense count: 15
# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Expand All @@ -281,147 +187,3 @@ Style/NumericPredicate:
- 'lib/rantly/shrinks.rb'
- 'test/rantly_test.rb'
- 'test/shrinks_test.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
Style/ParenthesesAroundCondition:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 8
# Cop supports --auto-correct.
Style/Proc:
Exclude:
- 'lib/rantly/silly.rb'
- 'test/rantly_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantConditional:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantException:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/rantly/generator.rb'
- 'lib/rantly/property.rb'
- 'lib/rantly/shrinks.rb'

# Offense count: 27
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'examples/01-circular_buffer/spec/tests.rb'
- 'lib/rantly/generator.rb'
- 'lib/rantly/shrinks.rb'

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: .
# SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars:
EnforcedStyle: use_perl_names

# Offense count: 157
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'Rakefile'
- 'examples/00-even-numbers/spec/tests.rb'
- 'examples/01-circular_buffer/spec/tests.rb'
- 'lib/rantly/generator.rb'
- 'lib/rantly/property.rb'
- 'lib/rantly/shrinks.rb'
- 'lib/rantly/silly.rb'
- 'rantly.gemspec'
- 'test/rantly_test.rb'
- 'test/shrinks_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: respond_to, define_method
Style/SymbolProc:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowNamedUnderscoreVariables.
Style/TrailingUnderscoreVariable:
Exclude:
- 'lib/rantly/shrinks.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
Style/TrivialAccessors:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/UnlessElse:
Exclude:
- 'lib/rantly/generator.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/WhileUntilDo:
Exclude:
- 'lib/rantly/property.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
Exclude:
- 'lib/rantly/shrinks.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

group :development, :test do
gem 'coveralls', '>= 0', :require => false
gem 'coveralls', '>= 0', require: false
gem 'minitest', '~> 5.10.0'
gem 'rake', '~> 12.0.0'
gem 'simplecov', '>= 0'
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rake::RDocTask.new do |rdoc|
config = YAML.load(File.read('VERSION.yml'))
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
else
version = ""
version = ''
end

rdoc.rdoc_dir = 'rdoc'
Expand Down
10 changes: 5 additions & 5 deletions examples/00-even-numbers/spec/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
require 'rantly/rspec_extensions'
require 'rantly/shrinks'

RSpec.describe "my data set" do
it "returns only even numbers" do
property_of {
RSpec.describe 'my data set' do
it 'returns only even numbers' do
property_of do
Deflating.new(array(7) { integer(0..9) })
}.check { |a|
end.check do |a|
expect(a.array).to all(be_even)
}
end
end
end
Loading

0 comments on commit 4b6ce32

Please sign in to comment.