A Ruby static code analyzer and formatter, based on the community Ruby style guide.
Layout/LeadingCommentSpace
when using #+
or #-
as they are not RDoc comments. (@koic)Bundler/DuplicatedGroup
when groups are duplicated but source
, git
, platforms
, or path
values are different. (@koic)Style/MethodCallWithArgsParentheses
when parentheses are used in one-line in
pattern matching. (@koic)Bundler/DuplicatedGroup
group declaration has keyword option. (@koic)Style/ArgumentsForwarding
cop when forwarding kwargs/block arg and an additional arg. (@ydah)Style/ArgumentsForwarding
cop when not always forwarding block. (@owst)Style/Lambda
when using numbered parameter with a multiline ->
call. (@koic)Style/RedundantParentheses
when parentheses in super
or yield
call with multiline style argument. (@koic)Style/SymbolArray
when %i
array containing unescaped [
, ]
, (
, or )
. (@koic)Style/RedundantSelfAssignmentBranch
to handle heredocs. (@r7kamura)Gem::Requirement
matcher and version parsing to support multiple version constraints. (@ItsEcholot)Bundler/DuplicatedGroup
cop. (@OwlKing)rubocop.formatAutocorrectsAll
execute command. (@koic)Style/RedundantReturn
when returning value with guard clause and return
is used. (@koic)Style/Alias
when EncforcedStyle: prefer_alias
and using alias
with interpolated symbol argument. (@koic)Style/ClassEqualityComparison
when comparing interpolated string class name for equality. (@koic)Style/LambdaCall
when using nested lambda call x.().()
. (@koic)Style/Alias
when EncforcedStyle: prefer_alias_method
and using alias
with interpolated symbol argument. (@koic)Lint/SuppressedException
when AllowNil: true
is set and endless method definition is used. (@koic)Style/ArgumentsForwarding
with additional args/kwargs in def/send nodes. (@owst)Style/SymbolArray
false positives when using square brackets or interpolation in a symbol literal in a percent style array. (@jasondoc3)--fail-level A
ignore non-correctable offenses at :info severity. (@naveg)Style/ReturnNilInPredicateMethodDefinition
when the last method argument in method definition is nil
. (@koic)Lint/UselessAssignment
when a variable is assigned and unreferenced in for
with multiple variables. (@koic)Style/MixinGrouping
when mixin method has no arguments. (@koic)private_class_method
method documentation. (@bigzed)Style/ArgumentsForwarding
when receiver forwards args/kwargs. (@owst)Style/ArgumentsForwarding
for anonymous arg/kwarg forwarding in Ruby 3.2. (@owst)layoutMode
option to run layout cops. (@koic)lintMode
option to run lint cops. (@koic)ReturnNilInPredicateMethodDefinition
aware of nil
at the end of predicate method definition. (@koic)omit_parentheses
style of Style/MethodCallWithArgsParentheses
. (@gsamokovarov)Layout/RedundantLineBreak
when inspecting the %
form string %\n\n
. (@koic)Style/CombinableLoops
when one of the loops is empty. (@fatkodima)Style/StringLiteralsInInterpolation
for symbols with interpolation. (@fatkodima)[]
and ()
with percent symbol arrays. (@jasondoc3)LoadError
when loading RuboCop from a symlinked location on Windows. (@p0deje)Layout/ExtraSpacing
when some characters are vertically aligned. (@koic)Layout/TrailingEmptyLines
to prevent the following incorrect autocorrection when inspecting the %
form string %\n\n
. (@koic)AllCops:Exclude
is empty in .rubocop.yml. (@koic)Lint/RedundantRegexpQuantifiers
when interpolation is used in a regexp literal. (@koic)Layout/SpaceAfterComma
with Layout/SpaceBeforeSemicolon
when autocorrection conflicts. (@koic)Lint/UselessAssignment
when part of a multiple assignment is enclosed in parentheses. (@koic)Metrics/MethodLength
when using a heredoc in a block without block arguments. (@koic)Style/RedundantRegexpArgument
when using safe navigation operator. (@koic)Lint/Debugger
when using debugger method inside lambda. (@koic)Lint/MixedCaseRange
when the number of characters at the start or end of range is other than 1. (@koic)NoMethodError
for built-in language server when an internal error occurs. (@koic)Layout/LineEndStringConcatenationIndentation
when inspecting the %
from string %\n\n
. (@koic)Layout/SpaceAroundOperators
when using unary operator with double colon. (@koic)Style/IfWithSemicolon
when without branch bodies. (@koic)Style/YodaCondition
when equality check method is used without the first argument. (@koic)Style/RedundantRegexpArgument
when using unicode chars. (@koic)Lint/Void
cop for __ENCODING__
constant. (@fatkodima)Style/RedundantCurrentDirectoryInPath
when using string interpolation in require_relative
. (@koic)Style/RedundantRegexpArgument
when using double quote and single quote characters. (@koic)Lint/SymbolConversion
. (@KessaPassa)Lint/MixedCaseRange
cop. (@rwstauner)Lint/RedundantRegexpQuantifiers
cop. (@jaynetics)Style/RedundantCurrentDirectoryInPath
cop. (@koic)Style/RedundantRegexpArgument
cop. (@koic)Style/ReturnNilInPredicateMethodDefinition
cop. (@koic)Style/YAMLFileRead
cop. (@koic)Lint/DuplicateHashKey
when there is a duplicated constant key in the hash literal. (@koic)Style/RedundantSelfAssignmentBranch
when using method chaining or arguments in ternary branch. (@koic)Layout/RedundantLineBreak
when using a line broken string. (@koic)Lint/RedundantRequireStatement
when using PP.pp
. (@koic)Lint/NumberConversion
when using multiple number conversion methods. (@koic)Lint/Void
when CheckForMethodsWithNoSideEffects: true
and using a method definition. (@koic)Style/IdenticalConditionalBranches
when using empty parentheses in the if
branch. (@koic)Style/RedundantStringEscape
when an escaped double quote precedes interpolation in a symbol literal. (@koic)Style/ConditionalAssignment
with an assignment that uses if
branch bodies, which include a block. (@koic)Layout/EmptyLinesAroundExceptionHandlingKeywords
when using Ruby 2.5's rescue
inside block and Ruby 2.7's numbered block. (@koic)Style/RedundantRegexpEscape
string with invalid byte sequence in UTF-8. (@ydah)Lint/DuplicateRegexpCharacterClassElement
. (@rwstauner)Style/SoleNestedConditional
with Style/MethodCallWithArgsParentheses
. (@koic)Lint/InheritException
when class definition has non-constant siblings. (@rafaelfranca)Lint/UselessAssignment
when a variable is assigned and unreferenced in for
. (@koic)Lint/AmbiguousBlockAssociation
. (@koic)Lint/RedundantSafeNavigation
when &.
is used for to_s
, to_i
, to_d
, and other coercion methods. (@lucthev)