|
| 1 | +AllCops: |
| 2 | + TargetRubyVersion: 2.5 |
| 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 | + - 'railties/test/fixtures/tmp/**/*' |
| 11 | + - 'node_modules/**/*' |
| 12 | + - 'bin/*' |
| 13 | + |
| 14 | +Performance: |
| 15 | + Exclude: |
| 16 | + - '**/test/**/*' |
| 17 | + |
| 18 | +Rails: |
| 19 | + Enabled: true |
| 20 | + |
| 21 | +# Prefer assert_not over assert ! |
| 22 | +Rails/AssertNot: |
| 23 | + Include: |
| 24 | + - '**/test/**/*' |
| 25 | + |
| 26 | +# Prefer assert_not_x over refute_x |
| 27 | +Rails/RefuteMethods: |
| 28 | + Include: |
| 29 | + - '**/test/**/*' |
| 30 | + |
| 31 | +# Prefer &&/|| over and/or. |
| 32 | +Style/AndOr: |
| 33 | + Enabled: true |
| 34 | + |
| 35 | +# Do not use braces for hash literals when they are the last argument of a |
| 36 | +# method call. |
| 37 | +Style/BracesAroundHashParameters: |
| 38 | + Enabled: true |
| 39 | + EnforcedStyle: context_dependent |
| 40 | + |
| 41 | +# Align `when` with `case`. |
| 42 | +Layout/CaseIndentation: |
| 43 | + Enabled: true |
| 44 | + |
| 45 | +# Align comments with method definitions. |
| 46 | +Layout/CommentIndentation: |
| 47 | + Enabled: true |
| 48 | + |
| 49 | +Layout/ElseAlignment: |
| 50 | + Enabled: true |
| 51 | + |
| 52 | +# Align `end` with the matching keyword or starting expression except for |
| 53 | +# assignments, where it should be aligned with the LHS. |
| 54 | +Layout/EndAlignment: |
| 55 | + Enabled: true |
| 56 | + EnforcedStyleAlignWith: variable |
| 57 | + AutoCorrect: true |
| 58 | + |
| 59 | +Layout/EmptyLineAfterMagicComment: |
| 60 | + Enabled: true |
| 61 | + |
| 62 | +Layout/EmptyLinesAroundBlockBody: |
| 63 | + Enabled: true |
| 64 | + |
| 65 | +# In a regular class definition, no empty lines around the body. |
| 66 | +Layout/EmptyLinesAroundClassBody: |
| 67 | + Enabled: true |
| 68 | + |
| 69 | +# In a regular method definition, no empty lines around the body. |
| 70 | +Layout/EmptyLinesAroundMethodBody: |
| 71 | + Enabled: true |
| 72 | + |
| 73 | +# In a regular module definition, no empty lines around the body. |
| 74 | +Layout/EmptyLinesAroundModuleBody: |
| 75 | + Enabled: true |
| 76 | + |
| 77 | +Layout/FirstParameterIndentation: |
| 78 | + Enabled: true |
| 79 | + |
| 80 | +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. |
| 81 | +Style/HashSyntax: |
| 82 | + Enabled: true |
| 83 | + |
| 84 | +# Method definitions after `private` or `protected` isolated calls need one |
| 85 | +# extra level of indentation. |
| 86 | +Layout/IndentationConsistency: |
| 87 | + Enabled: true |
| 88 | + EnforcedStyle: rails |
| 89 | + |
| 90 | +# Two spaces, no tabs (for indentation). |
| 91 | +Layout/IndentationWidth: |
| 92 | + Enabled: true |
| 93 | + |
| 94 | +Layout/LeadingCommentSpace: |
| 95 | + Enabled: true |
| 96 | + |
| 97 | +Layout/SpaceAfterColon: |
| 98 | + Enabled: true |
| 99 | + |
| 100 | +Layout/SpaceAfterComma: |
| 101 | + Enabled: true |
| 102 | + |
| 103 | +Layout/SpaceAroundEqualsInParameterDefault: |
| 104 | + Enabled: true |
| 105 | + |
| 106 | +Layout/SpaceAroundKeyword: |
| 107 | + Enabled: true |
| 108 | + |
| 109 | +Layout/SpaceAroundOperators: |
| 110 | + Enabled: true |
| 111 | + |
| 112 | +Layout/SpaceBeforeComma: |
| 113 | + Enabled: true |
| 114 | + |
| 115 | +Layout/SpaceBeforeFirstArg: |
| 116 | + Enabled: true |
| 117 | + |
| 118 | +Style/DefWithParentheses: |
| 119 | + Enabled: true |
| 120 | + |
| 121 | +# Defining a method with parameters needs parentheses. |
| 122 | +Style/MethodDefParentheses: |
| 123 | + Enabled: true |
| 124 | + |
| 125 | +Style/FrozenStringLiteralComment: |
| 126 | + Enabled: true |
| 127 | + EnforcedStyle: always |
| 128 | + Exclude: |
| 129 | + - 'actionview/test/**/*.builder' |
| 130 | + - 'actionview/test/**/*.ruby' |
| 131 | + - 'actionpack/test/**/*.builder' |
| 132 | + - 'actionpack/test/**/*.ruby' |
| 133 | + - 'activestorage/db/migrate/**/*.rb' |
| 134 | + |
| 135 | +Style/RedundantFreeze: |
| 136 | + Enabled: true |
| 137 | + Exclude: |
| 138 | + - 'actionpack/lib/action_dispatch/journey/router/utils.rb' |
| 139 | + - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' |
| 140 | + |
| 141 | +# Use `foo {}` not `foo{}`. |
| 142 | +Layout/SpaceBeforeBlockBraces: |
| 143 | + Enabled: true |
| 144 | + |
| 145 | +# Use `foo { bar }` not `foo {bar}`. |
| 146 | +Layout/SpaceInsideBlockBraces: |
| 147 | + Enabled: true |
| 148 | + EnforcedStyleForEmptyBraces: space |
| 149 | + |
| 150 | +# Use `{ a: 1 }` not `{a:1}`. |
| 151 | +Layout/SpaceInsideHashLiteralBraces: |
| 152 | + Enabled: true |
| 153 | + |
| 154 | +Layout/SpaceInsideParens: |
| 155 | + Enabled: true |
| 156 | + |
| 157 | +# Check quotes usage according to lint rule below. |
| 158 | +Style/StringLiterals: |
| 159 | + Enabled: true |
| 160 | + EnforcedStyle: double_quotes |
| 161 | + |
| 162 | +# Detect hard tabs, no hard tabs. |
| 163 | +Layout/Tab: |
| 164 | + Enabled: true |
| 165 | + |
| 166 | +# Blank lines should not have any spaces. |
| 167 | +Layout/TrailingBlankLines: |
| 168 | + Enabled: true |
| 169 | + |
| 170 | +# No trailing whitespace. |
| 171 | +Layout/TrailingWhitespace: |
| 172 | + Enabled: true |
| 173 | + |
| 174 | +# Use quotes for string literals when they are enough. |
| 175 | +Style/UnneededPercentQ: |
| 176 | + Enabled: true |
| 177 | + |
| 178 | +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. |
| 179 | +Lint/RequireParentheses: |
| 180 | + Enabled: true |
| 181 | + |
| 182 | +Lint/StringConversionInInterpolation: |
| 183 | + Enabled: true |
| 184 | + |
| 185 | +Lint/UriEscapeUnescape: |
| 186 | + Enabled: true |
| 187 | + |
| 188 | +Style/ParenthesesAroundCondition: |
| 189 | + Enabled: true |
| 190 | + |
| 191 | +Style/RedundantReturn: |
| 192 | + Enabled: true |
| 193 | + AllowMultipleReturnValues: true |
| 194 | + |
| 195 | +Style/Semicolon: |
| 196 | + Enabled: true |
| 197 | + AllowAsExpressionSeparator: true |
| 198 | + |
| 199 | +# Prefer Foo.method over Foo::method |
| 200 | +Style/ColonMethodCall: |
| 201 | + Enabled: true |
| 202 | + |
| 203 | +Style/TrivialAccessors: |
| 204 | + Enabled: true |
| 205 | + |
| 206 | +Performance/FlatMap: |
| 207 | + Enabled: true |
| 208 | + |
| 209 | +Performance/RedundantMerge: |
| 210 | + Enabled: true |
| 211 | + |
| 212 | +Performance/StartWith: |
| 213 | + Enabled: true |
| 214 | + |
| 215 | +Performance/EndWith: |
| 216 | + Enabled: true |
| 217 | + |
| 218 | +Performance/RegexpMatch: |
| 219 | + Enabled: true |
| 220 | + |
| 221 | +Performance/UnfreezeString: |
| 222 | + Enabled: true |
0 commit comments