AllCops: DisplayCopNames: true TargetRubyVersion: 2.3 Exclude: # generated by rails/binstubs - 'bin/**/*' # auto generated by rails # Config files - 'Guardfile' - 'Dangerfile' # 3rd party - 'vendor/**/*' Style/Documentation: Enabled: false Style/BlockDelimiters: Exclude: # we like the `let(:foo) {}` syntax in specs - 'spec/**/*.rb' Style/ClassAndModuleChildren: EnforcedStyle: compact Style/FormatStringToken: EnforcedStyle: template Metrics/BlockLength: Exclude: # config files where we expect long blocks - 'danger-wm.gemspec' # spec files that might have a big describe - 'spec/**/*.rb' # dsl files https://stackoverflow.com/a/41187163 Metrics/MethodLength: Max: 15 Exclude: # DSL files where we expect to have long methods Metrics/ModuleLength: Exclude: - 'lib/wm/utils.rb' - 'spec/**/*.rb' Performance/HashEachMethods: Exclude: - 'spec/**/*.rb' Performance/UnfreezeString: Exclude: - 'spec/**/*.rb' Style/BracesAroundHashParameters: Enabled: false Lint/AssignmentInCondition: Enabled: false Style/EmptyMethod: EnforcedStyle: expanded Style/Alias: EnforcedStyle: prefer_alias_method Style/NumericPredicate: EnforcedStyle: comparison Style/RegexpLiteral: Enabled: false # Danger uses the 'fail' keyword for reporting errors Style/SignalException: Enabled: false Layout/AlignParameters: EnforcedStyle: with_fixed_indentation Layout/IndentHash: EnforcedStyle: consistent Layout/AlignHash: # allow coder to get around alignment rules by explicitly defining the hash param EnforcedLastArgumentHashStyle: ignore_explicit Layout/MultilineMethodCallIndentation: EnforcedStyle: indented Layout/MultilineOperationIndentation: EnforcedStyle: indented # These are all the cops that are disabled in the default configuration. Layout/FirstArrayElementLineBreak: Description: >- Checks for a line break before the first element in a multi-line array. Enabled: true Layout/FirstHashElementLineBreak: Description: >- Checks for a line break before the first element in a multi-line hash. Enabled: true Layout/FirstMethodArgumentLineBreak: Description: >- Checks for a line break before the first argument in a multi-line method call. Enabled: false Layout/FirstMethodParameterLineBreak: Description: >- Checks for a line break before the first parameter in a multi-line method parameter definition. Enabled: true Layout/MultilineAssignmentLayout: Description: 'Check for a newline after the assignment operator in multi-line assignments.' StyleGuide: '#indent-conditional-assignment' Enabled: true Lint/UnneededDisable: Exclude: - 'spec/fixtures/**/*' Lint/MissingCopEnableDirective: Exclude: - 'spec/fixtures/**/*' Style/AutoResourceCleanup: Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).' Enabled: true Style/CollectionMethods: Description: 'Preferred collection methods.' StyleGuide: '#map-find-select-reduce-size' Enabled: true Style/Copyright: Description: 'Include a copyright notice in each file before any code.' Enabled: false Style/DocumentationMethod: Description: 'Public methods.' Enabled: false Exclude: - 'spec/**/*' - 'test/**/*' Style/ImplicitRuntimeError: Description: >- Use `raise` or `fail` with an explicit exception class and message, rather than just a message. Enabled: true Style/InlineComment: Description: 'Avoid trailing inline comments.' Enabled: true Style/Lambda: EnforcedStyle: literal Style/MethodCallWithArgsParentheses: Description: 'Use parentheses for method calls with arguments.' StyleGuide: '#method-invocation-parens' Enabled: false Style/MethodCalledOnDoEndBlock: Description: 'Avoid chaining a method call on a do...end block.' StyleGuide: '#single-line-blocks' Enabled: true Exclude: - 'spec/**/*' Style/MissingElse: Description: >- Require if/case expressions to have an else branches. If enabled, it is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This will conflict with Style/EmptyElse if Style/EmptyElse is configured to style "both" Enabled: false EnforcedStyle: both SupportedStyles: # if - warn when an if expression is missing an else branch # case - warn when a case expression is missing an else branch # both - warn when an if or case expression is missing an else branch - if - case - both Style/OptionHash: Description: "Don't use option hashes when you can use keyword arguments." Enabled: false Style/ReturnNil: Description: 'Use return instead of return nil.' Enabled: true Style/Send: Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.' StyleGuide: '#prefer-public-send' Enabled: true Exclude: - 'spec/**/*' Style/StringMethods: Description: 'Checks if configured preferred methods are used over non-preferred.' Enabled: false Style/SingleLineBlockParams: Description: 'Enforces the names of some block params.' Enabled: false