1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Update rubocop config from thoughtbot

This commit is contained in:
Daniel Barber 2023-04-06 21:07:20 -05:00
parent 1528608558
commit 1f625db553

View File

@ -1,68 +1,71 @@
AllCops: AllCops:
Exclude: Exclude:
- db/schema.rb - db/schema.rb
TargetRubyVersion: 2.3
require:
- rubocop-rails
- rubocop-performance
Naming/AccessorMethodName: Naming/AccessorMethodName:
Description: Check the naming of accessor methods for get_/set_. Description: Check the naming of accessor methods for get_/set_.
Enabled: false Enabled: false
Style/Alias: Style/Alias:
Description: 'Use alias_method instead of alias.' Description: "Use alias_method instead of alias."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#alias-method"
Enabled: false Enabled: false
Style/ArrayJoin: Style/ArrayJoin:
Description: 'Use Array#join instead of Array#*.' Description: "Use Array#join instead of Array#*."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#array-join"
Enabled: false Enabled: false
Style/AsciiComments: Style/AsciiComments:
Description: 'Use only ascii symbols in comments.' Description: "Use only ascii symbols in comments."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#english-comments"
Enabled: false Enabled: false
Naming/AsciiIdentifiers: Naming/AsciiIdentifiers:
Description: 'Use only ascii symbols in identifiers.' Description: "Use only ascii symbols in identifiers."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#english-identifiers"
Enabled: false Enabled: false
Style/Attr: Style/Attr:
Description: 'Checks for uses of Module#attr.' Description: "Checks for uses of Module#attr."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#attr"
Enabled: false Enabled: false
Metrics/BlockNesting: Metrics/BlockNesting:
Description: 'Avoid excessive block nesting' Description: "Avoid excessive block nesting"
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count"
Enabled: false Enabled: false
Style/CaseEquality: Style/CaseEquality:
Description: 'Avoid explicit use of the case equality operator(===).' Description: "Avoid explicit use of the case equality operator(===)."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-case-equality"
Enabled: false Enabled: false
Style/CharacterLiteral: Style/CharacterLiteral:
Description: 'Checks for uses of character literals.' Description: "Checks for uses of character literals."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-character-literals"
Enabled: false Enabled: false
Style/ClassAndModuleChildren: Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.' Description: "Checks style of children classes and modules."
Enabled: true Enabled: true
EnforcedStyle: nested EnforcedStyle: nested
Metrics/ClassLength: Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.' Description: "Avoid classes longer than 100 lines of code."
Enabled: false Enabled: false
Metrics/ModuleLength: Metrics/ModuleLength:
Description: 'Avoid modules longer than 100 lines of code.' Description: "Avoid modules longer than 100 lines of code."
Enabled: false Enabled: false
Style/ClassVars: Style/ClassVars:
Description: 'Avoid the use of class variables.' Description: "Avoid the use of class variables."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-class-vars"
Enabled: false Enabled: false
Style/CollectionMethods: Style/CollectionMethods:
@ -74,61 +77,60 @@ Style/CollectionMethods:
find_all: select find_all: select
Style/ColonMethodCall: Style/ColonMethodCall:
Description: 'Do not use :: for method call.' Description: "Do not use :: for method call."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#double-colons"
Enabled: false Enabled: false
Style/CommentAnnotation: Style/CommentAnnotation:
Description: >- Description: >-
Checks formatting of special comments Checks formatting of special comments
(TODO, FIXME, OPTIMIZE, HACK, REVIEW). (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#annotate-keywords"
Enabled: false Enabled: false
Metrics/AbcSize: Metrics/AbcSize:
Description: >- Description: >-
A calculated magnitude based on number of assignments, A calculated magnitude based on number of assignments,
branches, and conditions. branches, and conditions.
Enabled: false Enabled: false
Metrics/BlockLength: Metrics/BlockLength:
CountComments: true # count full line comments? CountComments: true # count full line comments?
Max: 25 Max: 25
ExcludedMethods: []
Exclude: Exclude:
- "spec/**/*" - "spec/**/*"
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
Description: >- Description: >-
A complexity metric that is strongly correlated to the number A complexity metric that is strongly correlated to the number
of test cases needed to validate a method. of test cases needed to validate a method.
Enabled: false Enabled: false
Rails/Delegate: Rails/Delegate:
Description: 'Prefer delegate method for delegations.' Description: "Prefer delegate method for delegations."
Enabled: false Enabled: false
Style/PreferredHashMethods: Style/PreferredHashMethods:
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.' Description: "Checks use of `has_key?` and `has_value?` Hash methods."
StyleGuide: '#hash-key' StyleGuide: "#hash-key"
Enabled: false Enabled: false
Style/Documentation: Style/Documentation:
Description: 'Document classes and non-namespace modules.' Description: "Document classes and non-namespace modules."
Enabled: false Enabled: false
Style/DoubleNegation: Style/DoubleNegation:
Description: 'Checks for uses of double negation (!!).' Description: "Checks for uses of double negation (!!)."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-bang-bang"
Enabled: false Enabled: false
Style/EachWithObject: Style/EachWithObject:
Description: 'Prefer `each_with_object` over `inject` or `reduce`.' Description: "Prefer `each_with_object` over `inject` or `reduce`."
Enabled: false Enabled: false
Style/EmptyLiteral: Style/EmptyLiteral:
Description: 'Prefer literals to Array.new/Hash.new/String.new.' Description: "Prefer literals to Array.new/Hash.new/String.new."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#literal-array-hash"
Enabled: false Enabled: false
# Checks whether the source file has a utf-8 encoding comment or not # Checks whether the source file has a utf-8 encoding comment or not
@ -138,13 +140,13 @@ Style/Encoding:
Enabled: false Enabled: false
Style/EvenOdd: Style/EvenOdd:
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?' Description: "Favor the use of Fixnum#even? && Fixnum#odd?"
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#predicate-methods"
Enabled: false Enabled: false
Naming/FileName: Naming/FileName:
Description: 'Use snake_case for source file names.' Description: "Use snake_case for source file names."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#snake-case-files"
Enabled: false Enabled: false
Style/FrozenStringLiteralComment: Style/FrozenStringLiteralComment:
@ -153,199 +155,201 @@ Style/FrozenStringLiteralComment:
to help transition from Ruby 2.3.0 to Ruby 3.0. to help transition from Ruby 2.3.0 to Ruby 3.0.
Enabled: false Enabled: false
Style/FlipFlop: Lint/FlipFlop:
Description: 'Checks for flip flops' Description: "Checks for flip flops"
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-flip-flops"
Enabled: false Enabled: false
Style/FormatString: Style/FormatString:
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' Description: "Enforce the use of Kernel#sprintf, Kernel#format or String#%."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#sprintf"
Enabled: false Enabled: false
Style/GlobalVars: Style/GlobalVars:
Description: 'Do not introduce global variables.' Description: "Do not introduce global variables."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#instance-vars"
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html' Reference: "http://www.zenspider.com/Languages/Ruby/QuickRef.html"
Enabled: false Enabled: false
Style/GuardClause: Style/GuardClause:
Description: 'Check for conditionals that can be replaced with guard clauses' Description: "Check for conditionals that can be replaced with guard clauses"
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
Enabled: false Enabled: false
Style/IfUnlessModifier: Style/IfUnlessModifier:
Description: >- Description: >-
Favor modifier if/unless usage when you have a Favor modifier if/unless usage when you have a
single-line body. single-line body.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier"
Enabled: false Enabled: false
Style/IfWithSemicolon: Style/IfWithSemicolon:
Description: 'Do not use if x; .... Use the ternary operator instead.' Description: "Do not use if x; .... Use the ternary operator instead."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs"
Enabled: false Enabled: false
Style/InlineComment: Style/InlineComment:
Description: 'Avoid inline comments.' Description: "Avoid inline comments."
Enabled: false Enabled: false
Style/Lambda: Style/Lambda:
Description: 'Use the new lambda literal syntax for single-line blocks.' Description: "Use the new lambda literal syntax for single-line blocks."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#lambda-multi-line"
Enabled: false Enabled: false
Style/LambdaCall: Style/LambdaCall:
Description: 'Use lambda.call(...) instead of lambda.(...).' Description: "Use lambda.call(...) instead of lambda.(...)."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#proc-call"
Enabled: false Enabled: false
Style/LineEndConcatenation: Style/LineEndConcatenation:
Description: >- Description: >-
Use \ instead of + or << to concatenate two string literals at Use \ instead of + or << to concatenate two string literals at
line end. line end.
Enabled: false Enabled: false
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Max: 80
Metrics/MethodLength: Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.' Description: "Avoid methods longer than 10 lines of code."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#short-methods"
Enabled: false Enabled: false
Style/ModuleFunction: Style/ModuleFunction:
Description: 'Checks for usage of `extend self` in modules.' Description: "Checks for usage of `extend self` in modules."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#module-function"
Enabled: false Enabled: false
Style/MultilineBlockChain: Style/MultilineBlockChain:
Description: 'Avoid multi-line chains of blocks.' Description: "Avoid multi-line chains of blocks."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#single-line-blocks"
Enabled: false Enabled: false
Style/NegatedIf: Style/NegatedIf:
Description: >- Description: >-
Favor unless over if for negative conditions Favor unless over if for negative conditions
(or control flow or). (or control flow or).
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#unless-for-negatives"
Enabled: false Enabled: false
Style/NegatedWhile: Style/NegatedWhile:
Description: 'Favor until over while for negative conditions.' Description: "Favor until over while for negative conditions."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#until-for-negatives"
Enabled: false Enabled: false
Style/Next: Style/Next:
Description: 'Use `next` to skip iteration instead of a condition at the end.' Description: "Use `next` to skip iteration instead of a condition at the end."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
Enabled: false Enabled: false
Style/NilComparison: Style/NilComparison:
Description: 'Prefer x.nil? to x == nil.' Description: "Prefer x.nil? to x == nil."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#predicate-methods"
Enabled: false Enabled: false
Style/Not: Style/Not:
Description: 'Use ! instead of not.' Description: "Use ! instead of not."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#bang-not-not"
Enabled: false Enabled: false
Style/NumericLiterals: Style/NumericLiterals:
Description: >- Description: >-
Add underscores to large numeric literals to improve their Add underscores to large numeric literals to improve their
readability. readability.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics"
Enabled: false Enabled: false
Style/OneLineConditional: Style/OneLineConditional:
Description: >- Description: >-
Favor the ternary operator(?:) over Favor the ternary operator(?:) over
if/then/else/end constructs. if/then/else/end constructs.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#ternary-operator"
Enabled: false Enabled: false
Naming/BinaryOperatorParameterName: Naming/BinaryOperatorParameterName:
Description: 'When defining binary operators, name the argument other.' Description: "When defining binary operators, name the argument other."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#other-arg"
Enabled: false Enabled: false
Metrics/ParameterLists: Metrics/ParameterLists:
Description: 'Avoid parameter lists longer than three or four parameters.' Description: "Avoid parameter lists longer than three or four parameters."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#too-many-params"
Enabled: false Enabled: false
Style/PercentLiteralDelimiters: Style/PercentLiteralDelimiters:
Description: 'Use `%`-literal delimiters consistently' Description: "Use `%`-literal delimiters consistently"
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-literal-braces"
Enabled: false Enabled: false
Style/PerlBackrefs: Style/PerlBackrefs:
Description: 'Avoid Perl-style regex back references.' Description: "Avoid Perl-style regex back references."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers"
Enabled: false Enabled: false
Naming/PredicateName: Naming/PredicateName:
Description: 'Check the names of predicate methods.' Description: "Check the names of predicate methods."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark"
NamePrefixBlacklist: ForbiddenPrefixes:
- is_ - is_
Exclude: Exclude:
- spec/**/* - spec/**/*
Style/Proc: Style/Proc:
Description: 'Use proc instead of Proc.new.' Description: "Use proc instead of Proc.new."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#proc"
Enabled: false Enabled: false
Style/RaiseArgs: Style/RaiseArgs:
Description: 'Checks the arguments passed to raise/fail.' Description: "Checks the arguments passed to raise/fail."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#exception-class-messages"
Enabled: false Enabled: false
Style/RegexpLiteral: Style/RegexpLiteral:
Description: 'Use / or %r around regular expressions.' Description: "Use / or %r around regular expressions."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-r"
Enabled: false
Style/Sample:
Description: >-
Use `sample` instead of `shuffle.first`,
`shuffle.last`, and `shuffle[Fixnum]`.
Reference: "https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code"
Enabled: false Enabled: false
Style/SelfAssignment: Style/SelfAssignment:
Description: >- Description: >-
Checks for places where self-assignment shorthand should have Checks for places where self-assignment shorthand should have
been used. been used.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#self-assignment"
Enabled: false Enabled: false
Style/SingleLineBlockParams: Style/SingleLineBlockParams:
Description: 'Enforces the names of some block params.' Description: "Enforces the names of some block params."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#reduce-blocks"
Enabled: false Enabled: false
Style/SingleLineMethods: Style/SingleLineMethods:
Description: 'Avoid single-line methods.' Description: "Avoid single-line methods."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-single-line-methods"
Enabled: false Enabled: false
Style/SignalException: Style/SignalException:
Description: 'Checks for proper usage of fail and raise.' Description: "Checks for proper usage of fail and raise."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#fail-method"
Enabled: false Enabled: false
Style/SpecialGlobalVars: Style/SpecialGlobalVars:
Description: 'Avoid Perl-style global variables.' Description: "Avoid Perl-style global variables."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms"
Enabled: false Enabled: false
Style/StringLiterals: Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.' Description: "Checks if uses of quotes match the configured preference."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-string-literals"
EnforcedStyle: double_quotes EnforcedStyle: double_quotes
Enabled: true Enabled: true
Style/TrailingCommaInArguments: Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.' Description: "Checks for trailing comma in argument lists."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
EnforcedStyleForMultiline: comma EnforcedStyleForMultiline: comma
SupportedStylesForMultiline: SupportedStylesForMultiline:
- comma - comma
@ -354,8 +358,8 @@ Style/TrailingCommaInArguments:
Enabled: true Enabled: true
Style/TrailingCommaInArrayLiteral: Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.' Description: "Checks for trailing comma in array literals."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
EnforcedStyleForMultiline: comma EnforcedStyleForMultiline: comma
SupportedStylesForMultiline: SupportedStylesForMultiline:
- comma - comma
@ -364,8 +368,8 @@ Style/TrailingCommaInArrayLiteral:
Enabled: true Enabled: true
Style/TrailingCommaInHashLiteral: Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.' Description: "Checks for trailing comma in hash literals."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
EnforcedStyleForMultiline: comma EnforcedStyleForMultiline: comma
SupportedStylesForMultiline: SupportedStylesForMultiline:
- comma - comma
@ -374,68 +378,68 @@ Style/TrailingCommaInHashLiteral:
Enabled: true Enabled: true
Style/TrivialAccessors: Style/TrivialAccessors:
Description: 'Prefer attr_* methods to trivial readers/writers.' Description: "Prefer attr_* methods to trivial readers/writers."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#attr_family"
Enabled: false Enabled: false
Style/VariableInterpolation: Style/VariableInterpolation:
Description: >- Description: >-
Don't interpolate global, instance and class variables Don't interpolate global, instance and class variables
directly in strings. directly in strings.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#curlies-interpolate"
Enabled: false Enabled: false
Style/WhenThen: Style/WhenThen:
Description: 'Use when x then ... for one-line cases.' Description: "Use when x then ... for one-line cases."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#one-line-cases"
Enabled: false Enabled: false
Style/WhileUntilModifier: Style/WhileUntilModifier:
Description: >- Description: >-
Favor modifier while/until usage when you have a Favor modifier while/until usage when you have a
single-line body. single-line body.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier"
Enabled: false Enabled: false
Style/WordArray: Style/WordArray:
Description: 'Use %w or %W for arrays of words.' Description: "Use %w or %W for arrays of words."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-w"
Enabled: false Enabled: false
# Layout # Layout
Layout/AlignParameters: Layout/ParameterAlignment:
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.' Description: "Here we check if the parameters on a multi-line method call or definition are aligned."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-double-indent"
Enabled: false Enabled: false
Layout/ConditionPosition: Layout/ConditionPosition:
Description: >- Description: >-
Checks for condition placed in a confusing position relative to Checks for condition placed in a confusing position relative to
the keyword. the keyword.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#same-line-condition"
Enabled: false Enabled: false
Layout/DotPosition: Layout/DotPosition:
Description: 'Checks the position of the dot in multi-line method calls.' Description: "Checks the position of the dot in multi-line method calls."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains"
EnforcedStyle: trailing EnforcedStyle: trailing
Layout/ExtraSpacing: Layout/ExtraSpacing:
Description: 'Do not use unnecessary spacing.' Description: "Do not use unnecessary spacing."
Enabled: true Enabled: true
Layout/MultilineOperationIndentation: Layout/MultilineOperationIndentation:
Description: >- Description: >-
Checks indentation of binary operations that span more than Checks indentation of binary operations that span more than
one line. one line.
Enabled: true Enabled: true
EnforcedStyle: indented EnforcedStyle: indented
Layout/MultilineMethodCallIndentation: Layout/MultilineMethodCallIndentation:
Description: >- Description: >-
Checks indentation of method calls with the dot operator Checks indentation of method calls with the dot operator
that span more than one line. that span more than one line.
Enabled: true Enabled: true
EnforcedStyle: indented EnforcedStyle: indented
@ -444,24 +448,29 @@ Layout/InitialIndentation:
Checks the indentation of the first non-blank non-comment line in a file. Checks the indentation of the first non-blank non-comment line in a file.
Enabled: false Enabled: false
Layout/LineLength:
Description: "Limit lines to 80 characters."
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#80-character-limits"
Max: 80
# Lint # Lint
Lint/AmbiguousOperator: Lint/AmbiguousOperator:
Description: >- Description: >-
Checks for ambiguous operators in the first argument of a Checks for ambiguous operators in the first argument of a
method invocation without parentheses. method invocation without parentheses.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#parens-as-args"
Enabled: false Enabled: false
Lint/AmbiguousRegexpLiteral: Lint/AmbiguousRegexpLiteral:
Description: >- Description: >-
Checks for ambiguous regexp literals in the first argument of Checks for ambiguous regexp literals in the first argument of
a method invocation without parenthesis. a method invocation without parenthesis.
Enabled: false Enabled: false
Lint/AssignmentInCondition: Lint/AssignmentInCondition:
Description: "Don't use assignment in conditions." Description: "Don't use assignment in conditions."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition"
Enabled: false Enabled: false
Lint/CircularArgumentReference: Lint/CircularArgumentReference:
@ -469,183 +478,176 @@ Lint/CircularArgumentReference:
Enabled: false Enabled: false
Lint/DeprecatedClassMethods: Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.' Description: "Check for deprecated class method calls."
Enabled: false Enabled: false
Lint/DuplicatedKey: Lint/DuplicateHashKey:
Description: 'Check for duplicate keys in hash literals.' Description: "Check for duplicate keys in hash literals."
Enabled: false Enabled: false
Lint/EachWithObjectArgument: Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.' Description: "Check for immutable argument given to each_with_object."
Enabled: false Enabled: false
Lint/ElseLayout: Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.' Description: "Check for odd code arrangement in an else block."
Enabled: false Enabled: false
Lint/FormatParameterMismatch: Lint/FormatParameterMismatch:
Description: 'The number of parameters to format/sprint must match the fields.' Description: "The number of parameters to format/sprint must match the fields."
Enabled: false Enabled: false
Lint/HandleExceptions: Lint/SuppressedException:
Description: "Don't suppress exception." Description: "Don't suppress exception."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions"
Enabled: false Enabled: false
Lint/LiteralAsCondition: Lint/LiteralAsCondition:
Description: 'Checks of literals used in conditions.' Description: "Checks of literals used in conditions."
Enabled: false Enabled: false
Lint/LiteralInInterpolation: Lint/LiteralInInterpolation:
Description: 'Checks for literals used in interpolation.' Description: "Checks for literals used in interpolation."
Enabled: false Enabled: false
Lint/Loop: Lint/Loop:
Description: >- Description: >-
Use Kernel#loop with break rather than begin/end/until or Use Kernel#loop with break rather than begin/end/until or
begin/end/while for post-loop tests. begin/end/while for post-loop tests.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#loop-with-break"
Enabled: false Enabled: false
Lint/NestedMethodDefinition: Lint/NestedMethodDefinition:
Description: 'Do not use nested method definitions.' Description: "Do not use nested method definitions."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-methods"
Enabled: false Enabled: false
Lint/NonLocalExitFromIterator: Lint/NonLocalExitFromIterator:
Description: 'Do not use return in iterator to cause non-local exit.' Description: "Do not use return in iterator to cause non-local exit."
Enabled: false Enabled: false
Lint/ParenthesesAsGroupedExpression: Lint/ParenthesesAsGroupedExpression:
Description: >- Description: >-
Checks for method calls with a space before the opening Checks for method calls with a space before the opening
parenthesis. parenthesis.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces' StyleGuide: "https://github.com/bbatsov/ruby-style-guide#parens-no-spaces"
Enabled: false Enabled: false
Lint/RequireParentheses: Lint/RequireParentheses:
Description: >- Description: >-
Use parentheses in the method call to avoid confusion Use parentheses in the method call to avoid confusion
about precedence. about precedence.
Enabled: false Enabled: false
Lint/UnderscorePrefixedVariableName: Lint/UnderscorePrefixedVariableName:
Description: 'Do not use prefix `_` for a variable that is used.' Description: "Do not use prefix `_` for a variable that is used."
Enabled: false Enabled: false
Lint/UnneededCopDisableDirective: Lint/RedundantCopDisableDirective:
Description: >- Description: >-
Checks for rubocop:disable comments that can be removed. Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops. Note: this cop is not disabled when disabling all cops.
It must be explicitly disabled. It must be explicitly disabled.
Enabled: false Enabled: false
Lint/Void: Lint/Void:
Description: 'Possible use of operator/literal/variable in void context.' Description: "Possible use of operator/literal/variable in void context."
Enabled: false Enabled: false
# Performance # Performance
Performance/CaseWhenSplat: Performance/CaseWhenSplat:
Description: >- Description: >-
Place `when` conditions that use splat at the end Place `when` conditions that use splat at the end
of the list of `when` branches. of the list of `when` branches.
Enabled: false Enabled: false
Performance/Count: Performance/Count:
Description: >- Description: >-
Use `count` instead of `select...size`, `reject...size`, Use `count` instead of `select...size`, `reject...size`,
`select...count`, `reject...count`, `select...length`, `select...count`, `reject...count`, `select...length`,
and `reject...length`. and `reject...length`.
Enabled: false Enabled: false
Performance/Detect: Performance/Detect:
Description: >- Description: >-
Use `detect` instead of `select.first`, `find_all.first`, Use `detect` instead of `select.first`, `find_all.first`,
`select.last`, and `find_all.last`. `select.last`, and `find_all.last`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code' Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code"
Enabled: false Enabled: false
Performance/FlatMap: Performance/FlatMap:
Description: >- Description: >-
Use `Enumerable#flat_map` Use `Enumerable#flat_map`
instead of `Enumerable#map...Array#flatten(1)` instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)` or `Enumberable#collect..Array#flatten(1)`
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code' Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code"
Enabled: false Enabled: false
Performance/ReverseEach: Performance/ReverseEach:
Description: 'Use `reverse_each` instead of `reverse.each`.' Description: "Use `reverse_each` instead of `reverse.each`."
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code' Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code"
Enabled: false
Performance/Sample:
Description: >-
Use `sample` instead of `shuffle.first`,
`shuffle.last`, and `shuffle[Fixnum]`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
Enabled: false Enabled: false
Performance/Size: Performance/Size:
Description: >- Description: >-
Use `size` instead of `count` for counting Use `size` instead of `count` for counting
the number of elements in `Array` and `Hash`. the number of elements in `Array` and `Hash`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code' Reference: "https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code"
Enabled: false Enabled: false
Performance/StringReplacement: Performance/StringReplacement:
Description: >- Description: >-
Use `tr` instead of `gsub` when you are replacing the same Use `tr` instead of `gsub` when you are replacing the same
number of characters. Use `delete` instead of `gsub` when number of characters. Use `delete` instead of `gsub` when
you are deleting characters. you are deleting characters.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code' Reference: "https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code"
Enabled: false Enabled: false
# Rails # Rails
Rails/ActionFilter: Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.' Description: "Enforces consistent use of action filter methods."
Enabled: false Enabled: false
Rails/Date: Rails/Date:
Description: >- Description: >-
Checks the correct usage of date aware methods, Checks the correct usage of date aware methods,
such as Date.today, Date.current etc. such as Date.today, Date.current etc.
Enabled: false Enabled: false
Rails/FindBy: Rails/FindBy:
Description: 'Prefer find_by over where.first.' Description: "Prefer find_by over where.first."
Enabled: false Enabled: false
Rails/FindEach: Rails/FindEach:
Description: 'Prefer all.find_each over all.find.' Description: "Prefer all.find_each over all.find."
Enabled: false Enabled: false
Rails/HasAndBelongsToMany: Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.' Description: "Prefer has_many :through to has_and_belongs_to_many."
Enabled: false Enabled: false
Rails/Output: Rails/Output:
Description: 'Checks for calls to puts, print, etc.' Description: "Checks for calls to puts, print, etc."
Enabled: false Enabled: false
Rails/ReadWriteAttribute: Rails/ReadWriteAttribute:
Description: >- Description: >-
Checks for read_attribute(:attr) and Checks for read_attribute(:attr) and
write_attribute(:attr, val). write_attribute(:attr, val).
Enabled: false Enabled: false
Rails/ScopeArgs: Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.' Description: "Checks the arguments of ActiveRecord scopes."
Enabled: false Enabled: false
Rails/TimeZone: Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.' Description: "Checks the correct usage of time zone aware methods."
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time' StyleGuide: "https://github.com/bbatsov/rails-style-guide#time"
Reference: 'http://danilenko.org/2012/7/6/rails_timezones' Reference: "http://danilenko.org/2012/7/6/rails_timezones"
Enabled: false Enabled: false
Rails/Validation: Rails/Validation:
Description: 'Use validates :attribute, hash of validations.' Description: "Use validates :attribute, hash of validations."
Enabled: false Enabled: false