|
|
|
@ -4,6 +4,24 @@ AllCops:
|
|
|
|
|
- '**/Rakefile' |
|
|
|
|
UseCache: true |
|
|
|
|
|
|
|
|
|
Layout/LineLength: |
|
|
|
|
Description: Limit lines to 80 characters. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits |
|
|
|
|
Enabled: true |
|
|
|
|
Max: 100 |
|
|
|
|
AllowURI: true |
|
|
|
|
URISchemes: |
|
|
|
|
- http |
|
|
|
|
- https |
|
|
|
|
Layout/DotPosition: |
|
|
|
|
Description: Checks the position of the dot in multi-line method calls. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains |
|
|
|
|
Enabled: true |
|
|
|
|
EnforcedStyle: trailing |
|
|
|
|
SupportedStyles: |
|
|
|
|
- leading |
|
|
|
|
- trailing |
|
|
|
|
|
|
|
|
|
Lint/AssignmentInCondition: |
|
|
|
|
Description: Don't use assignment in conditions. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition |
|
|
|
@ -12,11 +30,11 @@ Lint/AssignmentInCondition:
|
|
|
|
|
Lint/EachWithObjectArgument: |
|
|
|
|
Description: Check for immutable argument given to each_with_object. |
|
|
|
|
Enabled: true |
|
|
|
|
Lint/HandleExceptions: |
|
|
|
|
Lint/SuppressedException: |
|
|
|
|
Description: Don't suppress exception. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions |
|
|
|
|
Enabled: true |
|
|
|
|
Lint/LiteralInCondition: |
|
|
|
|
Lint/LiteralAsCondition: |
|
|
|
|
Description: Checks of literals used in conditions. |
|
|
|
|
Enabled: true |
|
|
|
|
Lint/LiteralInInterpolation: |
|
|
|
@ -46,15 +64,6 @@ Metrics/CyclomaticComplexity:
|
|
|
|
|
cases needed to validate a method. |
|
|
|
|
Enabled: true |
|
|
|
|
Max: 6 |
|
|
|
|
Metrics/LineLength: |
|
|
|
|
Description: Limit lines to 80 characters. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits |
|
|
|
|
Enabled: true |
|
|
|
|
Max: 100 |
|
|
|
|
AllowURI: true |
|
|
|
|
URISchemes: |
|
|
|
|
- http |
|
|
|
|
- https |
|
|
|
|
Metrics/MethodLength: |
|
|
|
|
Description: Avoid methods longer than 10 lines of code. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods |
|
|
|
@ -82,21 +91,27 @@ Metrics/PerceivedComplexity:
|
|
|
|
|
Enabled: true |
|
|
|
|
Max: 7 |
|
|
|
|
|
|
|
|
|
Rails/ScopeArgs: |
|
|
|
|
Description: Checks the arguments of ActiveRecord scopes. |
|
|
|
|
Naming/AccessorMethodName: |
|
|
|
|
Description: Check the naming of accessor methods for get_/set_. |
|
|
|
|
Enabled: false |
|
|
|
|
Naming/FileName: |
|
|
|
|
Description: Use snake_case for source file names. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files |
|
|
|
|
Enabled: true |
|
|
|
|
Rails/TimeZone: |
|
|
|
|
# The value `strict` means that `Time` should be used with `zone`. |
|
|
|
|
# The value `flexible` allows usage of `in_time_zone` instead of `zone`. |
|
|
|
|
Exclude: [] |
|
|
|
|
Naming/PredicateName: |
|
|
|
|
Description: Check the names of predicate methods. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark |
|
|
|
|
Enabled: true |
|
|
|
|
EnforcedStyle: flexible |
|
|
|
|
SupportedStyles: |
|
|
|
|
- strict |
|
|
|
|
- flexible |
|
|
|
|
NamePrefix: |
|
|
|
|
- is_ |
|
|
|
|
- has_ |
|
|
|
|
- have_ |
|
|
|
|
ForbiddenPrefixes: |
|
|
|
|
- is_ |
|
|
|
|
Exclude: |
|
|
|
|
- spec/**/* |
|
|
|
|
|
|
|
|
|
Style/AccessorMethodName: |
|
|
|
|
Description: Check the naming of accessor methods for get_/set_. |
|
|
|
|
Enabled: false |
|
|
|
|
Style/AndOr: |
|
|
|
|
Description: Use &&/|| instead of and/or. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or |
|
|
|
@ -127,14 +142,6 @@ Style/CollectionMethods:
|
|
|
|
|
Style/Documentation: |
|
|
|
|
Description: Document classes and non-namespace modules. |
|
|
|
|
Enabled: false |
|
|
|
|
Style/DotPosition: |
|
|
|
|
Description: Checks the position of the dot in multi-line method calls. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains |
|
|
|
|
Enabled: true |
|
|
|
|
EnforcedStyle: trailing |
|
|
|
|
SupportedStyles: |
|
|
|
|
- leading |
|
|
|
|
- trailing |
|
|
|
|
Style/DoubleNegation: |
|
|
|
|
Description: Checks for uses of double negation (!!). |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang |
|
|
|
@ -146,11 +153,6 @@ Style/EmptyLiteral:
|
|
|
|
|
Description: Prefer literals to Array.new/Hash.new/String.new. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash |
|
|
|
|
Enabled: true |
|
|
|
|
Style/FileName: |
|
|
|
|
Description: Use snake_case for source file names. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files |
|
|
|
|
Enabled: true |
|
|
|
|
Exclude: [] |
|
|
|
|
Style/GuardClause: |
|
|
|
|
Description: Check for conditionals that can be replaced with guard clauses |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals |
|
|
|
@ -160,7 +162,6 @@ Style/IfUnlessModifier:
|
|
|
|
|
Description: Favor modifier if/unless usage when you have a single-line body. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier |
|
|
|
|
Enabled: false |
|
|
|
|
MaxLineLength: 80 |
|
|
|
|
Style/InlineComment: |
|
|
|
|
Description: Avoid inline comments. |
|
|
|
|
Enabled: false |
|
|
|
@ -193,18 +194,6 @@ Style/PerlBackrefs:
|
|
|
|
|
Description: Avoid Perl-style regex back references. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers |
|
|
|
|
Enabled: false |
|
|
|
|
Style/PredicateName: |
|
|
|
|
Description: Check the names of predicate methods. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark |
|
|
|
|
Enabled: true |
|
|
|
|
NamePrefix: |
|
|
|
|
- is_ |
|
|
|
|
- has_ |
|
|
|
|
- have_ |
|
|
|
|
NamePrefixBlacklist: |
|
|
|
|
- is_ |
|
|
|
|
Exclude: |
|
|
|
|
- spec/**/* |
|
|
|
|
Style/RaiseArgs: |
|
|
|
|
Description: Checks the arguments passed to raise/fail. |
|
|
|
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages |
|
|
|
@ -272,7 +261,16 @@ Style/TrailingCommaInArguments:
|
|
|
|
|
- comma |
|
|
|
|
- consistent_comma |
|
|
|
|
- no_comma |
|
|
|
|
Style/TrailingCommaInLiteral: |
|
|
|
|
Style/TrailingCommaInArrayLiteral: |
|
|
|
|
Description: 'Checks for trailing comma in array and hash literals.' |
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' |
|
|
|
|
Enabled: true |
|
|
|
|
EnforcedStyleForMultiline: no_comma |
|
|
|
|
SupportedStyles: |
|
|
|
|
- comma |
|
|
|
|
- consistent_comma |
|
|
|
|
- no_comma |
|
|
|
|
Style/TrailingCommaInHashLiteral: |
|
|
|
|
Description: 'Checks for trailing comma in array and hash literals.' |
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' |
|
|
|
|
Enabled: true |
|
|
|
|