config/enabled.yml in rubocop-0.29.1 vs config/enabled.yml in rubocop-0.30.0

- old
+ new

@@ -76,11 +76,11 @@ Style/BlockEndNewline: Description: 'Put end statement of multiline block on its own line.' Enabled: true -Style/Blocks: +Style/BlockDelimiters: Description: >- Avoid using {...} for multi-line blocks (multiline chaining is always ugly). Prefer {...} over do...end for single-line blocks. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' @@ -126,15 +126,24 @@ Style/ClassVars: Description: 'Avoid the use of class variables.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars' Enabled: true +Style/ClosingParenthesisIndentation: + Description: 'Checks the indentation of hanging closing parentheses.' + Enabled: true + Style/ColonMethodCall: Description: 'Do not use :: for method call.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons' Enabled: true +Style/CommandLiteral: + Description: 'Use `` or %x around command literals.' + StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x' + Enabled: true + Style/CommentAnnotation: Description: >- Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW). StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords' @@ -492,15 +501,11 @@ Description: "Don't use self where it's not needed." StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required' Enabled: true Style/RegexpLiteral: - Description: >- - Use %r for regular expressions matching more than - `MaxSlashes` '/' characters. - Use %r only for regular expressions matching more than - `MaxSlashes` '/' character. + Description: 'Use / or %r around regular expressions.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r' Enabled: true Style/RescueModifier: Description: 'Avoid using rescue in its modifier form.' @@ -609,11 +614,11 @@ configuration. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals' Enabled: true Style/SpaceAroundOperators: - Description: 'Use spaces around operators.' + Description: 'Use a single space around operators.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators' Enabled: true Style/SpaceBeforeModifierKeyword: Description: 'Put a space before the modifier keyword.' @@ -658,10 +663,14 @@ Style/StructInheritance: Description: 'Checks for inheritance from Struct.new.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new' Enabled: true +Style/SymbolLiteral: + Description: 'Use plain symbols instead of string symbols when possible.' + Enabled: true + Style/SymbolProc: Description: 'Use symbols as procs instead of blocks when possible.' Enabled: true Style/Tab: @@ -703,15 +712,10 @@ Style/UnneededPercentQ: Description: 'Checks for %q/%Q when single quotes or double quotes would do.' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q' Enabled: true -Style/UnneededPercentX: - Description: 'Checks for %x when `` would do.' - StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x' - Enabled: true - Style/VariableInterpolation: Description: >- Don't interpolate global, instance and class variables directly in strings. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate' @@ -889,10 +893,14 @@ Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break' Enabled: true +Lint/NonLocalExitFromIterator: + Description: 'Do not use return in iterator to cause non-local exit.' + Enabled: true + Lint/ParenthesesAsGroupedExpression: Description: >- Checks for method calls with a space before the opening parenthesis. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' @@ -967,24 +975,74 @@ Lint/Void: Description: 'Possible use of operator/literal/variable in void context.' Enabled: true +##################### Performance ############################# + +Performance/Detect: + Description: >- + Use `detect` instead of `select.first`, `find_all.first`, + `select.last`, and `find_all.last`. + Enabled: true + +Performance/FlatMap: + Description: >- + Use `Enumerable#flat_map` + instead of `Enumerable#map...Array#flatten(1)` + or `Enumberable#collect..Array#flatten(1)` + Enabled: true + EnabledForFlattenWithoutParams: false + # If enabled, this cop will warn about usages of + # `flatten` being called without any parameters. + # This can be dangerous since `flat_map` will only flatten 1 level, and + # `flatten` without any parameters can flatten multiple levels. + +Performance/ReverseEach: + Description: 'Use `reverse_each` instead of `reverse.each`.' + Enabled: true + +Performance/Sample: + Description: >- + Use `sample` instead of `shuffle.first`, + `shuffle.last`, and `shuffle[Fixnum]`. + Enabled: true + +Performance/Size: + Description: >- + Use `size` instead of `count` for counting + the number of elements in `Array` and `Hash`. + Enabled: true + ##################### Rails ################################## Rails/ActionFilter: Description: 'Enforces consistent use of action filter methods.' Enabled: true +Rails/Date: + Description: >- + Checks the correct usage of date aware methods, + such as Date.today, Date.current etc. + Enabled: true + Rails/DefaultScope: Description: 'Checks if the argument passed to default_scope is a block.' Enabled: true Rails/Delegate: Description: 'Prefer delegate method for delegations.' Enabled: true +Rails/FindBy: + Description: 'Prefer find_by over where.first.' + Enabled: true + +Rails/FindEach: + Description: 'Prefer all.find_each over all.find.' + Enabled: true + Rails/HasAndBelongsToMany: Description: 'Prefer has_many :through to has_and_belongs_to_many.' Enabled: true Rails/Output: @@ -997,9 +1055,13 @@ write_attribute(:attr, val). Enabled: true Rails/ScopeArgs: Description: 'Checks the arguments of ActiveRecord scopes.' + Enabled: true + +Rails/TimeZone: + Description: 'Checks the correct usage of time zone aware methods.' Enabled: true Rails/Validation: Description: 'Use validates :attribute, hash of validations.' Enabled: true