.rubocop.yml in nanoc-4.8.5 vs .rubocop.yml in nanoc-4.8.6

- old
+ new

@@ -3,81 +3,74 @@ AllCops: TargetRubyVersion: 2.3 DisplayCopNames: true # We use filenames such as “create-site.rb” that translate to method names. -FileName: +Naming/FileName: Exclude: - 'lib/nanoc/cli/commands/*.rb' - - 'Appraisals' -# A common pattern in tests is to define anonymous classes in which methods are defined, which trips -# up Rubocop’s nested method definition cop. -Lint/NestedMethodDefinition: - Exclude: - - 'test/**/*.rb' - - 'spec/**/*.rb' - -# This is used in tests, to verify the effect of state-changing functions. -Style/GlobalVars: - Exclude: - - 'test/**/*.rb' - Style/TrailingCommaInArguments: EnforcedStyleForMultiline: comma Style/TrailingCommaInLiteral: EnforcedStyleForMultiline: comma +Layout/IndentArray: + EnforcedStyle: consistent + + + +# ----- CONFIGURED (exceptions for tests) ----- + +# This breaks RSpec on occasion, e.g. `expect { subject }.not_to change { foo }`, +# and generally does not provide useful warnings +Lint/AmbiguousBlockAssociation: + Exclude: + - 'spec/**/*.rb' + # `rescue nil` is useful in specs where the exception is not important, but # the size effects are. Style/RescueModifier: Exclude: - 'spec/**/*.rb' -Layout/IndentArray: - EnforcedStyle: consistent +# A common pattern in tests is to define anonymous classes in which methods are defined, which trips +# up Rubocop’s nested method definition cop. +Lint/NestedMethodDefinition: + Exclude: + - 'test/**/*.rb' + - 'spec/**/*.rb' -Lint/DuplicateMethods: +# This is used in tests, to verify the effect of state-changing functions. +Style/GlobalVars: Exclude: - - 'test/data_sources/test_filesystem.rb' - - 'spec/spec_helper.rb' + - 'test/**/*.rb' -# This needs to be fixed in Ruby 2.4. -Lint/UnifiedInteger: - Enabled: false -Layout/IndentHeredoc: - EnforcedStyle: squiggly -# This breaks RSpec on occasion, e.g. `expect { subject }.not_to change { foo }`, -# and generally does not provide useful warnings -Lint/AmbiguousBlockAssociation: - Enabled: false - # ----- TO ENABLE LATER ----- # Valid cops, but fixing the offenses they report is non-trivial. -RegexpLiteral: +Style/RegexpLiteral: Enabled: false -ClassAndModuleChildren: +Style/ClassAndModuleChildren: Enabled: false Style/EmptyElse: Enabled: false Style/Next: Enabled: false +# This cop is broken (#4731, #4745) +Style/SafeNavigation: + Enabled: false - -# ----- DISABLED (hard) ----- - -# Rubocop trips up on this. -Layout/LeadingCommentSpace: +Naming/HeredocDelimiterNaming: Enabled: false # ----- DISABLED (security) ----- @@ -96,10 +89,11 @@ - 'spec/**/*.rb' - 'lib/nanoc/base/entities/code_snippet.rb' - 'lib/nanoc/filters/erubi.rb' + # ----- DISABLED (metrics) ----- # Cops for metrics are disabled because they should not cause tests to fail. Metrics/AbcSize: @@ -136,39 +130,38 @@ # ----- DISABLED (opinionated) ----- # We should embrace UTF-8, not avoid it. Since the Encoding cop is enabled, # there’s no point in enforcing ASCII comments. -AsciiComments: +Style/AsciiComments: Enabled: false # It does not make sense to enforce everything to have documentation. -Documentation: +Style/Documentation: Enabled: false # Nanoc suppresses exceptions for valid reasons in a few cases. -HandleExceptions: +Lint/HandleExceptions: Enabled: false # if/unless at the end of the line makes it too easy to oversee. -IfUnlessModifier: +Style/IfUnlessModifier: Enabled: false # Personal preference is to have decent constructors for exceptions rather than # just a class and a message. -RaiseArgs: +Style/RaiseArgs: Enabled: false -# Personal preference is to use `raise` to signal exceptions (normal control -# flow should not use exceptions anyway). -SignalException: - Enabled: false - # Some methods that appear to be accessors (return a single value or set a # single value) should still not be considered to be accessors. This is a purely # semantic difference. -TrivialAccessors: +Style/TrivialAccessors: Enabled: false # This does not always semantically make sense. -GuardClause: +Style/GuardClause: + Enabled: false + +# Used for “undo work, whatever error happens” +Lint/RescueWithoutErrorClass: Enabled: false