|
| 1 | +AllCops: |
| 2 | + TargetRubyVersion: 2.6.8 |
| 3 | + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop |
| 4 | + # to ignore them, so only the ones explicitly set in this file are enabled. |
| 5 | + DisabledByDefault: true |
| 6 | + Exclude: |
| 7 | + - '**/templates/**/*' |
| 8 | + - '**/vendor/**/*' |
| 9 | + - 'actionpack/lib/action_dispatch/journey/parser.rb' |
| 10 | + |
| 11 | +# Prefer &&/|| over and/or. |
| 12 | +Style/AndOr: |
| 13 | + Enabled: true |
| 14 | + |
| 15 | +# Align `when` with `case`. |
| 16 | +Layout/CaseIndentation: |
| 17 | + Enabled: true |
| 18 | + |
| 19 | +# Align comments with method definitions. |
| 20 | +Layout/CommentIndentation: |
| 21 | + Enabled: true |
| 22 | + |
| 23 | +Layout/ElseAlignment: |
| 24 | + Enabled: true |
| 25 | + |
| 26 | +Layout/EmptyLineAfterMagicComment: |
| 27 | + Enabled: true |
| 28 | + |
| 29 | +# In a regular class definition, no empty lines around the body. |
| 30 | +Layout/EmptyLinesAroundClassBody: |
| 31 | + Enabled: true |
| 32 | + |
| 33 | +# In a regular method definition, no empty lines around the body. |
| 34 | +Layout/EmptyLinesAroundMethodBody: |
| 35 | + Enabled: true |
| 36 | + |
| 37 | +# In a regular module definition, no empty lines around the body. |
| 38 | +Layout/EmptyLinesAroundModuleBody: |
| 39 | + Enabled: true |
| 40 | + |
| 41 | +Layout/FirstParameterIndentation: |
| 42 | + Enabled: true |
| 43 | + |
| 44 | +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. |
| 45 | +Style/HashSyntax: |
| 46 | + Enabled: true |
| 47 | + |
| 48 | +# Method definitions after `private` or `protected` isolated calls need one |
| 49 | +# extra level of indentation. |
| 50 | +Layout/IndentationConsistency: |
| 51 | + Enabled: true |
| 52 | + EnforcedStyle: indented_internal_methods |
| 53 | + |
| 54 | +# Two spaces, no tabs (for indentation). |
| 55 | +Layout/IndentationWidth: |
| 56 | + Enabled: true |
| 57 | + |
| 58 | +Layout/LeadingCommentSpace: |
| 59 | + Enabled: true |
| 60 | + |
| 61 | +Layout/SpaceAfterColon: |
| 62 | + Enabled: true |
| 63 | + |
| 64 | +Layout/SpaceAfterComma: |
| 65 | + Enabled: true |
| 66 | + |
| 67 | +Layout/SpaceAroundEqualsInParameterDefault: |
| 68 | + Enabled: true |
| 69 | + |
| 70 | +Layout/SpaceAroundKeyword: |
| 71 | + Enabled: true |
| 72 | + |
| 73 | +Layout/SpaceAroundOperators: |
| 74 | + Enabled: true |
| 75 | + |
| 76 | +Layout/SpaceBeforeComma: |
| 77 | + Enabled: true |
| 78 | + |
| 79 | +Layout/SpaceBeforeFirstArg: |
| 80 | + Enabled: true |
| 81 | + |
| 82 | +Style/DefWithParentheses: |
| 83 | + Enabled: true |
| 84 | + |
| 85 | +# Defining a method with parameters needs parentheses. |
| 86 | +Style/MethodDefParentheses: |
| 87 | + Enabled: true |
| 88 | + |
| 89 | +Style/FrozenStringLiteralComment: |
| 90 | + Enabled: true |
| 91 | + EnforcedStyle: always |
| 92 | + Exclude: |
| 93 | + - 'actionview/test/**/*.builder' |
| 94 | + - 'actionview/test/**/*.ruby' |
| 95 | + - 'actionpack/test/**/*.builder' |
| 96 | + - 'actionpack/test/**/*.ruby' |
| 97 | + - 'activestorage/db/migrate/**/*.rb' |
| 98 | + |
| 99 | +# Use `foo {}` not `foo{}`. |
| 100 | +Layout/SpaceBeforeBlockBraces: |
| 101 | + Enabled: true |
| 102 | + |
| 103 | +# Use `foo { bar }` not `foo {bar}`. |
| 104 | +Layout/SpaceInsideBlockBraces: |
| 105 | + Enabled: true |
| 106 | + |
| 107 | +# Use `{ a: 1 }` not `{a:1}`. |
| 108 | +Layout/SpaceInsideHashLiteralBraces: |
| 109 | + Enabled: true |
| 110 | + |
| 111 | +Layout/SpaceInsideParens: |
| 112 | + Enabled: true |
| 113 | + |
| 114 | +# Check quotes usage according to lint rule below. |
| 115 | +Style/StringLiterals: |
| 116 | + Enabled: true |
| 117 | + EnforcedStyle: double_quotes |
| 118 | + |
| 119 | +# Detect hard tabs, no hard tabs. |
| 120 | +Layout/IndentationStyle: |
| 121 | + Enabled: true |
| 122 | + |
| 123 | +# Blank lines should not have any spaces. |
| 124 | +Layout/TrailingEmptyLines: |
| 125 | + Enabled: true |
| 126 | + |
| 127 | +# No trailing whitespace. |
| 128 | +Layout/TrailingWhitespace: |
| 129 | + Enabled: true |
| 130 | + |
| 131 | +Layout/ExtraSpacing: |
| 132 | + AllowForAlignment: true |
| 133 | + ForceEqualSignAlignment: true |
| 134 | + Enabled: true |
| 135 | + |
| 136 | +# Use quotes for string literals when they are enough. |
| 137 | +Style/RedundantPercentQ: |
| 138 | + Enabled: true |
| 139 | + |
| 140 | +# Align `end` with the matching keyword or starting expression except for |
| 141 | +# assignments, where it should be aligned with the LHS. |
| 142 | +Layout/EndAlignment: |
| 143 | + Enabled: true |
| 144 | + EnforcedStyleAlignWith: variable |
| 145 | + AutoCorrect: true |
| 146 | + |
| 147 | +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. |
| 148 | +Lint/RequireParentheses: |
| 149 | + Enabled: true |
| 150 | + |
| 151 | +Style/RedundantReturn: |
| 152 | + Enabled: true |
| 153 | + AllowMultipleReturnValues: true |
| 154 | + |
| 155 | +Style/Semicolon: |
| 156 | + Enabled: true |
| 157 | + AllowAsExpressionSeparator: true |
| 158 | + |
| 159 | +# Prefer Foo.method over Foo::method |
| 160 | +Style/ColonMethodCall: |
| 161 | + Enabled: true |
0 commit comments