Kapil Sachdev
b7e02184d9
fix(rubocop): Fix Layout/LineLength
...
- bump rubocop to v1.0
- Fix Layout/MultilineAssignmentLayout and other remaining offences
- Exculde appraisal generated gemfiles in rubocop
- Replace NON_NUMERIC_VALUE constant with instance method against
failing test case in rails <= 5.1 and postgres adapter.
This is a defect in rails where a frozen string is modified in
https://github.com/rails/rails/blob/v5.1.7/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb#L25
2020-11-03 10:05:25 -07:00
Kapil Sachdev
3e88500318
fix(rubocop): Fix Style, Layout, Lint and other offenses [ci skip]
...
Updated Layout/LineLength cop to Max 120 lenght and ignore everything
inside specs/**/*
Added rules for below cops in .rubocop.yml
Lint/AmbiguousBlockAssociation
Naming/HeredocDelimiterNaming
Rails/SkipsModelValidations
Style/FormatStringToken
Fixed below mentioned cops:
- Layout/CaseIndentation
- Layout/DotPosition
- Layout/ElseAlignment
- Layout/IndentationWidth
- Layout/LineLength
- Layout/MultilineBlockLayout
- Layout/MultilineOperationIndentation
- Lint/AmbiguousBlockAssociation
- Lint/MissingCopEnableDirective
- Lint/NestedMethodDefinition
- Lint/RedundantCopDisableDirective
- Lint/RedundantRequireStatement
- Lint/UnusedBlockArgument
- Lint/UnusedMethodArgument
- Metrics/ModuleLength
- Naming/MemoizedInstanceVariableName
- Naming/RescuedExceptionsVariableName
- Rails/Output
- Rails/Presence
- Security/Eval
- Security/Open
- Style/ClassCheck
- Style/CollectionMethods
- Style/ConditionalAssignment
- Style/EvalWithLocation
- Style/FormatStringToken
- Style/InverseMethods
- Style/MutableConstant
- Style/ParallelAssignment
- Style/RedundantBegin
- Style/RedundantCondition
- Style/RedundantInterpolation
- Style/RedundantSelf
- Style/RedundantSort
- Style/RescueStandardError
- Style/SafeNavigation
- Style/StringLiteralsInInterpolation
- Style/SymbolProc
2020-11-03 10:05:25 -07:00
Kapil Sachdev
ee1008de7a
fix(rubocop): Fix Layout related offenses [ci skip]
...
- Layout/EmptyLines
- Layout/EmptyLineAfterGuardClause
- Layout/TrailingEmptyLines
- Layout/EmptyLinesAroundBlockBody
- Layout/EmptyLinesAroundModuleBody
- Layout/EmptyLineAfterMagicComment
- Layout/SpaceInsidePercentLiteralDelimiters
- Layout/SpaceAroundEqualsInParameterDefault
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/LeadingCommentSpace
- Layout/SpaceBeforeComment
- Layout/SpaceAroundOperators
- Layout/SpaceInsideRangeLiteral
- Layout/SpaceInsideReferenceBrackets
- Layout/SpaceInLambdaLiteral
- Layout/SpaceAfterComma
- Layout/SpaceInsideHashLiteralBraces
- Layout/TrailingWhitespace
- Layout/ArgumentAlignment
- Layout/HashAlignment
- Layout/DotPosition
- Layout/IndentationWidth
- Layout/EndAlignment
- Layout/MultilineOperationIndentation
- Layout/IndentationConsistency
- Layout/ClosingHeredocIndentation
- Layout/MultilineMethodCallBrace- Layout
- Layout/ClosingParenthesisIndentation
2020-11-03 10:05:25 -07:00
Kapil Sachdev
cdcef128cf
fix(rubocop): Add trailing comma in args, Hash and Arrays [ci skip]
...
- Satisfies Style/TrailingCommaInArguments,
Style/TrailingCommaInArrayLiteral and Style/TrailingCommaInHashLiteral
2020-11-03 10:05:25 -07:00
Elliot Winkler
e0a0200fe4
Make independent matchers really independent
...
Why:
* When `delegate_method` was modified a while back to add Doublespeak
and use MatcherContext, Shoulda::Matchers::Independent became unable
to be required independently.
To satisfy the above:
* Require Doublespeak and MatcherContext within
`delegate_method_matcher.rb`.
* Add an acceptance test to ensure that Independent stays independent.
Secondary-Author: jc00ke <jesse@jc00ke.com>
2015-10-01 10:12:17 -06:00
Lucas D'Avila
721900b8fd
Allow the use of matchers from multiple libs, for non rails projects.
...
* It changes shoulda-matchers to allow the integration with multiple
libraries like active_model and active_record.
For example, in a non Rails project isn't possible to use both
validate_presence_of and validate_uniqueness_of matchers, because they
are from different libraries (one from active_model and the other from
active_record respectively).
This change allow the integration with multiple libraries. fixes #710
2015-06-01 00:43:07 -06:00
Elliot Winkler
190007155e
Remove auto-detection of Rails / test framework
2015-02-09 10:52:51 -07:00