Upgrade rubocop to version 0.60.0 #428
Merged
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.60.0) · Repo · Changelog
Release Notes
0.60.0
New features
--safeand--safe-auto-correctoptions. (@Darhazer)--auto-gen-only-exclude. (@Ana06, @jonas054)VersionAddedmeta data to config/default.yml when runningrake new_cop. (@koic)Whitelistconfig toRails/SkipsModelValidationsrule. (@DiscoStarslayer)Bug fixes
Rails/ReversibleMigrationwhen using variable assignment. (@koic, @scottmatthewman)Style/RedundantFreezeand a false negative forStyle/MutableConstantwhen assigning a regexp object to a constant. (@koic)Style/RedundantFreezewhen assigning a range object to a constant. (@koic)Rails/ReversibleMigrationwhen block argument is empty. (@koic)LineLengthcop for tab-indented code. (@AlexWayfer)Changes
keyoption inLayout/AlignHashcop. (@albaer)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)Not all release notes shown. View the full release notes
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
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.All Depfu comment commands