A Ruby static code analyzer and formatter, based on the community Ruby style guide.
Lint/LiteralAssignmentInCondition
cop. (@koic)Style/SuperWithArgsParentheses
cop. (@koic)Style/ArrayFirstLast
cop. (@fatkodima)Lint/Debugger
when used within method arguments a begin
...end
block. (@koic)Style/Semicolon
when a semicolon at the beginning of a lambda block. (@koic)Lint/FloatComparison
when comparing against zero. (@earlopain)Layout/RescueEnsureAlignment
when aligned rescue
in do
-end
numbered block in a method. (@koic)Layout/SpaceBeforeSemicolon
when a space between an opening lambda brace and a semicolon. (@koic)Style/RedundantDoubleSplatHashBraces
when method call for parenthesized no hash double double splat. (@koic)Naming/BlockForwarding
and Style/ArgumentsForwarding
when autocorrection conflicts for anonymous arguments. (@koic)Layout/RescueEnsureAlignment
when using rescue
in do
...end
block assigned to object attribute. (@koic)Style/CombinableLoops
when looping over the same data for the third consecutive time or more. (@koic)Layout/ExtraSpacing
when a file has exactly two comments. (@eugeneius)Lint/SymbolConversion
when using string interpolation. (@earlopain)Style/RedundantLineContinuation
when redundant line continuations for a block are used, especially without parentheses around first argument. (@koic)Style/RedundantParentheses
when parentheses around logical operator keywords in method definition. (@koic)Style/RedundantReturn
when lambda
(->
) ending with return
. (@koic)Lint/Void
when a collection literal that includes non-literal elements in a method definition. (@koic)Style/MapToHash
with Layout/SingleLineBlockChain
. (@koic)Lint/SafeNavigationChain
when ordinary method chain exists after safe navigation leading dot method call. (@koic)HTMLFormatter
formatter. (@koic)Style/HashEachMethods
aware of safe navigation operator. (@koic)Style/InverseMethods
aware of safe navigation operator. (@koic)Style/MapToHash
aware of safe navigation operator. (@koic)Style/AutoResourceCleanup
aware of Tempfile.open
. (@koic)Lint/RedundantSafeNavigation
to handle conversion methods with defaults. (@fatkodima)Lint/SelfAssignment
to check attribute assignment and key assignment. (@fatkodima)Style/HashEachMethods
aware of unused block value. (@koic)Style/RedundantParentheses
aware of lambda or proc. (@koic)Style/SelfAssignment
aware of %
, ^
, <<
, and >>
operators. (@koic)rubocop-ast
version 1.30 or greater. (@sambostock)EnforcedStyleForRationalLiterals
option for Layout/SpaceAroundOperators
. (@koic)RedundantRestArgumentNames
, RedundantKeywordRestArgumentNames
, and RedundantBlockArgumentNames
options for Style/ArgumentsForwarding
. (@koic)Lint/Void
when each
's receiver is an object of Enumerator
to which filter
has been applied. (@koic)Metrics/ClassLength
when a class with a singleton class definition. (@koic)Style/RedundantDoubleSplatHashBraces
when using double splat hash braces with merge
and method chain. (@koic)Style/RedundantParentheses
when using a parenthesized hash literal as the first argument in a method call without parentheses. (@koic)Style/SingleLineDoEndBlock
when using single line do
...end
with no body. (@koic)Style/HashSyntax
when braced hash key and value are the same and it is used in if
...else
. (@koic)Layout/EndAlignment
when EnforcedStyleAlignWith: variable
and using a conditional statement in a method argument on the same line and end
with method call is not aligned. (@koic)--auto-gen-config
generate inherit_from
correctly inside ERB if
. (@jonas054)base64
gem from runtime dependency. (@koic)Style/IdenticalConditionalBranches
when if
...else
with identical leading lines and using index assign. (@koic)Style/RedundantDoubleSplatHashBraces
when using double splat with a hash literal enclosed in parenthesized ternary operator. (@koic)Lint/EmptyConditionalBody
when missing 2nd if
body with a comment. (@koic)Style/RedundantDoubleSplatHashBraces
when using double splat within block argument containing a hash literal in an array literal. (@koic)Style/SingleArgumentDig
when using some anonymous argument syntax. (@koic)Style/RedundantFilterChain
aware of safe navigation operator. (@koic)Lint/RedundantSafeNavigation
when using snake case constant receiver. (@koic)Layout/MultilineMethodCallIndentation
when usingarithmetic operation with block inside a grouped expression. (@koic)Style/RedundantException
. (@ydah)Layout/MultilineMethodCallIndentation
when multiline method chain with a block argument and method chain. (@ydah)Style/RedundantDoubleSplatHashBraces
when method call for no hash braced double splat receiver. (@koic)Style/RedundantDoubleSplatHashBraces
when using double splat hash braces with merge
method call twice. (@koic)Style/SingleLineDoEndBlock
cop. (@koic)Lint/RedundantSafeNavigation
aware of constant receiver. (@koic)Style/RedundantDoubleSplatHashBraces
aware of merge
methods. (@koic)Lint/Debugger
when using debugger method inside block. (@koic)Metrics/ModuleLength
when defining a singleton class in a module. (@koic)Style/IdenticalConditionalBranches
when if
..else
with identical leading lines and assign to condition value. (@koic)Lint/LiteralInInterpolation
to accept an empty string literal interpolated in words literal. (@knu)Lint/MixedCaseRange
when using nested character class in regexp. (@koic)Style/NestedTernaryOperator
when a ternary operator has a nested ternary operator within an if
. (@koic)Style/MultilineBlockChain
when using multiline block chain with safe navigation operator. (@koic)Style/RedundantParentheses
when using logical or comparison expressions with redundant parentheses. (@koic)Layout/MultilineMethodCallIndentation
when aligning methods in multiline block chain. (@koic)Style/FormatString
's autocorrection when using known conversion methods whose return value is not an array. (@koic)Style/GuardClause
aware of define_method
. (@koic)Style/RedundantFilterChain
aware of select.present?
when ActiveSupportExtensionsEnabled
config is true
. (@koic)Lint/RedundantRequireStatement
as unsafe autocorrect. (@koic)Style/ClassEqualityComparison
. (@koic)Style/RedundantFilterChain
as unsafe autocorrect. (@koic)Layout/EmptyLineAfterGuardClause
when using return
before guard condition with heredoc. (@koic)Lint/OrderedMagicComments
when comment text # encoding: ISO-8859-1
is embedded within example code as source code comment. (@koic)Style/OperatorMethodCall
when using foo bar./ baz
. (@koic)--disable-uncorrectable
command line option when registering an offense is outside a percent array. (@koic)Lint/SafeNavigationChain
when using safe navigation with comparison operator as an expression of logical operator or comparison operator's operand. (@koic)Style/OperatorMethodCall
when using foo./bar
. (@koic)Style/RedundantConditional
when unless/else with boolean results. (@ydah)Layout/MultilineMethodCallIndentation
when using safe navigation operator. (@koic)Layout/LineContinuationLeadingSpace
when a backslash is part of a multiline string literal. (@ymap)Layout/RedundantLineBreak
when using a modified singleton method definition. (@koic)Lint/ToEnumArguments
when using anonymous keyword arguments forwarding. (@koic)Lint/NonAtomicFileOperation
when using FileUtils.remove_dir
, FileUtils.remove_entry
, or FileUtils.remove_entry_secure
. (@koic)Style/ArgumentsForwarding
when method def includes additional kwargs. (@owst)diagnosticProvider
value of LSP. (@koic)Layout/EmptyLineAfterGuardClause
allow :nocov:
directive after guard clause. (@koic)Layout/SpaceAfterNot
when a newline is present after !
. (@ymap)Layout/RedundantLineBreak
when using quoted symbols with a single newline. (@ymap)Layout/SpaceAroundOperators
when aligning operators vertically. (@koic)Style/ArrayIntersect
when using block argument for Enumerable#any?
. (@koic)Style/EmptyCaseCondition
when using return
, break
, next
or method call before empty case condition. (@koic)Bundler/DuplicatedGroup
when there's a duplicate set of groups and the group
value contains a splat. (@koic)Lint/UselessAssignment
when variables are assigned using chained assignment and remain unreferenced. (@koic)Lint/UselessAssignment
when variables are assigned with sequential assignment using the comma operator and unreferenced. (@koic)Style/SoleNestedConditional
when comment is in an empty nested if
body. (@ymap)Style/MultilineTernaryOperator
when returning a multiline ternary operator expression with safe navigation method call. (@koic)Style/ArgumentsForwarding
when there are repeated send nodes. (@owst)Layout/HeredocIndentation
. (@tagliala)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)