Upgrade rubocop to version 0.59.1 #409
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've upgraded a dependency and all tests pass. \o/
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
Rails/FindEach. (@Knack)Naming/FileNamewhen investigating gemspecs. (@kddeisz)Naming/FileNamewhen investigating dotfiles. (@sinsoku)Style/EmptyCaseConditionauto-correction removes comment betweencaseand firstwhen. (@koic)Style/RedundantBeginwhen callingsuperwith a block. (@eitoball)Layout/EmptyLineAfterGuardClausewhen guard clause is after heredoc including string interpolation. (@koic)Style/MultilineMethodSignature. (@drenmi)Layout/EmptyLineAfterGuardClausecop whenifcondition is after heredoc. (@koic)Changes
Lint/UnreachableCodedetectexit,exit!andabort. (@hoshinotsuyoshi)#===fromNaming/BinaryOperatorParameterName. (@zverok)+to allowed file names ofNaming/FileName. (@yensaki)0.59.0
New features
Bundler/GemCommentcop. (@sunny)IgnoredMethodsoption toStyle/NumericPredicatecop. (@AlexWayfer)--display-only-fail-level-offensesto only output offenses at or above the fail level. (@robotdana)Style/For. (@rrosenblum)AllowImplicitReturnoption toRails/SaveBangcop. (@robotdana)comparisonstyle toStyle/NilComparison. (@khiav223577)Style/MultilineMethodSignaturecop. (@drenmi)Performance/ChainArrayAllocationcop. (@schneems)Layout/EmptyLinesAroundClassBodyaware of specifying a superclass that breaks the line. (@koic)Bug fixes
Style/DateTimenot detecting#to_datetime. It can be configured to allow this. (@bdewater)Naming/FileNamewhenIncludeofAllCopsis the default setting. (@koic)Layout/MultilineOperationIndentation. (@jonas054)Layout/ClosingParenthesisIndentationwhen method arguments are empty with newlines. (@tatsuyafw)Layout/AccessModifierIndentationwhen using access modifiers with arguments within nested classes. (@gmalette)Style/IfUnlessModifiercop for disabledLayout/Tabcop when there is noIndentationWidthconfig. (@AlexWayfer)AllowURIoption ofMetrics/LineLengthcop for files with tabs indentation. (@AlexWayfer)Style/UnneededConditionwhen using operator method higher precedence than||. (@koic)Lint/ShadowedArgument. (@jonas054)Layout/MultilineHashBraceLayoutandLayout/MultilineArrayBraceLayoutauto-correct syntax error when there is a comment on the last element. (@bacchir)Style/BracesAroundHashParametersauto-correct syntax error when there is a trailing comma. (@bacchir)Style/RedundantBeginaware of stabby lambdas. (@drenmi)Naming/PredicateName. (@sunny)Style/EmptyCaseConditionwhen usingreturninwhenclause and assigning the return value ofcase. (@koic)Rails/Delegate. (@sunny)Style/WordArraywhen settingEnforcedStyle: bracketsand using string interpolation in%Wliteral. (@koic)Lint/RescueEnsureAlignmentwhenendis misaligned. The alignment and message are now based on the beginning position rather than theendposition. (@rrosenblum)Dateusage inStyle/DateTime. (@deivid-rodriguez)Changes
Rails/FindEachcop. Makes the cop also check for the following scopes:eager_load,includes,joins,left_joins,left_outer_joins,preload,references, andunscoped. (@repinel)dbto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@mkenyon)Lint/DuplicateMethodsto include the method name. (@rrosenblum)rubocop --auto-gen-confif the todo file is successfully created even if there are offenses. (@MagedMilad)Rails/RelativeDateConstantby default. (@koic)*) to match the hidden file. (@koic)Style/Fornow highlights the entire statement rather than just the keyword. (@rrosenblum)Performance/CaseWhenSplatand its auto-correction by default. (@rrosenblum)Layout/EmptyLineAfterGuardClausecop by default. (@koic)Style/DateTimehas been moved to disabled by default. (@deivid-rodriguez)0.58.2
Changes
New features
#6105: Support
{a,b}file name globs inExcludeandIncludeconfig. (@mikeyhew)#6116: Add
ipto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@nijikon)Bug fixes
Layout/IndentationWidthwhen multiple modifiers are used in a block and a method call is made at end of the block. (@koic)Naming/MemoizedInstanceVariableNamecop to allow methods to have leading underscores. (@kenman345)Layout/ClassStructurewhen there is a comment in the macro method to be auto-correct. (@koic)Lint/OrderedMagicCommentswhen using{ encoding: Encoding::SJIS }hash object afterfrozen_string_literalmagic comment. (@koic)0.58.1
Bug fixes
Style/MethodCallWithArgsParentheseswhen arguments are method calls. (@maxh)Style/RedundantParentheseswith hash literal as first argument tosuper. (@maxh)Gemspec/OrderedDependencieswhen using method call to gem names in gemspec. (@koic)Rails/BulkChangeTableaware of variable table name. (@wata727)Layout/MultilineAssignmentLayoutcop when using multi-line block defines on separate lines. (@koic)0.57.2
Bug fixes
Layout/ClosingHeredocIndentationfrom raising an error on<<heredocs. (@dvandersluis)Layout/ClosingHeredocIndentationfrom raising an error on heredocs containing only a newline. (@drenmi)Layout/IndentationConsistencycop triggered by an empty expression string interpolation. (@alexander-lazarov)Style/MethodCallWithArgsParenthesesfrom raising an error in certain cases. (@drenmi)0.57.1
Bug fixes
inherit_modedirective. (@jonas054)Layout/IndentationWidthwhen an access modifier section has an invalid indentation body. (@tatsuyafw)Layout/IndentationConsistencyshould still register an offense for private methods. (@jaredbeck)Rails/BulkChangeTable. (@wata727)Style/UnneededConditioncop accepts a case of condition andif_branchare same when usingelsifbranch. (@koic)0.57.0
New features
Rails/BulkChangeTablecop. (@wata727)Style/AccessModifierDeclarationscop. (@brandonweiss)Style/UnneededConditioncop. (@balbesina)Layout/ClosingHeredocIndentationcop. (@siggymcfried)slashesstyle toRails/FilePathsince Ruby accepts forward slashes even on Windows. (@sunny)Layout/LeadingBlankLineschecks for empty lines at the beginning of a file. (@rrosenblum)Bug fixes
Style/SymbolArrayandStyle/WordArraynot working on arrays of size 1. (@TikiTDO)Rails/AssertNotto allow it to have failure message. (@koic)headersorenvkeyword arguments inRails/HttpPositionalArguments. (@rrosenblum)Style/BracesAroundHashParametersauto-correct going past the end of the file when the closing curly brace is on the last line of a file. (@EiNSTeiN-)Style/FrozenStringLiteralCommentwould be added to the second line if the first line is empty. (@rrosenblum)Layout/SpaceInsideReferenceBracketsaware ofno_spacewhen using nested reference brackets. (@koic)Style/MixinGroupingwhen method namedincludeaccepts block. (@Darhazer)Changes
--fix-layout/-xcommand line alias. (@scottmatthewman)Lint/SplatKeywordArgumentscop. (@koic)httpdateto acceptedRails/TimeZonemethods. (@cupakromer)xmlschemato acceptedRails/TimeZonemethods. (@koic)rake repltask tobin/consolecommand. (@koic)inherit_modework for default configuration too. (@jonas054)unicode/display_width. (@nroman-stripe)0.56.0
New features
Performance/InefficientHashSearchcop. (@JacobEvelyn)Rails/RefuteMethodscop. (@koic)Rails/AssertNotcop. (@composerinteralia)Layout/ClosingParenthesisIndentationdetection including method chaining. (@jfelchner)consistent_relative_to_receiverstyle option toLayout/FirstParameterIndentation. (@jfelchner)AR::Migration#up_onlyforRails/ReversibleMigrationcop. (@koic)Lint/ErbNewArgumentscop. (@koic)Lint/SplatKeywordArgumentscop. (@koic)Include,Excludeand the newRubyInterpretersparameters for file selection. (@jonas054)Bug fixes
Style/EmptyMethodwhich concatenated the method name and first argument if no method def parentheses are used. (@thomasbrus)Rails/SaveBangwhen using negated if. (@Edouard-chin)Lint/SafeNavigationChainnot detecting chained operators after block. (@Darhazer)Lint/SafeNavigationConsistencyregisters multiple offenses for the same method call. (@rrosenblum)Style/CommentAnnotationreporting only the first of multiple consecutive offending lines. (@svendittmer)Lint/SafeNavigationConsistencywhen there is code around the condition. (@rrosenblum)Rails/HasManyOrHasOneDependentwhen using nestedwith_options. (@koic)--stdinalways treats input as Ruby source irregardless of filename. (@PointlessOne)Style/MethodCallWithArgsParenthesesadding extra parentheses if the method argument was already parenthesized. (@dvandersluis)AllCops/Includewere not inspected when passing the file name as an option. (@drenmi)Lint/PercentStringArrayandLint/PercentSymbolArraywhen the inspected file is binary encoded. (@akhramov)nilresponds to inLint/SafeNavigationConsistency. (@rrosenblum)Lint/LiteralInInterpolationif contains numbers. (@koic)Rails/CreateTableWithTimestampswhen using hash options. (@wata727)Lint/UnneededCopEnableDirectivefor instruction '# rubocop:enable all'. (@balbesina)Rails/HttpPositionalArgumnetsto usesessioninstead ofheader. (@rrosenblum)Changes
Style/MethodMissinginto two cops,Style/MethodMissingSuperandStyle/MissingRespondToMissing. (@rrosenblum)AllowInMultilineConditionsoption toStyle/ParenthesesAroundConditioncop. (@Darhazer)Layout/SpaceInsideReferenceBracketswhen assigning a reference bracket to a reference bracket. (@joshuapinter)--auto-correct. (@jonas054)try!to the list of whitelisted methods forLint/SafeNavigationChainandStyle/SafeNavigation. (@rrosenblum)Style/EmptyLineAfterGuardClausecop toLayoutdepartment. (@koic)0.55.0
New features
Performance/UnneededSortcop. (@parkerfinch)Lint/SafeNavigationConsistencycop. (@rrosenblum)Bug fixes
Performance/RegexpMatchcop not correcting negated match operator. (@bdewater):class_nameoption in Rails/InverseOf cop. (@bdewater)Style/SymbolArrayandStyle/WordArrayfor multiline Arrays. (@istateside)Rails/InverseOfcop allowinginverse_of: nilto opt-out. (@bdewater)Lint/ShadowedArgumentfalse positive with shorthand assignments. (@akhramov)Naming/HeredocDelimiterNamingblacklist patterns. (@mcfisch)Performance/RegexpMatchto produce code that safe guards against the receiver beingnil. (@rrosenblum)Rails/HttpStatusignoring hash order to fix false negative. (@pocke)Style/EmptyLineAfterGuardClausewhen guard clause is after heredoc. (@koic)Style/EmptyLineAfterGuardClausewhen guard clause is after heredoc argument. (@koic)Style/Unpackfirstfalse positive ofunpack('h*').take(1). (@parkerfinch)Style/FrozenStringLiteralCommentauto-correction to insert a new line between the comment and the code. (@rrosenblum)Lint/Voidnot detecting void context in blocks with single expression. (@Darhazer)Changes
String#delete_{prefix,suffix}to Lint/Void cop. (@bdewater)by,on,inandatto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@AlexWayfer)EnforcedStyleoption toLayout/SpaceInsideParens, allowing you to enforce spaces inside of parentheses. (@joshuapinter)Metrics/BlockLength'sExcludedMethodsconfiguration option. (@akhramov)IgnoredMethodsoption toStyle/MethodCallWithoutArgsParenthesescop. (@Darhazer)Style/OptionHashaware of implicit parameter passing to super. (@Wei-LiangChew)0.54.0
New features
Rails/HttpStatuscop. (@anthony-robin)Style/UnpackFirstcop. (@bdewater)Bug fixes
Naming/UncommunicativeXParamNamecops. (@jlfaber)Layout/ElseAlignmentforrescue/else/ensureinsidedo/endblocks. (@YukiJikumaru)Style/Documentation:nodoc:for compact-style nested modules/classes. (@ojab)Bundler/OrderedGemswhen a group includes duplicate gems. (@colorbox)--fail-fast. (@mmyoji)Style/FormatStringTokenwhen using placeholder arguments informatmethod. (@koic)Style/InverseMethodswhen comparing constants with<,>,<=, or>=. If the code is being used to determine class hierarchy, the correction might not be accurate. (@rrosenblum)Style/TrivialAccessorsauto-correction fordefwithprivate. (@pocke)Style/SafeNavigationdoes not auto-correct all chained methods resulting in aLint/SafeNavigationChainoffense. (@rrosenblum)UncommunicativeNamecops. (@pocke)Layout/EmptyCommentwhen the empty comment appears on the same line as code. (@rrosenblum)Style/EmptyLineAfterGuardClausewhen guard clause is beforerescueorensure. (@koic)Style/EmptyLineAfterGuardClausewhen guard clause is beforeelse. (@koic)Naming/ConstantNamewhen using conditional assignment. (@drenmi)Changes
Naming/UncommunicativeMethodParamNameaddtoto allowed names in default config. (@unused)--debug. (@jonas054)Layout/SpaceInsideArrayLiteralBracketswhen contains an array literal as an argument after a heredoc is started. (@koic)<<~operator with invalid indentation. (@hamada14)gems.lockedorGemfile.lockto determine the bestTargetRubyVersionwhen it is not specified in the config. (@roberts1000)Style/InlineCommentfor inline comments which enable or disable rubocop cops. (@jfelchner)IndentHeredocmessage 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.1Exclude === from BinaryOperatorParameterNameFix 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 commentExtend a bit the documentation for Naming/FileNameTweak a comment[Fix #6265] Handle .gemspec files specially in `Naming/FileName`[Fix #6281] Fix false negative for Style/MultilineMethodSignatureMove SendNode#stabby_lambda? to MethodDispatchNode#lambda_literal?Use `select` instead of `take_while` to avoid false positivesuse `node.descendants` to find the method chainFix 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 buildsDocumentation checks only need to run onceCopy remaining tasks from .travis.sh to CircleAll Travis tasks are performed also in Circle nowTest Ruby release candidates on CircleCIRemove unneeded $stderr capturingLet Appveyor run four separate rake tasksGenerate code coverage report on all spec runsSubclass TestQueue classes to avoid ARGV hackDeprecate duplicated rake tasksExtract a `run_specs` methodUse plain Ruby to implement RSpec Rake tasksExtract rspec Rake tasks to separate file[Fix #6261] Fix undefined method `stabby_lambda?` for `Style/RedundantBegin` when calling `super` with a blockMerge pull request #6272 from hoshinotsuyoshi/unreachable_code_detects_exitMake 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 homepageImprove some markupExtend the "Basic Usage" section of the manualDepfu 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.