Skip to content
Permalink
master
Switch branches/tags
Go to file
Change the setting for internal inspections so that the
Layout/RedundantLineBreak cop does not report multiline blocks. The opinion of
the core team seems to lean towards allowing `do ... end` blocks when the
author feels it's more readable than a single line block with braces.

This commit does not revert any previous changes. That should be done later on
case-by-case basis if desired.
40 contributors

Users who have contributed to this file

@jonas054 @koic @bbatsov @marcandre @Drenmi @pocke @deivid-rodriguez @rrosenblum @backus @bolandrm @yujinakayama @NobodysNightmare
# This is the configuration used to check the rubocop source code.
inherit_from: .rubocop_todo.yml
require:
- rubocop/cop/internal_affairs
- rubocop-performance
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
- '.git/**/*'
- 'bin/*'
TargetRubyVersion: 2.5
SuggestExtensions: false
Naming/PredicateName:
# Method define macros for dynamically generated method.
MethodDefinitionMacros:
- define_method
- define_singleton_method
- def_node_matcher
- def_node_search
Style/AccessorGrouping:
Exclude:
- lib/rubocop/formatter/base_formatter.rb
- lib/rubocop/cop/offense.rb
Style/FormatStringToken:
# Because we parse a lot of source codes from strings. Percent arrays
# look like unannotated format string tokens to this cop.
Exclude:
- spec/**/*
Style/IpAddresses:
# The test for this cop includes strings that would cause offenses
Exclude:
- spec/rubocop/cop/style/ip_addresses_spec.rb
Layout/EndOfLine:
EnforcedStyle: lf
Layout/ClassStructure:
Enabled: true
Layout/RedundantLineBreak:
Enabled: true
Layout/TrailingWhitespace:
AllowInHeredoc: false
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/**/*.rb'
Layout/HashAlignment:
EnforcedHashRocketStyle:
- key
- table
EnforcedColonStyle:
- key
- table
Layout/LineLength:
Max: 100
IgnoredPatterns:
- !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
Lint/InterpolationCheck:
Exclude:
- 'spec/**/*.rb'
Lint/UselessAccessModifier:
MethodCreatingMethods:
- 'def_matcher'
- 'def_node_matcher'
Lint/BooleanSymbol:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'Rakefile'
- '**/*.rake'
- 'spec/**/*.rb'
- '**/*.gemspec'
Metrics/ClassLength:
Exclude:
- lib/rubocop/config_obsoletion.rb
Metrics/ModuleLength:
Exclude:
- 'spec/**/*.rb'
RSpec/FilePath:
Exclude:
- spec/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new_spec.rb
- spec/rubocop/formatter/junit_formatter_spec.rb
RSpec/PredicateMatcher:
EnforcedStyle: explicit
RSpec/MessageSpies:
EnforcedStyle: receive
RSpec/NestedGroups:
Max: 7
RSpec/MultipleMemoizedHelpers:
Enabled: false
Performance/CollectionLiteralInLoop:
Exclude:
- 'Rakefile'
- 'spec/**/*.rb'
Performance/EndWith:
SafeMultiline: false
Performance/StartWith:
SafeMultiline: false
RSpec/StubbedMock:
Enabled: false
InternalAffairs/ExampleDescription:
Include:
- 'spec/rubocop/cop/**/*.rb'