2020-09-11 19:23:14 -04:00
|
|
|
require:
|
|
|
|
- rubocop-packaging
|
|
|
|
- rubocop-rails
|
2018-01-24 01:51:35 -05:00
|
|
|
AllCops:
|
2020-08-29 11:51:21 -04:00
|
|
|
NewCops: disable
|
2018-01-24 01:51:35 -05:00
|
|
|
TargetRubyVersion: 2.4
|
2020-11-03 00:56:49 -05:00
|
|
|
Exclude:
|
|
|
|
- 'gemfiles/*'
|
|
|
|
Bundler/OrderedGems:
|
|
|
|
Include:
|
|
|
|
- '**/Gemfile'
|
2020-08-29 11:51:21 -04:00
|
|
|
Layout/ArgumentAlignment:
|
2015-01-03 20:19:00 -05:00
|
|
|
EnforcedStyle: with_fixed_indentation
|
2019-05-30 02:28:00 -04:00
|
|
|
Layout/CommentIndentation:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Layout/ConditionPosition:
|
|
|
|
Enabled: false
|
|
|
|
Layout/DotPosition:
|
|
|
|
EnforcedStyle: trailing
|
2019-05-30 02:28:00 -04:00
|
|
|
Layout/EmptyLineBetweenDefs:
|
|
|
|
AllowAdjacentOneLineDefs: true
|
2020-08-29 11:51:21 -04:00
|
|
|
Layout/HeredocIndentation:
|
2019-05-30 02:28:00 -04:00
|
|
|
Enabled: false
|
2020-08-29 11:51:21 -04:00
|
|
|
Layout/LineLength:
|
2020-09-06 09:09:31 -04:00
|
|
|
Exclude:
|
|
|
|
- spec/**/*
|
2020-08-29 11:51:21 -04:00
|
|
|
IgnoredPatterns:
|
2020-11-03 00:56:49 -05:00
|
|
|
- !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
|
|
|
|
- !ruby/regexp /\A(require|require_relative) ["']/
|
2020-09-06 09:09:31 -04:00
|
|
|
- '^[ ]*#.+$'
|
|
|
|
- '^[ ]*''.+?'' => ''.+?'',?$'
|
|
|
|
- '^[ ]*".+?" => ".+?",?$'
|
2020-11-03 00:56:49 -05:00
|
|
|
Max: 80
|
2019-01-29 20:49:38 -05:00
|
|
|
Layout/MultilineMethodCallIndentation:
|
|
|
|
EnforcedStyle: indented
|
2020-08-29 11:51:21 -04:00
|
|
|
Layout/ParameterAlignment:
|
|
|
|
EnforcedStyle: with_fixed_indentation
|
2019-05-30 02:28:00 -04:00
|
|
|
Layout/SpaceInLambdaLiteral:
|
|
|
|
EnforcedStyle: require_space
|
2020-09-04 01:05:02 -04:00
|
|
|
Layout/SpaceInsideBlockBraces:
|
|
|
|
Enabled: false
|
2020-09-06 09:09:31 -04:00
|
|
|
Lint/AmbiguousBlockAssociation:
|
|
|
|
Exclude:
|
|
|
|
- spec/**/*
|
2018-09-12 23:33:48 -04:00
|
|
|
Lint/AmbiguousOperator:
|
|
|
|
Enabled: false
|
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Lint/AssignmentInCondition:
|
|
|
|
Enabled: false
|
|
|
|
Lint/DeprecatedClassMethods:
|
|
|
|
Enabled: false
|
|
|
|
Lint/ElseLayout:
|
|
|
|
Enabled: false
|
2019-05-30 02:28:00 -04:00
|
|
|
Lint/FlipFlop:
|
2018-09-12 23:33:48 -04:00
|
|
|
Enabled: false
|
|
|
|
Lint/LiteralInInterpolation:
|
|
|
|
Enabled: false
|
|
|
|
Lint/Loop:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Lint/MissingSuper:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Lint/ParenthesesAsGroupedExpression:
|
|
|
|
Enabled: false
|
|
|
|
Lint/RequireParentheses:
|
|
|
|
Enabled: false
|
2019-07-06 22:25:27 -04:00
|
|
|
Lint/SafeNavigationChain:
|
|
|
|
Enabled: false
|
2020-08-29 11:51:21 -04:00
|
|
|
Lint/SuppressedException:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Lint/UnderscorePrefixedVariableName:
|
|
|
|
Enabled: false
|
|
|
|
Lint/Void:
|
|
|
|
Enabled: false
|
2019-05-30 02:28:00 -04:00
|
|
|
Metrics/AbcSize:
|
2020-11-03 00:56:49 -05:00
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Metrics/BlockLength:
|
|
|
|
Enabled: false
|
|
|
|
Metrics/ClassLength:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Metrics/CyclomaticComplexity:
|
|
|
|
Enabled: false
|
2019-01-29 20:49:38 -05:00
|
|
|
Metrics/MethodLength:
|
|
|
|
Max: 30
|
2020-09-06 09:09:31 -04:00
|
|
|
Metrics/ModuleLength:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- spec/**/*
|
2019-05-30 02:28:00 -04:00
|
|
|
Metrics/ParameterLists:
|
|
|
|
CountKeywordArgs: false
|
|
|
|
Metrics/PerceivedComplexity:
|
2020-11-03 00:56:49 -05:00
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Naming/AccessorMethodName:
|
|
|
|
Enabled: false
|
|
|
|
Naming/AsciiIdentifiers:
|
|
|
|
Enabled: false
|
|
|
|
Naming/BinaryOperatorParameterName:
|
|
|
|
Enabled: false
|
2020-09-04 01:05:02 -04:00
|
|
|
Naming/FileName:
|
|
|
|
Enabled: false
|
2020-09-06 09:09:31 -04:00
|
|
|
Naming/HeredocDelimiterNaming:
|
|
|
|
Enabled: false
|
2019-03-17 18:22:43 -04:00
|
|
|
Naming/MemoizedInstanceVariableName:
|
|
|
|
EnforcedStyleForLeadingUnderscores: required
|
|
|
|
Naming/PredicateName:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Naming/RescuedExceptionsVariableName:
|
|
|
|
Enabled: false
|
2019-06-13 02:28:49 -04:00
|
|
|
Rails/Date:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Rails/Delegate:
|
|
|
|
Enabled: false
|
|
|
|
Rails/HttpPositionalArguments:
|
|
|
|
Enabled: false
|
2020-09-06 09:09:31 -04:00
|
|
|
Rails/SkipsModelValidations:
|
|
|
|
Exclude:
|
|
|
|
- spec/**/*
|
2020-09-04 01:05:02 -04:00
|
|
|
Rails/TimeZone:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/Alias:
|
|
|
|
Enabled: false
|
|
|
|
Style/ArrayJoin:
|
|
|
|
Enabled: false
|
|
|
|
Style/AsciiComments:
|
|
|
|
Enabled: false
|
|
|
|
Style/Attr:
|
|
|
|
Enabled: false
|
2020-09-04 01:05:02 -04:00
|
|
|
Style/BlockDelimiters:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/CaseEquality:
|
|
|
|
Enabled: false
|
|
|
|
Style/CharacterLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Style/ClassAndModuleChildren:
|
|
|
|
Enabled: false
|
2020-09-04 01:05:02 -04:00
|
|
|
Style/ClassVars:
|
|
|
|
Enabled: false
|
2017-02-06 16:06:49 -05:00
|
|
|
Style/CollectionMethods:
|
2019-05-30 02:24:24 -04:00
|
|
|
Enabled: true
|
Rewrite tests for validate_uniqueness_of
* The main problem I had with the old tests is that information that
the reader didn't need to care about was not properly abstracted away.
For instance, a helper method used by almost all tests will always
create a model called Example, and will always use an attribute called
"attr" (on which the validation is present). However, in some tests
the class or attribute is referred to directly. The reader shouldn't
have to care about either of these things, since they are constant --
the tests should be readable enough so that this information is not
necessary to understand the case being tested against.
* Speaking of this helper method, some of the tests used it and some
didn't. Some defined their own helper methods to represent a
particular case (`case_sensitive: true`, `allow_nil`, etc.). This is
now fixed so that all but two tests use the same helper method to
define a model. This model is completely customizable -- one can
specify the type of the attribute being validated, the names and types
of scoped attributes, etc.
* The tests around scoped attributes and different types are all
basically the same, so they are now compressed into a shared context.
* Related to this, we no longer have to worry about setting a proper
value for a scope attribute. One had to know which type that attribute
had and come up with a reasonable default for that type. Now there is
a helper method that worries about this automatically.
* Finally, we remove tests around case_insensitive against an integer
attribute (these don't make any sense, and don't work).
2015-02-08 14:10:23 -05:00
|
|
|
PreferredMethods:
|
|
|
|
collect: map
|
2020-09-04 01:05:02 -04:00
|
|
|
find: detect
|
Rewrite tests for validate_uniqueness_of
* The main problem I had with the old tests is that information that
the reader didn't need to care about was not properly abstracted away.
For instance, a helper method used by almost all tests will always
create a model called Example, and will always use an attribute called
"attr" (on which the validation is present). However, in some tests
the class or attribute is referred to directly. The reader shouldn't
have to care about either of these things, since they are constant --
the tests should be readable enough so that this information is not
necessary to understand the case being tested against.
* Speaking of this helper method, some of the tests used it and some
didn't. Some defined their own helper methods to represent a
particular case (`case_sensitive: true`, `allow_nil`, etc.). This is
now fixed so that all but two tests use the same helper method to
define a model. This model is completely customizable -- one can
specify the type of the attribute being validated, the names and types
of scoped attributes, etc.
* The tests around scoped attributes and different types are all
basically the same, so they are now compressed into a shared context.
* Related to this, we no longer have to worry about setting a proper
value for a scope attribute. One had to know which type that attribute
had and come up with a reasonable default for that type. Now there is
a helper method that worries about this automatically.
* Finally, we remove tests around case_insensitive against an integer
attribute (these don't make any sense, and don't work).
2015-02-08 14:10:23 -05:00
|
|
|
find_all: select
|
2020-09-04 01:05:02 -04:00
|
|
|
reduce: inject
|
|
|
|
Style/ColonMethodCall:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/CommentAnnotation:
|
|
|
|
Enabled: false
|
|
|
|
Style/Documentation:
|
|
|
|
Enabled: false
|
|
|
|
Style/DoubleNegation:
|
|
|
|
Enabled: false
|
|
|
|
Style/EachWithObject:
|
|
|
|
Enabled: false
|
2019-07-06 22:25:27 -04:00
|
|
|
Style/EmptyElse:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/EmptyLiteral:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Style/EmptyMethod:
|
|
|
|
EnforcedStyle: expanded
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/Encoding:
|
|
|
|
Enabled: false
|
|
|
|
Style/EvenOdd:
|
|
|
|
Enabled: false
|
|
|
|
Style/FormatString:
|
|
|
|
Enabled: false
|
2020-09-06 09:09:31 -04:00
|
|
|
Style/FormatStringToken:
|
|
|
|
EnforcedStyle: template
|
2017-02-06 16:06:49 -05:00
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/GlobalVars:
|
|
|
|
Enabled: false
|
|
|
|
Style/GuardClause:
|
|
|
|
Enabled: false
|
|
|
|
Style/IfUnlessModifier:
|
|
|
|
Enabled: false
|
|
|
|
Style/IfWithSemicolon:
|
|
|
|
Enabled: false
|
|
|
|
Style/InlineComment:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Style/InverseMethods:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/Lambda:
|
|
|
|
Enabled: false
|
|
|
|
Style/LambdaCall:
|
|
|
|
Enabled: false
|
|
|
|
Style/LineEndConcatenation:
|
|
|
|
Enabled: false
|
|
|
|
Style/MethodCalledOnDoEndBlock:
|
|
|
|
Enabled: false
|
|
|
|
Style/ModuleFunction:
|
|
|
|
Enabled: false
|
|
|
|
Style/NegatedIf:
|
|
|
|
Enabled: false
|
|
|
|
Style/NegatedWhile:
|
|
|
|
Enabled: false
|
|
|
|
Style/Next:
|
|
|
|
Enabled: false
|
|
|
|
Style/NilComparison:
|
|
|
|
Enabled: false
|
|
|
|
Style/Not:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericPredicate:
|
|
|
|
Enabled: false
|
|
|
|
Style/OneLineConditional:
|
|
|
|
Enabled: false
|
2020-11-03 00:56:49 -05:00
|
|
|
Style/OptionalBooleanParameter:
|
|
|
|
Enabled: false
|
2019-06-13 02:28:49 -04:00
|
|
|
Style/ParenthesesAroundCondition:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/PercentLiteralDelimiters:
|
|
|
|
Enabled: false
|
|
|
|
Style/PerlBackrefs:
|
|
|
|
Enabled: false
|
|
|
|
Style/PreferredHashMethods:
|
|
|
|
Enabled: false
|
|
|
|
Style/Proc:
|
|
|
|
Enabled: false
|
|
|
|
Style/RaiseArgs:
|
|
|
|
Enabled: false
|
|
|
|
Style/RegexpLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Style/SelfAssignment:
|
|
|
|
Enabled: false
|
|
|
|
Style/SignalException:
|
|
|
|
Enabled: false
|
|
|
|
Style/SingleLineBlockParams:
|
|
|
|
Enabled: false
|
|
|
|
Style/SingleLineMethods:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpecialGlobalVars:
|
|
|
|
Enabled: false
|
2017-02-06 16:06:49 -05:00
|
|
|
Style/StringLiterals:
|
|
|
|
EnforcedStyle: single_quotes
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/SymbolArray:
|
|
|
|
Enabled: false
|
|
|
|
Style/TrailingCommaInArguments:
|
|
|
|
EnforcedStyleForMultiline: consistent_comma
|
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
EnforcedStyleForMultiline: consistent_comma
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
|
|
|
EnforcedStyleForMultiline: consistent_comma
|
|
|
|
Style/TrivialAccessors:
|
|
|
|
Enabled: false
|
2020-09-04 01:05:02 -04:00
|
|
|
Style/VariableInterpolation:
|
|
|
|
Enabled: false
|
2018-09-12 23:33:48 -04:00
|
|
|
Style/WhenThen:
|
|
|
|
Enabled: false
|
|
|
|
Style/WhileUntilModifier:
|
|
|
|
Enabled: false
|
|
|
|
Style/WordArray:
|
|
|
|
Enabled: false
|