config/enabled.yml in rubocop-0.49.1 vs config/enabled.yml in rubocop-0.50.0

- old
+ new

@@ -336,17 +336,73 @@ Layout/TrailingWhitespace: Description: 'Avoid trailing whitespace.' StyleGuide: '#no-trailing-whitespace' Enabled: true -#################### Style ############################### +#################### Naming ############################## -Style/AccessorMethodName: +Naming/AccessorMethodName: Description: Check the naming of accessor methods for get_/set_. StyleGuide: '#accessor_mutator_method_names' Enabled: true +Naming/AsciiIdentifiers: + Description: 'Use only ascii symbols in identifiers.' + StyleGuide: '#english-identifiers' + Enabled: true + +Naming/ClassAndModuleCamelCase: + Description: 'Use CamelCase for classes and modules.' + StyleGuide: '#camelcase-classes' + Enabled: true + +Naming/ConstantName: + Description: 'Constants should use SCREAMING_SNAKE_CASE.' + StyleGuide: '#screaming-snake-case' + Enabled: true + +Naming/FileName: + Description: 'Use snake_case for source file names.' + StyleGuide: '#snake-case-files' + Enabled: true + +Naming/HeredocDelimiterCase: + Description: 'Use configured case for heredoc delimiters.' + StyleGuide: '#heredoc-delimiters' + Enabled: true + +Naming/HeredocDelimiterNaming: + Description: 'Use descriptive heredoc delimiters.' + StyleGuide: '#heredoc-delimiters' + Enabled: true + +Naming/MethodName: + Description: 'Use the configured style when naming methods.' + StyleGuide: '#snake-case-symbols-methods-vars' + Enabled: true + +Naming/PredicateName: + Description: 'Check the names of predicate methods.' + StyleGuide: '#bool-methods-qmark' + Enabled: true + +Naming/BinaryOperatorParameterName: + Description: 'When defining binary operators, name the argument other.' + StyleGuide: '#other-arg' + Enabled: true + +Naming/VariableName: + Description: 'Use the configured style when naming variables.' + StyleGuide: '#snake-case-symbols-methods-vars' + Enabled: true + +Naming/VariableNumber: + Description: 'Use the configured style when numbering variables.' + Enabled: true + +#################### Style ############################### + Style/Alias: Description: 'Use alias instead of alias_method.' StyleGuide: '#alias-method' Enabled: true @@ -363,15 +419,10 @@ Style/AsciiComments: Description: 'Use only ascii symbols in comments.' StyleGuide: '#english-comments' Enabled: true -Style/AsciiIdentifiers: - Description: 'Use only ascii symbols in identifiers.' - StyleGuide: '#english-identifiers' - Enabled: true - Style/Attr: Description: 'Checks for uses of Module#attr.' StyleGuide: '#attr' Enabled: true @@ -410,17 +461,13 @@ Style/CharacterLiteral: Description: 'Checks for uses of character literals.' StyleGuide: '#no-character-literals' Enabled: true -Style/ClassAndModuleCamelCase: - Description: 'Use CamelCase for classes and modules.' - StyleGuide: '#camelcase-classes' - Enabled: true - Style/ClassAndModuleChildren: Description: 'Checks style of children classes and modules.' + StyleGuide: '#namespace-definition' Enabled: true Style/ClassCheck: Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.' Enabled: true @@ -457,20 +504,21 @@ Use the return value of `if` and `case` statements for assignment to a variable and variable comparison instead of assigning that variable inside of each branch. Enabled: true -Style/ConstantName: - Description: 'Constants should use SCREAMING_SNAKE_CASE.' - StyleGuide: '#screaming-snake-case' - Enabled: true - Style/DefWithParentheses: Description: 'Use def with parentheses when there are arguments.' StyleGuide: '#method-parens' Enabled: true +Style/Dir: + Description: >- + Use the `__dir__` method to retrieve the canonicalized + absolute path to the current file. + Enabled: true + Style/Documentation: Description: 'Document classes and non-namespace modules.' Enabled: true Exclude: - 'spec/**/*' @@ -512,20 +560,20 @@ Style/EndBlock: Description: 'Avoid the use of END blocks.' StyleGuide: '#no-END-blocks' Enabled: true +Style/Encoding: + Description: 'Use UTF-8 as the source file encoding.' + StyleGuide: '#utf-8' + Enabled: true + Style/EvenOdd: Description: 'Favor the use of Integer#even? && Integer#odd?' StyleGuide: '#predicate-methods' Enabled: true -Style/FileName: - Description: 'Use snake_case for source file names.' - StyleGuide: '#snake-case-files' - Enabled: true - Style/FrozenStringLiteralComment: Description: >- Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: true @@ -632,20 +680,21 @@ Checks if the method definitions have or don't have parentheses. StyleGuide: '#method-parens' Enabled: true -Style/MethodName: - Description: 'Use the configured style when naming methods.' - StyleGuide: '#snake-case-symbols-methods-vars' - Enabled: true - Style/MethodMissing: Description: 'Avoid using `method_missing`.' StyleGuide: '#no-method-missing' Enabled: true +Style/MinMax: + Description: >- + Use `Enumerable#minmax` instead of `Enumerable#min` + and `Enumerable#max` in conjunction.' + Enabled: true + Style/MixinGrouping: Description: 'Checks for grouping of mixins in `class` and `module` bodies.' StyleGuide: '#mixin-grouping' Enabled: true @@ -766,22 +815,22 @@ Favor the ternary operator(?:) over if/then/else/end constructs. StyleGuide: '#ternary-operator' Enabled: true -Style/OpMethod: - Description: 'When defining binary operators, name the argument other.' - StyleGuide: '#other-arg' - Enabled: true - Style/OptionalArguments: Description: >- Checks for optional arguments that do not appear at the end of the argument list StyleGuide: '#optional-arguments' Enabled: true +Style/OrAssignment: + Description: 'Recommend usage of double pipe equals (||=) where applicable.' + StyleGuide: '#double-pipe-for-uninit' + Enabled: true + Style/ParallelAssignment: Description: >- Check for simple usages of parallel assignment. It will only warn when the number of variables matches on both sides of the assignment. @@ -807,15 +856,10 @@ Style/PerlBackrefs: Description: 'Avoid Perl-style regex back references.' StyleGuide: '#no-perl-regexp-last-matchers' Enabled: true -Style/PredicateName: - Description: 'Check the names of predicate methods.' - StyleGuide: '#bool-methods-qmark' - Enabled: true - Style/PreferredHashMethods: Description: 'Checks use of `has_key?` and `has_value?` Hash methods.' StyleGuide: '#hash-key' Enabled: true @@ -832,10 +876,14 @@ Style/RedundantBegin: Description: "Don't use begin blocks when they are not needed." StyleGuide: '#begin-implicit' Enabled: true +Style/RedundantConditional: + Description: "Don't return true/false from a conditional." + Enabled: true + Style/RedundantException: Description: "Checks for an obsolete RuntimeException argument in raise/fail." StyleGuide: '#no-explicit-runtimeerror' Enabled: true @@ -986,19 +1034,10 @@ Don't interpolate global, instance and class variables directly in strings. StyleGuide: '#curlies-interpolate' Enabled: true -Style/VariableName: - Description: 'Use the configured style when naming variables.' - StyleGuide: '#snake-case-symbols-methods-vars' - Enabled: true - -Style/VariableNumber: - Description: 'Use the configured style when numbering variables.' - Enabled: true - Style/WhenThen: Description: 'Use when x then ... for one-line cases.' StyleGuide: '#one-line-cases' Enabled: true @@ -1111,10 +1150,14 @@ Lint/BlockAlignment: Description: 'Align block ends correctly.' Enabled: true +Lint/BooleanSymbol: + Description: 'Check for `:true` and `:false` symbols.' + Enabled: true + Lint/CircularArgumentReference: Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument." Enabled: true Lint/ConditionPosition: @@ -1215,10 +1258,14 @@ Lint/InheritException: Description: 'Avoid inheriting from the `Exception` class.' Enabled: true +Lint/InterpolationCheck: + Description: 'Raise warning for interpolation in single q strs' + Enabled: true + Lint/InvalidCharacterLiteral: Description: >- Checks for invalid character literals with a non-escaped whitespace character. Enabled: true @@ -1278,10 +1325,14 @@ Description: >- Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake. Enabled: true +Lint/RedundantWithIndex: + Description: 'Checks for redundant `with_index`.' + Enabled: true + Lint/RequireParentheses: Description: >- Use parentheses in the method call to avoid confusion about precedence. Enabled: true @@ -1293,10 +1344,15 @@ Lint/RescueType: Description: 'Avoid rescuing from non constants that could result in a `TypeError`.' Enabled: true +Lint/RescueWithoutErrorClass: + Description: 'Avoid rescuing without specifying an error class.' + StyleGuide: '#no-blind-rescues' + Enabled: true + Lint/SafeNavigationChain: Description: 'Do not chain ordinary method call after safe navigation operator.' Enabled: true Lint/ScriptPermission: @@ -1318,10 +1374,14 @@ Lint/StringConversionInInterpolation: Description: 'Checks for Object#to_s usage in string interpolation.' StyleGuide: '#no-to-s' Enabled: true +Lint/Syntax: + Description: 'Checks syntax error' + Enabled: true + Lint/UnderscorePrefixedVariableName: Description: 'Do not use prefix `_` for a variable that is used.' Enabled: true Lint/UnifiedInteger: @@ -1351,10 +1411,24 @@ Lint/UnreachableCode: Description: 'Unreachable code.' Enabled: true +Lint/UriEscapeUnescape: + Description: >- + `URI.escape` method is obsolete and should not be used. Instead, use + `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` + depending on your specific use case. + Also `URI.unescape` method is obsolete and should not be used. Instead, use + `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component` + depending on your specific use case. + Enabled: true + +Lint/UriRegexp: + Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.' + Enabled: true + Lint/UselessAccessModifier: Description: 'Checks for useless access modifiers.' Enabled: true ContextCreatingMethods: [] MethodCreatingMethods: [] @@ -1370,10 +1444,14 @@ Lint/UselessElseWithoutRescue: Description: 'Checks for useless `else` in `begin..end` without `rescue`.' Enabled: true +Lint/ReturnInVoidContext: + Description: 'Checks for return in void context.' + Enabled: true + Lint/UselessSetterCall: Description: 'Checks for useless setter call to a local variable.' Enabled: true Lint/Void: @@ -1516,11 +1594,11 @@ the number of elements in `Array` and `Hash`. Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code' Enabled: true Performance/CompareWithBlock: - Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.' + Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.' Enabled: true Performance/StartWith: Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.' Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end' @@ -1538,12 +1616,21 @@ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code' Enabled: true Performance/TimesMap: Description: 'Checks for .times.map calls.' + AutoCorrect: false Enabled: true +Performance/UnfreezeString: + Description: 'Use unary plus to get an unfrozen string literal.' + Enabled: true + +Performance/UriDefaultParser: + Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.' + Enabled: true + #################### Rails ################################# Rails/ActionFilter: Description: 'Enforces consistent use of action filter methods.' Enabled: true @@ -1620,10 +1707,15 @@ Rails/HasAndBelongsToMany: Description: 'Prefer has_many :through to has_and_belongs_to_many.' StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through' Enabled: true +Rails/HasManyOrHasOneDependent: + Description: 'Define the dependent option to the has_many and has_one associations.' + StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has_many-has_one-dependent-option' + Enabled: true + Rails/HttpPositionalArguments: Description: 'Use keyword arguments instead of positional arguments in http method calls.' Enabled: true Include: - 'spec/**/*' @@ -1737,9 +1829,19 @@ #################### Bundler ############################### Bundler/DuplicatedGem: Description: 'Checks for duplicate gem entries in Gemfile.' + Enabled: true + Include: + - '**/Gemfile' + - '**/gems.rb' + +Bundler/InsecureProtocolSource: + Description: >- + The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated + because HTTP requests are insecure. Please change your source to + 'https://rubygems.org' if possible, or 'http://rubygems.org' if not. Enabled: true Include: - '**/Gemfile' - '**/gems.rb'