# Cross-Repository Rubcop conguration based on Owens Corning Ruby Style Guide Layout/LineLength: AutoCorrect: true Max: 120 Metrics/BlockLength: # This exclusion is aimed for RSpec DSL blocks AllowedMethods: ['describe', 'context'] Exclude: - config/routes.rb Metrics/ClassLength: # Matches with requirements for working on legacy code base. Max: 250 Metrics/MethodLength: # Matches with requirements for working on legacy code base. Max: 20 Metrics/AbcSize: # Matches with requirements for working on legacy code base. Max: 25 Metrics/CyclomaticComplexity: # Matches with requirements for working on legacy code base. Max: 12 Naming/MemoizedInstanceVariableName: # There should be clear distionction between explicit instance # variables and memoized method result. Using underscore before # name of the variable makes it less likely to confuse those two. # This convention @_calculate_data also makes it more clear, that # the variable should _not_ be referenced directly. EnforcedStyleForLeadingUnderscores: optional Style/ClassAndModuleChildren: # Our codebase is full of compact style namespaces. We had several issues # following incorrect fix for this cop (mixed Module with Class). Let's # disable this for now, until figure out a better way to introduce this # cop, perhaps with a bit better test coverage. Enabled: false Style/Documentation: # Don't require comments as documentation. # They're optional though. Prefer readable code. Enabled: false Style/DoubleNegation: # Allow double negation. # (If enabled, this Cop warns when we use it.) Enabled: false Style/FrozenStringLiteralComment: # This Cop adds a comment to the top of every file # to enable a new ruby feature: immutable strings. # # The Ruby creator said this feature would be enabled # by default on Ruby 3. # Switching from Ruby 2 to 3 would be painful if the # codebase was not prepared for it, so one way to prepare # was to enable this optional feature. # # However, this plan was canceled. # See https://bugs.ruby-lang.org/issues/11473#note-53 # # Disable the Cop, we can opt-in on a case-by-case basis. Enabled: false Style/NumericLiterals: # It's trivial to fix this issue globally, but the value seems to be minimal. # I am disabling for now, until we decide this is worth pursuing. Enabled: false Style/PercentLiteralDelimiters: Enabled: false Style/StringLiterals: # Allow single or double quotes. # There's times when one or the other makes sense. # Please try to be consistent within the same file, though. Enabled: false # Disabling any kinds of enforcement on Trailing argument, are there # seem to be disagreement on which way we should go. Defaults are # to remove those, but trailing commans in multiline definitions are very # useful, as they help to reduce diff churn and make code reviews easier. # Perhaps we should enforce the trailing on multiline at some later time. # Let's just prevent corrections in the wrong direction for now. Style/TrailingCommaInArguments: # See comment above Enabled: false Style/TrailingCommaInArrayLiteral: # See comment above Enabled: false Style/TrailingCommaInHashLiteral: # See comment above Enabled: false