Change Style/VerboseBlock - ExcludeOperators - setting default (#218)

This commit is contained in:
Stephen Dolan 2021-03-24 16:16:51 -04:00 committed by GitHub
parent f4ffb8a287
commit 04ba9cd57a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -92,6 +92,7 @@ module Ameba::Rule::Style
.catch(source).should be_valid .catch(source).should be_valid
rule rule
.tap(&.exclude_prefix_operators = false) .tap(&.exclude_prefix_operators = false)
.tap(&.exclude_operators = false)
.catch(source).should_not be_valid .catch(source).should_not be_valid
end end
@ -190,7 +191,10 @@ module Ameba::Rule::Style
(1..3).map { |i| i.in?(1, *foo, 3, **bar) } (1..3).map { |i| i.in?(1, *foo, 3, **bar) }
(1..3).join(separator: '.') { |i| i.to_s } (1..3).join(separator: '.') { |i| i.to_s }
) )
subject.catch(source).should_not be_valid rule = VerboseBlock.new
rule
.tap(&.exclude_operators = false)
.catch(source).should_not be_valid
source.issues.size.should eq(short_block_variants.size) source.issues.size.should eq(short_block_variants.size)
source.issues.each_with_index do |issue, i| source.issues.each_with_index do |issue, i|

View file

@ -22,7 +22,7 @@ module Ameba::Rule::Style
# ExcludeMultipleLineBlocks: true # ExcludeMultipleLineBlocks: true
# ExcludeCallsWithBlocks: true # ExcludeCallsWithBlocks: true
# ExcludePrefixOperators: true # ExcludePrefixOperators: true
# ExcludeOperators: false # ExcludeOperators: true
# ExcludeSetters: false # ExcludeSetters: false
# MaxLineLength: ~ # MaxLineLength: ~
# MaxLength: 50 # use ~ to disable # MaxLength: 50 # use ~ to disable
@ -34,7 +34,7 @@ module Ameba::Rule::Style
exclude_multiple_line_blocks true exclude_multiple_line_blocks true
exclude_calls_with_block true exclude_calls_with_block true
exclude_prefix_operators true exclude_prefix_operators true
exclude_operators false exclude_operators true
exclude_setters false exclude_setters false
max_line_length : Int32? = nil # 100 max_line_length : Int32? = nil # 100