Lint/EndAlignment: AlignWith: variable AllCops: TargetRubyVersion: 2.1 Metrics/AbcSize: Max: 30 Metrics/LineLength: Max: 100 # To make it possible to copy or click on URIs in the code, we allow lines # contaning a URI to be longer than Max. AllowURI: true URISchemes: - http - https Style/AlignHash: EnforcedHashRocketStyle: table EnforcedColonStyle: table Style/CollectionMethods: Enabled: false Style/EmptyLinesAroundBlockBody: Enabled: false Style/MultilineOperationIndentation: EnforcedStyle: indented Style/StringLiterals: EnforcedStyle: double_quotes Style/StringLiteralsInInterpolation: EnforcedStyle: double_quotes Style/WordArray: Enabled: false Style/RegexpLiteral: Enabled: false Style/SignalException: EnforcedStyle: only_raise # Do not require an underscore each three digits. Both 65536 and 65_536 are allowed. Style/NumericLiterals: Enabled: false # no extra indentation for multiline function calls. # Reason is that some legacy ruby API call have a lot of parameters and it makes # looking it ugly. Especially UI constructions with helpers cannot fit into line # lenght. # required style ( and by default forbidden by rubocop ): # # SmartClass.smart_method(boring_parameter1, boring_parameter2, # boring_parameter3, boring_parameter4) # # forbidden style ( require by default by rubocop ) # # SmartClass.smart_method(boring_parameter1, boring_parameter2, # boring_parameter3, boring_parameter4) # Style/AlignParameters: EnforcedStyle: with_fixed_indentation # no extra indentation for case. # We prefer style # case a # when 0 # action_a # when 1 # action_b # else # action_c # end # # before longer and from our POV without advantage style which can confuse as it # indicate double nesting # case a # when 0 # action_a # when 1 # action_b # else # action_c # end Style/CaseIndentation: IndentWhenRelativeTo: end # "unless" has a different connotation than "if not" so disable this check Style/NegatedIf: Enabled: false # allow more than 10 lines for methods as some team member feel unconfortable with it Metrics/MethodLength: Max: 30 # allow more than 100 lines for class as some team member feel unconfortable with it Metrics/ClassLength: Max: 250 # YaST use older rubocop that does not allow predicates by default, # so explicitly allow it for older ones Style/TrivialAccessors: # predicates cannot be done with accessors # Offense, a trivial accessor: # # def favorite_color # @favorite_color # end # # No offense, a predicate: # # def unladen_swallow? # @unladen_swallow # end # AllowPredicates: true # Allow using and/or for driving code flow as its original intention. # Forbid it only in conditionals # So this rule allow something like # # a = action_a or raise "Cannot do a" # # and forbids ( due to confusing operator precedence for work-flow and/or ) # # if a == 5 and b == 6 # Style/AndOr: EnforcedStyle: conditionals # Access modified affect globally all following method definition, so # it deserve bigger visibility then hiddin in method definition block. # for that reason we found better style: # class C # ... # # private # # ... # end # # then style where access modifier can be easier to overlook in longer class: # class C # ... # # private # # ... # end Style/AccessModifierIndentation: EnforcedStyle: outdent # Forcing ascii only comments prevents examples in code that deal with UTF # strings so we allow using it Style/AsciiComments: Enabled: false # YaST code still have to deal with types in component system, so we allow # double negation to enforce boolean value # so this change allow code # # return !!result # Style/DoubleNegation: Enabled: false # Allow block.call: # # def foo(&block) # var = block.call # ... # # is better readable than # # def foo # var = yield # ... # # although it is a bit slower Performance/RedundantBlockCall: Enabled: false # alias method is more convenient method for method aliasing even when in class # context self scope is not so clear # see https://github.com/bbatsov/ruby-style-guide#alias-method-lexically # so force # class C # alias_method :a, :b # # instead of: # class C # alias b a Style/Alias: EnforcedStyle: prefer_alias_method