AllCops: Exclude: - 'db/schema.rb' - 'db/seeds.rb' ## Lint Lint/AmbiguousBlockAssociation: Enabled: false ## Metrics Metrics/AbcSize: # The ABC size is a calculated magnitude, so this number can be a Fixnum or # a Float. Max: 20 Metrics/BlockLength: Description: 'Avoid long blocks with many lines.' Enabled: false Metrics/LineLength: Max: 100 ## Performance Performance/RegexpMatch: Enabled: false ## Style Style/BlockDelimiters: EnforcedStyle: line_count_based SupportedStyles: # The `line_count_based` style enforces braces around single line blocks and # do..end around multi-line blocks. - line_count_based # The `semantic` style enforces braces around functional blocks, where the # primary purpose of the block is to return a value and do..end for # procedural blocks, where the primary purpose of the block is its # side-effects. # # This looks at the usage of a block's method to determine its type (e.g. is # the result of a `map` assigned to a variable or passed to another # method) but exceptions are permitted in the `ProceduralMethods`, # `FunctionalMethods` and `IgnoredMethods` sections below. - semantic # The `braces_for_chaining` style enforces braces around single line blocks # and do..end around multi-line blocks, except for multi-line blocks whose # return value is being chained with another method (in which case braces # are enforced). - braces_for_chaining ProceduralMethods: # Methods that are known to be procedural in nature but look functional from # their usage, e.g. # # time = Benchmark.realtime do # foo.bar # end # # Here, the return value of the block is discarded but the return value of # `Benchmark.realtime` is used. - benchmark - bm - bmbm - create - each_with_object - measure - new - realtime - tap - with_object FunctionalMethods: # Methods that are known to be functional in nature but look procedural from # their usage, e.g. # # let(:foo) { Foo.new } # # Here, the return value of `Foo.new` is used to define a `foo` helper but # doesn't appear to be used from the return value of `let`. - let - let! - subject - watch IgnoredMethods: # Methods that can be either procedural or functional and cannot be # categorised from their usage alone, e.g. # # foo = lambda do |x| # puts "Hello, #{x}" # end # # foo = lambda do |x| # x * 100 # end # # Here, it is impossible to tell from the return value of `lambda` whether # the inner block's return value is significant. - lambda - proc - it Style/Documentation: Description: 'Document classes and non-namespace modules.' Enabled: false Exclude: - 'spec/**/*' - 'test/**/*' # Multi-line method chaining should be done with trailing dots. Style/DotPosition: EnforcedStyle: leading SupportedStyles: - leading - trailing Style/DoubleNegation: Description: 'Avoid the use of double negation (`!!`).' Enabled: false Style/FileName: Enabled: false Style/FrozenStringLiteralComment: Enabled: false Style/MultilineBlockChain: Description: 'Avoid multi-line chains of blocks.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' Enabled: false Style/MutableConstant: Description: 'Do not assign mutable objects to constants.' Enabled: false Style/SafeNavigation: Enabled: false