Upgrade rubocop to version 0.59.1
Created by: depfu[bot]
We've upgraded a dependency and all tests pass. \o/
name | version specification | new version |
---|---|---|
rubocop | ~> 0.58.0 | 0.59.1 |
You should probably take a good look at this before merging this pull request, of course.
What changed?
✳ ️ rubocop ( → 0.59.1) · Repo · Changelog
Release Notes
0.59.1
Bug fixes
-
#6267: Fix undefined method 'method_name' for
Rails/FindEach
. (@Knack) -
#6278: Fix false positive for
Naming/FileName
when investigating gemspecs. (@kddeisz) -
#6256: Fix false positive for
Naming/FileName
when investigating dotfiles. (@sinsoku) -
#6242: Fix
Style/EmptyCaseCondition
auto-correction removes comment betweencase
and firstwhen
. (@koic) -
#6261: Fix undefined method error for
Style/RedundantBegin
when callingsuper
with a block. (@eitoball) -
#6263: Fix an error
Layout/EmptyLineAfterGuardClause
when guard clause is after heredoc including string interpolation. (@koic) -
#6281: Fix false negative in
Style/MultilineMethodSignature
. (@drenmi) -
#6264: Fix an incorrect autocorrect for
Layout/EmptyLineAfterGuardClause
cop whenif
condition is after heredoc. (@koic)
Changes
-
#6272: Make
Lint/UnreachableCode
detectexit
,exit!
andabort
. (@hoshinotsuyoshi) -
#6295: Exclude
#===
fromNaming/BinaryOperatorParameterName
. (@zverok) - Add
+
to allowed file names ofNaming/FileName
. (@yensaki)
0.59.0
New features
-
#6109: Add new
Bundler/GemComment
cop. (@sunny) -
#6148: Add
IgnoredMethods
option toStyle/NumericPredicate
cop. (@AlexWayfer) -
#6174: Add
--display-only-fail-level-offenses
to only output offenses at or above the fail level. (@robotdana) - Add autocorrect to
Style/For
. (@rrosenblum) -
#6173: Add
AllowImplicitReturn
option toRails/SaveBang
cop. (@robotdana) -
#6218: Add
comparison
style toStyle/NilComparison
. (@khiav223577) - Add new
Style/MultilineMethodSignature
cop. (@drenmi) -
#6234: Add
Performance/ChainArrayAllocation
cop. (@schneems) - #6136: Add remote url in remote url download error message. (@ShockwaveNN)
-
#5659: Make
Layout/EmptyLinesAroundClassBody
aware of specifying a superclass that breaks the line. (@koic)
Bug fixes
- #6107: Fix indentation of multiline postfix conditionals. (@jaredbeck)
-
#6140: Fix
Style/DateTime
not detecting#to_datetime
. It can be configured to allow this. (@bdewater) -
#6132: Fix a false negative for
Naming/FileName
whenInclude
ofAllCops
is the default setting. (@koic) -
#4115: Fix false positive for unary operations in
Layout/MultilineOperationIndentation
. (@jonas054) -
#6127: Fix an error for
Layout/ClosingParenthesisIndentation
when method arguments are empty with newlines. (@tatsuyafw) -
#6152: Fix a false negative for
Layout/AccessModifierIndentation
when using access modifiers with arguments within nested classes. (@gmalette) -
#6124: Fix
Style/IfUnlessModifier
cop for disabledLayout/Tab
cop when there is noIndentationWidth
config. (@AlexWayfer) -
#6133: Fix
AllowURI
option ofMetrics/LineLength
cop for files with tabs indentation. (@AlexWayfer) -
#6164: Fix incorrect autocorrect for
Style/UnneededCondition
when using operator method higher precedence than||
. (@koic) -
#6138: Fix a false positive for assigning a block local variable in
Lint/ShadowedArgument
. (@jonas054) -
#6022: Fix
Layout/MultilineHashBraceLayout
andLayout/MultilineArrayBraceLayout
auto-correct syntax error when there is a comment on the last element. (@bacchir) -
#6175: Fix
Style/BracesAroundHashParameters
auto-correct syntax error when there is a trailing comma. (@bacchir) -
#6192: Make
Style/RedundantBegin
aware of stabby lambdas. (@drenmi) -
#6208: Ignore assignment methods in
Naming/PredicateName
. (@sunny) -
#6196: Fix incorrect autocorrect for
Style/EmptyCaseCondition
when usingreturn
inwhen
clause and assigning the return value ofcase
. (@koic) -
#6142: Ignore keyword arguments in
Rails/Delegate
. (@sunny) -
#6240: Fix an auto-correct error for
Style/WordArray
when settingEnforcedStyle: brackets
and using string interpolation in%W
literal. (@koic) -
#6202: Fix infinite loop when auto-correcting
Lint/RescueEnsureAlignment
whenend
is misaligned. The alignment and message are now based on the beginning position rather than theend
position. (@rrosenblum) -
#6199: Don't recommend
Date
usage inStyle/DateTime
. (@deivid-rodriguez)
Changes
-
#6161: Add scope methods to
Rails/FindEach
cop. Makes the cop also check for the following scopes:eager_load
,includes
,joins
,left_joins
,left_outer_joins
,preload
,references
, andunscoped
. (@repinel) -
#6137: Allow
db
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@mkenyon) - Update the highlighting of
Lint/DuplicateMethods
to include the method name. (@rrosenblum) -
#6057: Return 0 when running
rubocop --auto-gen-conf
if the todo file is successfully created even if there are offenses. (@MagedMilad) -
#4301: Turn off autocorrect for
Rails/RelativeDateConstant
by default. (@koic) -
#4832: Change the path pattern (
*
) to match the hidden file. (@koic) -
Style/For
now highlights the entire statement rather than just the keyword. (@rrosenblum) - Disable
Performance/CaseWhenSplat
and its auto-correction by default. (@rrosenblum) -
#6235: Enable
Layout/EmptyLineAfterGuardClause
cop by default. (@koic) -
#6199:
Style/DateTime
has been moved to disabled by default. (@deivid-rodriguez)
0.58.2
Changes
New features
-
#6105: Support
{a,b}
file name globs inExclude
andInclude
config. (@mikeyhew) -
#6116: Add
ip
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@nijikon)
Bug fixes
-
#6103: Fix a false positive for
Layout/IndentationWidth
when multiple modifiers are used in a block and a method call is made at end of the block. (@koic) -
#6084: Fix
Naming/MemoizedInstanceVariableName
cop to allow methods to have leading underscores. (@kenman345) -
#6098: Fix an error for
Layout/ClassStructure
when there is a comment in the macro method to be auto-correct. (@koic) -
#6115: Fix a false positive for
Lint/OrderedMagicComments
when using{ encoding: Encoding::SJIS }
hash object afterfrozen_string_literal
magic comment. (@koic)
0.58.1
Bug fixes
-
#6071: Fix auto-correct
Style/MethodCallWithArgsParentheses
when arguments are method calls. (@maxh) - Fix
Style/RedundantParentheses
with hash literal as first argument tosuper
. (@maxh) -
#6086: Fix an error for
Gemspec/OrderedDependencies
when using method call to gem names in gemspec. (@koic) -
#6089: Make
Rails/BulkChangeTable
aware of variable table name. (@wata727) -
#6088: Fix an error for
Layout/MultilineAssignmentLayout
cop when using multi-line block defines on separate lines. (@koic) - #6092: Don't use the broken parser 2.5.1.1 version. (@bbatsov)
0.57.2
Bug fixes
-
#5968: Prevent
Layout/ClosingHeredocIndentation
from raising an error on<<
heredocs. (@dvandersluis) -
#5965: Prevent
Layout/ClosingHeredocIndentation
from raising an error on heredocs containing only a newline. (@drenmi) - Prevent a crash in
Layout/IndentationConsistency
cop triggered by an empty expression string interpolation. (@alexander-lazarov) -
#5951: Prevent
Style/MethodCallWithArgsParentheses
from raising an error in certain cases. (@drenmi)
0.57.1
Bug fixes
- #5963: Allow Performance/ReverseEach to apply to any receiver. (@dvandersluis)
-
#5917: Fix erroneous warning for
inherit_mode
directive. (@jonas054) -
#5380: Fix false negative in
Layout/IndentationWidth
when an access modifier section has an invalid indentation body. (@tatsuyafw) -
#5909: Even when a module has no public methods,
Layout/IndentationConsistency
should still register an offense for private methods. (@jaredbeck) -
#5958: Handle empty method body in
Rails/BulkChangeTable
. (@wata727) -
#5954: Make
Style/UnneededCondition
cop accepts a case of condition andif_branch
are same when usingelsif
branch. (@koic)
0.57.0
New features
-
#5881: Add new
Rails/BulkChangeTable
cop. (@wata727) -
#5444: Add new
Style/AccessModifierDeclarations
cop. (@brandonweiss) -
#5803: Add new
Style/UnneededCondition
cop. (@balbesina) -
#5406: Add new
Layout/ClosingHeredocIndentation
cop. (@siggymcfried) -
#5823: Add new
slashes
style toRails/FilePath
since Ruby accepts forward slashes even on Windows. (@sunny) - New cop
Layout/LeadingBlankLines
checks for empty lines at the beginning of a file. (@rrosenblum)
Bug fixes
-
#5897: Fix
Style/SymbolArray
andStyle/WordArray
not working on arrays of size 1. (@TikiTDO) -
#5894: Fix
Rails/AssertNot
to allow it to have failure message. (@koic) -
#5888: Do not register an offense for
headers
orenv
keyword arguments inRails/HttpPositionalArguments
. (@rrosenblum) - Fix the indentation of autocorrected closing squiggly heredocs. (@garettarrowood)
-
#5908: Fix
Style/BracesAroundHashParameters
auto-correct going past the end of the file when the closing curly brace is on the last line of a file. (@EiNSTeiN-) - Fix a bug where
Style/FrozenStringLiteralComment
would be added to the second line if the first line is empty. (@rrosenblum) -
#5914: Make
Layout/SpaceInsideReferenceBrackets
aware ofno_space
when using nested reference brackets. (@koic) -
#5799: Fix false positive in
Style/MixinGrouping
when method namedinclude
accepts block. (@Darhazer)
Changes
-
#5937: Add new
--fix-layout/-x
command line alias. (@scottmatthewman) -
#5887: Remove
Lint/SplatKeywordArguments
cop. (@koic) -
#5761: Add
httpdate
to acceptedRails/TimeZone
methods. (@cupakromer) -
#5899: Add
xmlschema
to acceptedRails/TimeZone
methods. (@koic) -
#5906: Move REPL command from
rake repl
task tobin/console
command. (@koic) -
#5917: Let
inherit_mode
work for default configuration too. (@jonas054) -
#5929: Stop including string extensions from
unicode/display_width
. (@nroman-stripe)
0.56.0
New features
-
#5848: Add new
Performance/InefficientHashSearch
cop. (@JacobEvelyn) -
#5801: Add new
Rails/RefuteMethods
cop. (@koic) -
#5805: Add new
Rails/AssertNot
cop. (@composerinteralia) -
#4136: Allow more robust
Layout/ClosingParenthesisIndentation
detection including method chaining. (@jfelchner) -
#5699: Add
consistent_relative_to_receiver
style option toLayout/FirstParameterIndentation
. (@jfelchner) -
#5821: Support
AR::Migration#up_only
forRails/ReversibleMigration
cop. (@koic) - #5800: Don't show a stracktrace for invalid command-line params. (@shanecav84)
-
#5845: Add new
Lint/ErbNewArguments
cop. (@koic) -
#5871: Add new
Lint/SplatKeywordArguments
cop. (@koic) -
#4247: Remove hard-coded file patterns and use only
Include
,Exclude
and the newRubyInterpreters
parameters for file selection. (@jonas054)
Bug fixes
- Fix bug in
Style/EmptyMethod
which concatenated the method name and first argument if no method def parentheses are used. (@thomasbrus) -
#5819: Fix
Rails/SaveBang
when using negated if. (@Edouard-chin) -
#5286: Fix
Lint/SafeNavigationChain
not detecting chained operators after block. (@Darhazer) - Fix bug where
Lint/SafeNavigationConsistency
registers multiple offenses for the same method call. (@rrosenblum) -
#5713: Fix
Style/CommentAnnotation
reporting only the first of multiple consecutive offending lines. (@svendittmer) -
#5791: Fix exception in
Lint/SafeNavigationConsistency
when there is code around the condition. (@rrosenblum) -
#5784: Fix a false positive for
Rails/HasManyOrHasOneDependent
when using nestedwith_options
. (@koic) -
#4666:
--stdin
always treats input as Ruby source irregardless of filename. (@PointlessOne) - Fix auto-correction for
Style/MethodCallWithArgsParentheses
adding extra parentheses if the method argument was already parenthesized. (@dvandersluis) -
#5668: Fix an issue where files with unknown extensions, listed in
AllCops/Include
were not inspected when passing the file name as an option. (@drenmi) -
#5809: Fix exception
Lint/PercentStringArray
andLint/PercentSymbolArray
when the inspected file is binary encoded. (@akhramov) -
#5840: Do not register an offense for methods that
nil
responds to inLint/SafeNavigationConsistency
. (@rrosenblum) -
#5862: Fix an incorrect auto-correct for
Lint/LiteralInInterpolation
if contains numbers. (@koic) -
#5868: Fix
Rails/CreateTableWithTimestamps
when using hash options. (@wata727) -
#5708: Fix exception in
Lint/UnneededCopEnableDirective
for instruction '# rubocop:enable all'. (@balbesina) - Fix auto-correction of
Rails/HttpPositionalArgumnets
to usesession
instead ofheader
. (@rrosenblum)
Changes
- Split
Style/MethodMissing
into two cops,Style/MethodMissingSuper
andStyle/MissingRespondToMissing
. (@rrosenblum) -
#5757: Add
AllowInMultilineConditions
option toStyle/ParenthesesAroundCondition
cop. (@Darhazer) -
#5806: Fix
Layout/SpaceInsideReferenceBrackets
when assigning a reference bracket to a reference bracket. (@joshuapinter) -
#5082: Allow caching together with
--auto-correct
. (@jonas054) - Add
try!
to the list of whitelisted methods forLint/SafeNavigationChain
andStyle/SafeNavigation
. (@rrosenblum) -
#5886: Move
Style/EmptyLineAfterGuardClause
cop toLayout
department. (@koic)
0.55.0
New features
-
#5753: Add new
Performance/UnneededSort
cop. (@parkerfinch) - Add new
Lint/SafeNavigationConsistency
cop. (@rrosenblum)
Bug fixes
-
#5759: Fix
Performance/RegexpMatch
cop not correcting negated match operator. (@bdewater) -
#5726: Fix false positive for
:class_name
option in Rails/InverseOf cop. (@bdewater) -
#5686: Fix a regression for
Style/SymbolArray
andStyle/WordArray
for multiline Arrays. (@istateside) -
#5730: Stop
Rails/InverseOf
cop allowinginverse_of: nil
to opt-out. (@bdewater) -
#5561: Fix
Lint/ShadowedArgument
false positive with shorthand assignments. (@akhramov) -
#5403: Fix
Naming/HeredocDelimiterNaming
blacklist patterns. (@mcfisch) -
#4298: Fix auto-correction of
Performance/RegexpMatch
to produce code that safe guards against the receiver beingnil
. (@rrosenblum) -
#5738: Make
Rails/HttpStatus
ignoring hash order to fix false negative. (@pocke) -
#5720: Fix false positive for
Style/EmptyLineAfterGuardClause
when guard clause is after heredoc. (@koic) -
#5760: Fix incorrect offense location for
Style/EmptyLineAfterGuardClause
when guard clause is after heredoc argument. (@koic) -
#5764: Fix
Style/Unpackfirst
false positive ofunpack('h*').take(1)
. (@parkerfinch) -
#5766: Update
Style/FrozenStringLiteralComment
auto-correction to insert a new line between the comment and the code. (@rrosenblum) -
#5551: Fix
Lint/Void
not detecting void context in blocks with single expression. (@Darhazer)
Changes
-
#5752: Add
String#delete_{prefix,suffix}
to Lint/Void cop. (@bdewater) -
#5734: Add
by
,on
,in
andat
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@AlexWayfer) -
#5666: Add spaces as an
EnforcedStyle
option toLayout/SpaceInsideParens
, allowing you to enforce spaces inside of parentheses. (@joshuapinter) -
#4257: Allow specifying module name in
Metrics/BlockLength
'sExcludedMethods
configuration option. (@akhramov) -
#4753: Add
IgnoredMethods
option toStyle/MethodCallWithoutArgsParentheses
cop. (@Darhazer) - #4517: Add option to allow trailing whitespaces inside heredoc strings. (@Darhazer)
-
#5652: Make
Style/OptionHash
aware of implicit parameter passing to super. (@Wei-LiangChew) - #5451: When using --auto-gen-config, do not ouput offenses unless the --output-offenses flag is also passed. (@drewpterry)
0.54.0
New features
-
#5597: Add new
Rails/HttpStatus
cop. (@anthony-robin) -
#5643: Add new
Style/UnpackFirst
cop. (@bdewater)
Bug fixes
-
#5683: Fix message for
Naming/UncommunicativeXParamName
cops. (@jlfaber) -
#5680: Fix
Layout/ElseAlignment
forrescue/else/ensure
insidedo/end
blocks. (@YukiJikumaru) -
#5642: Fix
Style/Documentation
:nodoc:
for compact-style nested modules/classes. (@ojab) - #5648: Suggest valid memoized instance variable for predicate method. (@satyap)
- #5670: Suggest valid memoized instance variable for bang method. (@pocke)
-
#5623: Fix
Bundler/OrderedGems
when a group includes duplicate gems. (@colorbox) -
#5633: Fix broken
--fail-fast
. (@mmyoji) -
#5630: Fix false positive for
Style/FormatStringToken
when using placeholder arguments informat
method. (@koic) - #5651: Fix NoMethodError when specified config file that does not exist. (@onk)
- #5647: Fix encoding method of RuboCop::MagicComment::SimpleComment. (@htwroclau)
-
#5619: Do not register an offense in
Style/InverseMethods
when comparing constants with<
,>
,<=
, or>=
. If the code is being used to determine class hierarchy, the correction might not be accurate. (@rrosenblum) -
#5641: Disable
Style/TrivialAccessors
auto-correction fordef
withprivate
. (@pocke) - Fix bug where
Style/SafeNavigation
does not auto-correct all chained methods resulting in aLint/SafeNavigationChain
offense. (@rrosenblum) -
#5436: Allow empty kwrest args in
UncommunicativeName
cops. (@pocke) -
#5674: Fix auto-correction of
Layout/EmptyComment
when the empty comment appears on the same line as code. (@rrosenblum) -
#5679: Fix a false positive for
Style/EmptyLineAfterGuardClause
when guard clause is beforerescue
orensure
. (@koic) - #5694: Match Rails versions with multiple digits when reading the TargetRailsVersion from the bundler lock files. (@roberts1000)
-
#5700: Fix a false positive for
Style/EmptyLineAfterGuardClause
when guard clause is beforeelse
. (@koic) - Fix false positive in
Naming/ConstantName
when using conditional assignment. (@drenmi)
Changes
-
#5626: Change
Naming/UncommunicativeMethodParamName
addto
to allowed names in default config. (@unused) -
#5640: Warn about user configuration overriding other user configuration only with
--debug
. (@jonas054) -
#5637: Fix error for
Layout/SpaceInsideArrayLiteralBrackets
when contains an array literal as an argument after a heredoc is started. (@koic) -
#5498: Correct IndentHeredoc message for Ruby 2.3 when using
<<~
operator with invalid indentation. (@hamada14) -
#5610: Use
gems.locked
orGemfile.lock
to determine the bestTargetRubyVersion
when it is not specified in the config. (@roberts1000) -
#5390: Allow exceptions to
Style/InlineComment
for inline comments which enable or disable rubocop cops. (@jfelchner) - Add progress bar to offenses formatter. (@drewpterry)
-
#5498: Correct
IndentHeredoc
message for Ruby 2.3 when using<<~
operator with invalid indentation. (@hamada14)
Not all release notes shown. View the full release notes
Commits
See the full diff on Github. The new version differs by 38 commits:
Cut 0.59.1
Exclude === from BinaryOperatorParameterName
Fix an error when executing default rake task with `SpecRunner`
Touch up on the previous commit
[Fix #6264] Fix an incorrect autocorrect for `Layout/EmptyLineAfterGuardClause`
`Naming/FileName` allows `+`
Tweak a comment
Extend a bit the documentation for Naming/FileName
Tweak a comment
[Fix #6265] Handle .gemspec files specially in `Naming/FileName`
[Fix #6281] Fix false negative for Style/MultilineMethodSignature
Move SendNode#stabby_lambda? to MethodDispatchNode#lambda_literal?
Use `select` instead of `take_while` to avoid false positives
use `node.descendants` to find the method chain
Fix the `method_chain` method
[Fix #6260] Fix undefined method 'method name' for Rails/FindEach
[Fix #6263] Fix an error for `Layout/EmptyLineAfterGuardClause`
`cat` the entire diff on CI, avoid hanging builds
Documentation checks only need to run once
Copy remaining tasks from .travis.sh to Circle
All Travis tasks are performed also in Circle now
Test Ruby release candidates on CircleCI
Remove unneeded $stderr capturing
Let Appveyor run four separate rake tasks
Generate code coverage report on all spec runs
Subclass TestQueue classes to avoid ARGV hack
Deprecate duplicated rake tasks
Extract a `run_specs` method
Use plain Ruby to implement RSpec Rake tasks
Extract rspec Rake tasks to separate file
[Fix #6261] Fix undefined method `stabby_lambda?` for `Style/RedundantBegin` when calling `super` with a block
Merge pull request #6272 from hoshinotsuyoshi/unreachable_code_detects_exit
Make Lint/UnreachableCode detect 'exit', 'exit!' and 'abort'
[Fix #6242] Fix an incorrect autocorrect for `Style/EmptyCaseCondition`
Fix false positive for `Naming/FileName`
Tweak a bit the manual's homepage
Improve some markup
Extend the "Basic Usage" section of the manual
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase
.