Rubocop v0.52.0 Release Notes

Release Date: 2017-12-12 // over 6 years ago
  • ๐Ÿ†• New features

    • ๐Ÿ’Ž #5101: Allow to specify TargetRubyVersion 2.5. ([@walf443][])
    • ๐Ÿ”ง #1575: Add new Layout/ClassStructure cop that checks whether definitions in a class are in the configured order. This cop is disabled by default. ([@jonatas][])
    • ๐Ÿ†• New cop Rails/InverseOf checks for association arguments that require setting the inverse_of option manually. ([@bdewater][])
    • #4811: Add new Layout/SpaceInsideReferenceBrackets cop. ([@garettarrowood][])
    • #4811: Add new Layout/SpaceInsideArrayLiteralBrackets cop. ([@garettarrowood][])
    • ๐Ÿ’… #4252: Add new Style/TrailingBodyOnMethodDefinition cop. ([@garettarrowood][])
    • โž• Add new Style/TrailingMethodEndStatment cop. ([@garettarrowood][])
    • #5074: Add Layout/EmptyLinesAroundArguments cop. ([@garettarrowood][])
    • ๐Ÿ’… #4650: Add new Style/StringHashKeys cop. ([@donjar][])
    • #1583: Add a quiet formatter. ([@drenmi][])
    • โž• Add new Style/RandomWithOffset cop. ([@donjar][])
    • ๐Ÿ‘• #4892: Add new Lint/ShadowedArgument cop and remove argument shadowing detection from Lint/UnusedBlockArgument and Lint/UnusedMethodArgument. ([@akhramov][])
    • ๐Ÿ‘• #4674: Add a new Lint/MissingCopEnableDirective cop. ([@tdeo][])
    • โž• Add new Rails/EnvironmentComparison cop. ([@tdeo][])
    • โž• Add AllowedChars option to Style/AsciiComments cop. ([@hedgesky][])
    • ๐Ÿ’… #5031: Add new Style/EmptyBlockParameter and Style/EmptyLambdaParameter cops. ([@pocke][])
    • ๐Ÿ’Ž #5057: Add new Gemspec/RequiredRubyVersion cop. ([@koic][])
    • #5087: Add new Gemspec/RedundantAssignment cop. ([@koic][])
    • โž• Add unannotated option to Style/FormatStringToken cop. ([@drenmi][])
    • ๐Ÿš… #5077: Add new Rails/CreateTableWithTimestamps cop. ([@wata727][])
    • โž• Add new Style/ColonMethodDefinition cop. ([@rrosenblum][])
    • โž• Add new Style/ExtendSelf cop. ([@drenmi][])
    • ๐Ÿš… #5185: Add new Rails/RedundantReceiverInWithOptions cop. ([@koic][])
    • ๐Ÿš… #5177: Add new Rails/LexicallyScopedActionFilter cop. ([@wata727][])
    • ๐Ÿ’… #5173: Add new Style/EvalWithLocation cop. ([@pocke][])
    • ๐Ÿš… #5208: Add new Rails/Presence cop. ([@wata727][])
    • ๐Ÿ‘ Allow auto-correction of ClassAndModuleChildren. ([@siegfault][], [@melch][])

    ๐Ÿ› Bug fixes

    • #5096: Fix incorrect detection and auto-correction of multiple extend/include/prepend. ([@marcandre][])
    • #5219: Fix incorrect empty line detection for block arguments in Layout/EmptyLinesAroundArguments. ([@garettarrowood][])
    • #4662: Fix incorrect indent level detection when first line of heredoc is blank. ([@sambostock][])
    • ๐Ÿ’… #5016: Fix a false positive for Style/ConstantName with constant names using non-ASCII capital letters with accents. ([@timrogers][])
    • #4866: Prevent Layout/BlockEndNewline cop from introducing trailing whitespaces. ([@bgeuken][])
    • #3396: Concise error when config. file not found. ([@jaredbeck][])
    • ๐ŸŽ #4881: Fix a false positive for Performance/HashEachMethods when unused argument(s) exists in other blocks. ([@pocke][])
    • ๐ŸŽ #4883: Fix auto-correction for Performance/HashEachMethods. ([@pocke][])
    • ๐Ÿ’… #4896: Fix Style/DateTime wrongly triggered on classes ...::DateTime. ([@dpostorivo][])
    • ๐Ÿ‘• #4938: Fix behavior of Lint/UnneededDisable, which was returning offenses even after being disabled in a comment. ([@tdeo][])
    • ๐Ÿ’… #4887: Add undeclared configuration option EnforcedStyleForEmptyBraces for Layout/SpaceBeforeBlockBraces cop. ([@drenmi][])
    • #4987: Skip permission check when using stdin option. ([@mtsmfm][])
    • ๐Ÿš… #4909: Make Rails/HasManyOrHasOneDependent aware of multiple associations in with_options. ([@koic][])
    • #4794: Fix an error in Layout/MultilineOperationIndentation when an operation spans multiple lines and contains a ternary expression. ([@rrosenblum][])
    • ๐Ÿ’… #4885: Fix false offense detected by Style/MixinUsage cop. ([@koic][])
    • ๐Ÿ’… #3363: Fix Style/EmptyElse auto-correction removes comments from branches. ([@dpostorivo][])
    • #5025: Fix error with Layout/MultilineMethodCallIndentation cop and lambda.(...). ([@dpostorivo][])
    • ๐Ÿ’… #4781: Prevent Style/UnneededPercentQ from breaking on strings that are concated with backslash. ([@pocke][])
    • ๐Ÿ’… #4363: Fix Style/PercentLiteralDelimiters incorrectly automatically modifies escaped percent literal delimiter. ([@koic][])
    • #5053: Fix Naming/ConstantName false offense on assigning to a nonoffensive assignment. ([@garettarrowood][])
    • ๐Ÿ’… #5019: Fix auto-correct for Style/HashSyntax cop when hash is used as unspaced argument. ([@drenmi][])
    • ๐Ÿ’… #5052: Improve accuracy of Style/BracesAroundHashParameters auto-correction. ([@garettarrowood][])
    • ๐Ÿ’… #5059: Fix a false positive for Style/MixinUsage when include call is a method argument. ([@koic][])
    • ๐Ÿ‘• #5071: Fix a false positive in Lint/UnneededSplatExpansion, when Array.new resides in an array literal. ([@akhramov][])
    • ๐Ÿ’… #4071: Prevent generating wrong code by Style/ColonMethodCall and Style/RedundantSelf. ([@pocke][])
    • ๐Ÿ’… #5089: Fix false positive for Style/SafeNavigation when safe guarding arithmetic operation or assignment. ([@tiagotex][])
    • ๐Ÿ’… #5099: Prevent Style/MinMax from breaking on implicit receivers. ([@drenmi][])
    • ๐Ÿ’… #5079: Fix false positive for Style/SafeNavigation when safe guarding comparisons. ([@tiagotex][])
    • ๐Ÿ’… #5075: Fix auto-correct for Style/RedundantParentheses cop when unspaced ternary is present. ([@tiagotex][])
    • #5155: Fix a false negative for Naming/ConstantName cop when using frozen object assignment. ([@koic][])
    • ๐Ÿ›  Fix a false positive in Style/SafeNavigation when the right hand side is negated. ([@rrosenblum][])
    • #5128: Fix Bundler/OrderedGems when gems are references from variables (ignores them in the sorting). ([@tdeo][])

    ๐Ÿ”„ Changes

    • #4848: Exclude lambdas and procs from Metrics/ParameterLists. ([@reitermarkus][])
    • #5120: Improve speed of RuboCop::PathUtil#smart_path. ([@walf443][])
    • ๐Ÿ’… #4888: Improve offense message of Style/StderrPuts. ([@jaredbeck][])
    • ๐Ÿ’… #4886: Fix false offense for Style/CommentedKeyword. ([@michniewicz][])
    • ๐Ÿ‘• #4977: Make Lint/RedundantWithIndex cop aware of offset argument. ([@koic][])
    • #2679: Handle dependencies to Metrics/LineLength: Max when generating .rubocop_todo.yml. ([@jonas054][])
    • #4943: Make cop generator compliant with the repo's rubocop config. ([@tdeo][])
    • ๐Ÿ’… #5011: Remove SupportedStyles from "Configuration parameters" in .rubocop_todo.yml. ([@pocke][])
    • ๐Ÿ’… Lint/RescueWithoutErrorClass has been replaced by Style/RescueStandardError. ([@rrosenblum][])
    • ๐Ÿ”ง #4811: Remove Layout/SpaceInsideBrackets in favor of two new configurable cops. ([@garettarrowood][])
    • #5042: Make offense locations of metrics cops to contain whole a method. ([@pocke][])
    • #5044: Add last_line and last_column into outputs of the JSON formatter. ([@pocke][])
    • #4633: Make metrics cops aware of define_method. ([@pocke][])
    • 0๏ธโƒฃ #5037: Make display cop names to enable by default. ([@pocke][])
    • #4449: Make Layout/IndentHeredoc aware of line length. ([@pocke][])
    • 0๏ธโƒฃ #5146: Make --show-cops option aware of --force-default-config. ([@pocke][])
    • ๐Ÿ‘• #3001: Add configuration to Lint/MissingCopEnableDirective cop. ([@tdeo][])
    • ๐Ÿ‘• #4932: Do not fail if configuration contains Lint/Syntax cop with the same settings as the default. ([@tdeo][])
    • ๐Ÿ’… #5175: Make Style/RedundantBegin aware of do-end block in Ruby 2.5. ([@pocke][])