Upgrade rubocop to version 0.59.2 #411
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.2) · Repo · Changelog
Release Notes
0.59.2
Bug fixes
Rails/HasManyOrHasOneDependentwhen using associations of Active Resource. (@tejasbubane, @koic)Style/Forwhen settingEnforcedStyle: eachandfordose not havedoor semicolon. (@autopp)Layout/EmptyLineAfterGuardClausewhen guard clause including heredoc. (@koic)AllowURIoption forMetrics/LineLengthcop with disabledLayut/Tabcop. (@AlexWayfer)Metrics/BlockLengthinto the respective length cops. (@drenmi)Style/ZeroLengthPredicatefalse positives when inspectingTempfile,StringIO, andFile::Statobjects. (@drenmi)Layout/EmptyLinesAroundAccessModifierandLayout/EmptyLinesAroundAccessModifierwhen specifying a superclass that breaks the line. (@koic)Style/IfUnlessModifierwhen using named capture. (@drenmi)Style/Semicolonfrom breaking on single line if-then-else in assignment. (@drenmi)Rails/HasManyOrHasOneDependentwhen an Active Record model does not have any relations. (@koic)Style/Forwhen settingEnforcedStyle: eachwith range provided to theforloop without adokeyword or semicolon and without enclosing parenthesis. (@lukasz-wojcik)Changes
Metrics/MethodLength. (@akanoi)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)Not all release notes shown. View the full release notes
Commits
See the full diff on Github. The new version differs by 23 commits:
Cut 0.59.2Fix a changelog entryAllow to exclude methods from `Metrics/MethodLength` (#6286)Fix a false negative for `Rails/HasManyOrHasOneDependent`Remove Travis configuration fileRestyle example formatting for `Rails/Delegate`Merge pull request #6320 from lukasz-wojcik/fix-for-style-cop-with-range[Fix #6316] Fix auto-correct for `Style/For` copUpdate the links to the manual[Fix #6311] Prevent Style/Semicolon from breaking on single line if-then-else in assignment (#6317)Fix an error for `Rails/HasManyOrHasOneDependent`[Fix #6007] Fix false positive in Style/IfUnlessModifier when using named captureMemoizedInstanceVariableName: Fix doc typo[Fix #6305] Fix infinite loop for `Layout/EmptyLinesAroundAccessModifier`[Fix #5303] Create PercentLiteralCorrector (#6299)Fix `AllowURI` option for `Metrics/LineLength` cop with disabled `Layout/Tab` cop (#6287)Fix a couple of changelog entries[Fix #6266] Run HasManyOrHasOneDependent only for ActiveRecord classMove inspection of class- and module definition block length[Fix #6300] Fix a false positive for `Layout/EmptyLineAfterGuardClause`[Fix #2841] Reduce Style/ZeroLengthPredicate false positivesMerge pull request #6297 from autopp/fix-auto-correct-of-style-for[Fix #6296] Fix an auto-correct error for `Style/For` when setting `EnforcedStyle: each` and `for` dose not have `do` or semicolonDepfu 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.