Code style checking for RSpec files
RSpec/FilePath
into RSpec/SpecFilePathSuffix
and RSpec/SpecFilePathFormat
. RSpec/FilePath
cop is enabled by default, the two new cops are pending and need to be enabled explicitly. (@ydah)RSpec/Eq
cop. (@ydah)RSpec/MetadataStyle
and RSpec/EmptyMetadata
cops. (@r7kamura)RSpec/Rails/HttpStatus
when have_http_status
with string argument. (@ydah)RSpec/ExcessiveDocstringSpacing
finds a description with non-ASCII leading/trailing whitespace. (@bcgraham)RSpec/ReceiveMessages
when return values declared between stubs. (@marocchino)RSpec/Focus
when chained method call and inside define method. (@ydah)RSpec/ReceiveMessages
when method is only non-word character. (@marocchino)RSpec/ReceiveMessages
when return with splat. (@marocchino)Safe: false
for RSpec/Rails/NegationBeValid
cop. (@ydah)RSpec/ReceiveMessages
. (@bquorning)RSpec/Rails/NegationBeValid
cop. (@ydah)RSpec/ExcessiveDocstringSpacing
when finds description with em space. (@ydah)RSpec/EmptyExampleGroup
when example group with examples defined in if
branch inside iterator. (@ydah)RSpec/ExpectActual
to include the word 'value'. (@corydiamand)RSpec/Pending
when it
without body. (@ydah)RSpec/ReceiveMessages
cop. (@ydah)**/spec/*
instead of spec/*
. (@ydah)AllowedIdentifiers
and AllowedPatterns
configuration option to RSpec/IndexedLet
. (@ydah)RSpec/NamedSubject
when block has no body. (@splattael)RSpec/LetBeforeExamples
autocorrect incompatible with RSpec/ScatteredLet
autocorrect. (@ydah)RSpec/Focus
to support shared_context
and shared_examples
(@tmaier)rubocop-factory_bot
. The rubocop-factory_bot
repository is a dependency of rubocop-rspec
and the factory_bot cops are aliased (RSpec/FactoryBot/Foo
== FactoryBot/Foo
) until v3.0 is released, so the change will be invisible to users until then. (@ydah)RSpec/IndexedLet
with suffixes after index-like numbers. (@pirj)RSpec/Rails/HaveHttpStatus
with comparison with strings containing non-numeric characters. (@ydah)RSpec/MatchArray
when match_array
with no argument. (@ydah)a_block_changing
and changing
for RSpec/ChangeByZero
. (@ydah)RSpec/IndexedLet
cop. (@dmitrytsepelev)RSpec/BeEmpty
cop. (@ydah, @bquorning)RSpec/ScatteredSetup
. (@ydah)be_status
style for RSpec/Rails/HttpStatus
. (@ydah)RSpec/EmptyLineAfterExampleGroup
. (@pirj)RSpec/HaveHttpStatus
when using response.code
. (@ydah)RSpec/Rails/MinitestAssertions
(@mvz)RSpec/DescribedClassModuleWrapping
when RSpec.describe numblock is nested within a module. (@ydah)RSpec/FactoryBot/ConsistentParenthesesStyle
inside &&
, ||
and :?
when omit_parentheses
is on (@dmitrytsepelev)RSpec/PendingWithoutReason
when pending/skip has a reason inside an example group. (@ydah)RSpec/RedundantAround
when redundant numblock around
. (@ydah)RSpec/ContainExactly
to ignore calls with no arguments, and change RSpec/MatchArray
to ignore calls with an empty array literal argument. (@ydah, @bquorning)RSpec/MatchArray
and RSpec/ContainExactly
pending. (@ydah)RSpec/PendingBlockInsideExample
cop. (@ydah)RSpec/RedundantAround
cop. (@r7kamura)RSpec/Rails/TravelAround
cop. (@r7kamura)RSpec/ContainExactly
and RSpec/MatchArray
cops. (@faucct)RSpec/PendingBlockInsideExample
cop to RSpec/SkipBlockInsideExample
. (@pirj)RSpec/ContextWording
when context is interpolated string literal or execute string. (@ydah)RSpec/DescribeMethod
when multi-line describe without #
and .
at the beginning. (@ydah, @pirj)RSpec/VariableName
when inside non-spec code. (@ydah)RSpec/VariableDefinition
when inside non-spec code. (@ydah)RSpec/PendingWithoutReason
when not inside example and pending/skip with block. (@ydah, @pirj)RSpec/PendingWithoutReason
when skip
is passed a block inside example. (@ydah, @pirj)RSpec/VerifiedDoubleReference
when namespaced class. (@ydah)send_pattern
/block_pattern
/numblock_pattern
helpers in favour of using node pattern explicitly. (@pirj, @ydah)rubocop-capybara
version constraint to prevent sudden cop enabling when it hits 3.0. (@pirj)rubocop-capybara
. The rubocop-capybara
repository is a dependency of rubocop-rspec
and the Capybara cops are aliased (RSpec/Capybara/Foo
== Capybara/Foo
) until v3.0 is released, so the change will be invisible to users until then. (@pirj)