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