Add explanations to cops

This commit is contained in:
Douwe Maan 2017-02-22 13:01:31 -06:00
parent ba0d27fe94
commit cee2f0d456

View file

@ -24,6 +24,7 @@ AllCops:
- 'bin/**/*' - 'bin/**/*'
- 'generator_templates/**/*' - 'generator_templates/**/*'
# Gems in consecutive lines should be alphabetically sorted
Bundler/OrderedGems: Bundler/OrderedGems:
Enabled: false Enabled: false
@ -50,6 +51,8 @@ Style/AlignArray:
Style/AlignHash: Style/AlignHash:
Enabled: true Enabled: true
# Here we check if the parameters on a multi-line method call or
# definition are aligned.
Style/AlignParameters: Style/AlignParameters:
Enabled: false Enabled: false
@ -74,6 +77,7 @@ Style/AsciiIdentifiers:
Style/Attr: Style/Attr:
Enabled: true Enabled: true
# This cop checks if usage of %() or %Q() matches configuration.
Style/BarePercentLiterals: Style/BarePercentLiterals:
Enabled: true Enabled: true
@ -94,9 +98,12 @@ Style/BlockDelimiters:
Style/BlockEndNewline: Style/BlockEndNewline:
Enabled: true Enabled: true
# This cop checks for braces around the last parameter in a method call
# if the last parameter is a hash.
Style/BracesAroundHashParameters: Style/BracesAroundHashParameters:
Enabled: false Enabled: false
# This cop checks for uses of the case equality operator(===).
Style/CaseEquality: Style/CaseEquality:
Enabled: false Enabled: false
@ -128,9 +135,13 @@ Style/ClassMethods:
Style/ClassVars: Style/ClassVars:
Enabled: true Enabled: true
# This cop checks for methods invoked via the :: operator instead
# of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).
Style/ColonMethodCall: Style/ColonMethodCall:
Enabled: true Enabled: true
# This cop checks that comment annotation keywords are written according
# to guidelines.
Style/CommentAnnotation: Style/CommentAnnotation:
Enabled: false Enabled: false
@ -138,6 +149,9 @@ Style/CommentAnnotation:
Style/CommentIndentation: Style/CommentIndentation:
Enabled: true Enabled: true
# Check for `if` and `case` statements where each branch is used for
# assignment to the same variable when using the return of the
# condition can be used instead.
Style/ConditionalAssignment: Style/ConditionalAssignment:
Enabled: true Enabled: true
@ -153,10 +167,14 @@ Style/DefWithParentheses:
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
# This cop checks the . position in multi-line method calls.
Style/DotPosition: Style/DotPosition:
Enabled: true Enabled: true
EnforcedStyle: leading EnforcedStyle: leading
# This cop checks for uses of double negation (!!) to convert something
# to a boolean value. As this is both cryptic and usually redundant, it
# should be avoided.
Style/DoubleNegation: Style/DoubleNegation:
Enabled: false Enabled: false
@ -332,6 +350,8 @@ Style/MultilineOperationIndentation:
Style/MultilineTernaryOperator: Style/MultilineTernaryOperator:
Enabled: true Enabled: true
# This cop checks whether some constant value isn't a
# mutable literal (e.g. array or hash).
Style/MutableConstant: Style/MutableConstant:
Enabled: true Enabled: true
@ -437,6 +457,7 @@ Style/SpaceBeforeComment:
Style/SpaceBeforeSemicolon: Style/SpaceBeforeSemicolon:
Enabled: true Enabled: true
# Checks for spaces inside square brackets.
Style/SpaceInsideBrackets: Style/SpaceInsideBrackets:
Enabled: true Enabled: true
@ -476,6 +497,7 @@ Style/Tab:
Style/TrailingBlankLines: Style/TrailingBlankLines:
Enabled: true Enabled: true
# This cop checks for trailing comma in array and hash literals.
Style/TrailingCommaInLiteral: Style/TrailingCommaInLiteral:
Enabled: false Enabled: false
@ -524,6 +546,7 @@ Metrics/AbcSize:
Enabled: true Enabled: true
Max: 60 Max: 60
# This cop checks if the length of a block exceeds some maximum value.
Metrics/BlockLength: Metrics/BlockLength:
Enabled: false Enabled: false
@ -571,9 +594,13 @@ Metrics/PerceivedComplexity:
Lint/AmbiguousOperator: Lint/AmbiguousOperator:
Enabled: true Enabled: true
# This cop checks for ambiguous regexp literals in the first argument of
# a method invocation without parentheses.
Lint/AmbiguousRegexpLiteral: Lint/AmbiguousRegexpLiteral:
Enabled: false Enabled: false
# This cop checks for assignments in the conditions of
# if/while/until.
Lint/AssignmentInCondition: Lint/AssignmentInCondition:
Enabled: false Enabled: false
@ -638,6 +665,7 @@ Lint/FloatOutOfRange:
Lint/FormatParameterMismatch: Lint/FormatParameterMismatch:
Enabled: true Enabled: true
# This cop checks for *rescue* blocks with no body.
Lint/HandleExceptions: Lint/HandleExceptions:
Enabled: false Enabled: false
@ -664,6 +692,7 @@ Lint/LiteralInCondition:
Lint/LiteralInInterpolation: Lint/LiteralInInterpolation:
Enabled: true Enabled: true
# This cop checks for uses of *begin...end while/until something*.
Lint/Loop: Lint/Loop:
Enabled: false Enabled: false
@ -696,6 +725,8 @@ Lint/RescueException:
Lint/ShadowedException: Lint/ShadowedException:
Enabled: false Enabled: false
# This cop looks for use of the same name as outer local variables
# for block arguments or block local variables.
Lint/ShadowingOuterLocalVariable: Lint/ShadowingOuterLocalVariable:
Enabled: false Enabled: false
@ -707,6 +738,7 @@ Lint/StringConversionInInterpolation:
Lint/UnderscorePrefixedVariableName: Lint/UnderscorePrefixedVariableName:
Enabled: true Enabled: true
# This cop checks for using Fixnum or Bignum constant
Lint/UnifiedInteger: Lint/UnifiedInteger:
Enabled: true Enabled: true
@ -716,6 +748,7 @@ Lint/UnifiedInteger:
Lint/UnneededDisable: Lint/UnneededDisable:
Enabled: false Enabled: false
# This cop checks for unneeded usages of splat expansion
Lint/UnneededSplatExpansion: Lint/UnneededSplatExpansion:
Enabled: false Enabled: false
@ -723,9 +756,11 @@ Lint/UnneededSplatExpansion:
Lint/UnreachableCode: Lint/UnreachableCode:
Enabled: true Enabled: true
# This cop checks for unused block arguments.
Lint/UnusedBlockArgument: Lint/UnusedBlockArgument:
Enabled: false Enabled: false
# This cop checks for unused method arguments.
Lint/UnusedMethodArgument: Lint/UnusedMethodArgument:
Enabled: false Enabled: false
@ -772,12 +807,18 @@ Performance/LstripRstrip:
Performance/RangeInclude: Performance/RangeInclude:
Enabled: true Enabled: true
# This cop identifies the use of a `&block` parameter and `block.call`
# where `yield` would do just as well.
Performance/RedundantBlockCall: Performance/RedundantBlockCall:
Enabled: true Enabled: true
# This cop identifies use of `Regexp#match` or `String#match in a context
# where the integral return value of `=~` would do just as well.
Performance/RedundantMatch: Performance/RedundantMatch:
Enabled: true Enabled: true
# This cop identifies places where `Hash#merge!` can be replaced by
# `Hash#[]=`.
Performance/RedundantMerge: Performance/RedundantMerge:
Enabled: true Enabled: true
MaxKeyValuePairs: 1 MaxKeyValuePairs: 1
@ -803,6 +844,8 @@ Performance/TimesMap:
# Security #################################################################### # Security ####################################################################
# This cop checks for the use of JSON class methods which have potential
# security issues.
Security/JSONLoad: Security/JSONLoad:
Enabled: true Enabled: true
@ -830,9 +873,11 @@ Rails/Date:
Rails/Delegate: Rails/Delegate:
Enabled: true Enabled: true
# This cop checks dynamic `find_by_*` methods.
Rails/DynamicFindBy: Rails/DynamicFindBy:
Enabled: false Enabled: false
# This cop enforces that 'exit' calls are not used within a rails app.
Rails/Exit: Rails/Exit:
Enabled: true Enabled: true
Exclude: Exclude:
@ -851,6 +896,9 @@ Rails/FindEach:
Rails/HasAndBelongsToMany: Rails/HasAndBelongsToMany:
Enabled: true Enabled: true
# This cop is used to identify usages of http methods like `get`, `post`,
# `put`, `patch` without the usage of keyword arguments in your tests and
# change them to use keyword args.
Rails/HttpPositionalArguments: Rails/HttpPositionalArguments:
Enabled: false Enabled: false
@ -863,6 +911,8 @@ Rails/Output:
- 'lib/backup/**/*' - 'lib/backup/**/*'
- 'lib/tasks/**/*' - 'lib/tasks/**/*'
# This cop checks for the use of output safety calls like html_safe and
# raw.
Rails/OutputSafety: Rails/OutputSafety:
Enabled: false Enabled: false
@ -878,9 +928,11 @@ Rails/ReadWriteAttribute:
Rails/ScopeArgs: Rails/ScopeArgs:
Enabled: true Enabled: true
# This cop checks for the use of Time methods without zone.
Rails/TimeZone: Rails/TimeZone:
Enabled: false Enabled: false
# This cop checks for the use of old-style attribute validation macros.
Rails/Validation: Rails/Validation:
Enabled: true Enabled: true
@ -941,15 +993,19 @@ RSpec/Focus:
RSpec/InstanceVariable: RSpec/InstanceVariable:
Enabled: false Enabled: false
# Checks for `subject` definitions that come after `let` definitions.
RSpec/LeadingSubject: RSpec/LeadingSubject:
Enabled: false Enabled: false
# Checks unreferenced `let!` calls being used for test setup.
RSpec/LetSetup: RSpec/LetSetup:
Enabled: false Enabled: false
# Check that chains of messages are not being stubbed.
RSpec/MessageChain: RSpec/MessageChain:
Enabled: false Enabled: false
# Checks that message expectations are set using spies.
RSpec/MessageSpies: RSpec/MessageSpies:
Enabled: false Enabled: false
@ -957,12 +1013,15 @@ RSpec/MessageSpies:
RSpec/MultipleDescribes: RSpec/MultipleDescribes:
Enabled: false Enabled: false
# Checks if examples contain too many `expect` calls.
RSpec/MultipleExpectations: RSpec/MultipleExpectations:
Enabled: false Enabled: false
# Checks for explicitly referenced test subjects.
RSpec/NamedSubject: RSpec/NamedSubject:
Enabled: false Enabled: false
# Checks for nested example groups.
RSpec/NestedGroups: RSpec/NestedGroups:
Enabled: false Enabled: false
@ -971,9 +1030,11 @@ RSpec/NotToNot:
EnforcedStyle: not_to EnforcedStyle: not_to
Enabled: true Enabled: true
# Check for repeated description strings in example groups.
RSpec/RepeatedDescription: RSpec/RepeatedDescription:
Enabled: false Enabled: false
# Checks for stubbed test subjects.
RSpec/SubjectStub: RSpec/SubjectStub:
Enabled: false Enabled: false