1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Merge pull request #991 from airblade/rubocop50

rubocop 0.50.0 (was 0.48.1)
This commit is contained in:
Jared Beck 2017-09-18 23:39:23 -04:00 committed by GitHub
commit b2bf3dd347
3 changed files with 55 additions and 30 deletions

View file

@ -17,6 +17,27 @@ AllCops:
# Set to lowest supported version
TargetRubyVersion: 2.1
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
Layout/DotPosition:
EnforcedStyle: trailing
Layout/IndentHeredoc:
Exclude:
- paper_trail.gemspec
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Use exactly one space on each side of an operator. Do not align operators
# because it makes the code harder to edit, and makes lines unnecessarily long.
Layout/SpaceAroundOperators:
AllowForAlignment: false
# Migrations often contain long up/down methods, and extracting smaller methods
# from these is of questionable value.
Metrics/AbcSize:
@ -47,6 +68,23 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Enabled: false
Naming/FileName:
Exclude:
- Appraisals
# It is a decades-old convention to use EOS as a heredoc delimiter. There is
# not enough value in changinge this convention. SQL should still be used as
# a delimiter when appropriate.
Naming/HeredocDelimiterNaming:
Enabled: false
Naming/PredicateName:
NameWhitelist: has_paper_trail
# In 0.50.0, this cop has a bug https://github.com/bbatsov/rubocop/issues/4732
Performance/HashEachMethods:
Enabled: false
# In an ideal world, each example has a single expectation. In the real world,
# sometimes setup is a pain and you don't want to duplicate setup in multiple
# examples, or make the specs more confusing with many nested `context`s, and
@ -60,26 +98,16 @@ RSpec/MultipleExpectations:
RSpec/ExampleLength:
Enabled: false
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
# Please use semantic style, e.g. `do` when there's a side-effect, else `{}`.
# The semantic style is too nuanced to lint, so the cop is disabled.
Style/BlockDelimiters:
Enabled: false
Style/DotPosition:
EnforcedStyle: trailing
# Use double negation wherever it would otherwise be impractical to convert
# a value to an actual boolean.
Style/DoubleNegation:
Enabled: false
Style/FileName:
Exclude:
- Appraisals
# The decision of when to use a guard clause to improve readability is subtle,
# and it's not clear that it can be linted. Certainly, the default
# `MinBodyLength` of 1 can actually hurt readability.
@ -91,10 +119,6 @@ Style/GuardClause:
Style/IfUnlessModifier:
MaxLineLength: 60
Style/IndentHeredoc:
Exclude:
- paper_trail.gemspec
# The Ruby Style Guide says:
#
# > Use \ instead of + or << to concatenate two string literals at line end.
@ -114,22 +138,8 @@ Style/ModuleFunction:
- 'lib/paper_trail/serializers/json.rb'
- 'lib/paper_trail/serializers/yaml.rb'
Style/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/MultilineOperationIndentation:
EnforcedStyle: indented
Style/PredicateName:
NameWhitelist: has_paper_trail
# The Ruby Style Guide does not prescribe a particular quote character, only
# that a project should pick one and be consistent. The decision has no
# performance implications. Double quotes are slightly easier to read.
Style/StringLiterals:
EnforcedStyle: double_quotes
# Use exactly one space on each side of an operator. Do not align operators
# because it makes the code harder to edit, and makes lines unnecessarily long.
Style/SpaceAroundOperators:
AllowForAlignment: false

View file

@ -3,6 +3,9 @@ require: rubocop-rspec
# Remove these configuration records
# one by one as the offenses are removed from the code base.
Lint/RescueWithoutErrorClass:
Enabled: false
Metrics/AbcSize:
Max: 22 # Goal: 15
@ -18,14 +21,23 @@ Style/FrozenStringLiteralComment:
RSpec/BeforeAfterAll:
Enabled: false
RSpec/ExpectInHook:
Enabled: false
RSpec/FilePath:
Enabled: false
RSpec/HookArgument:
Enabled: false
RSpec/InstanceVariable:
Exclude:
- spec/paper_trail/associations_spec.rb
- spec/paper_trail/model_spec.rb
RSpec/LetBeforeExamples:
Enabled: false
RSpec/MessageSpies:
Enabled: false
@ -37,5 +49,8 @@ RSpec/NestedGroups:
- spec/paper_trail/associations_spec.rb
- spec/paper_trail/model_spec.rb
RSpec/PredicateMatcher:
Enabled: false
Security/YAMLLoad:
Enabled: false

View file

@ -41,8 +41,8 @@ has been destroyed.
s.add_development_dependency "generator_spec", "~> 0.9.3"
s.add_development_dependency "database_cleaner", "~> 1.2"
s.add_development_dependency "pry-byebug", "~> 3.4"
s.add_development_dependency "rubocop", "0.48.1"
s.add_development_dependency "rubocop-rspec", "~> 1.15.0"
s.add_development_dependency "rubocop", "0.50.0"
s.add_development_dependency "rubocop-rspec", "~> 1.17.0"
s.add_development_dependency "timecop", "~> 0.8.0"
s.add_development_dependency "sqlite3", "~> 1.2"
s.add_development_dependency "pg", "~> 0.19.0"