|
| 1 | +AllCops: |
| 2 | + NewCops: enable |
| 3 | + Exclude: |
| 4 | + - "*-core.rb" |
| 5 | + - "tools/plot.rb" |
| 6 | + - "tmp/**" |
| 7 | + - "test/**" |
| 8 | + - "benchmark/*-core-opt-*.rb" |
| 9 | + - "benchmark/Dockerfile.*" |
| 10 | + |
| 11 | +# "eval" is the swiss army knife |
| 12 | +Security/Eval: |
| 13 | + Enabled: false |
| 14 | + |
| 15 | +# Marshal.load is needed when needed |
| 16 | +Security/MarshalLoad: |
| 17 | + Enabled: false |
| 18 | + |
| 19 | +# "while true" loop is easy and fast |
| 20 | +Lint/Loop: |
| 21 | + Enabled: false |
| 22 | +Style/InfiniteLoop: |
| 23 | + Enabled: false |
| 24 | + |
| 25 | +# `String#%` is a great invention of Ruby |
| 26 | +Style/FormatString: |
| 27 | + EnforcedStyle: percent |
| 28 | + |
| 29 | +# I hate frozen string literal |
| 30 | +Style/FrozenStringLiteralComment: |
| 31 | + Enabled: false |
| 32 | + |
| 33 | +# 10_000 looks dirty to me |
| 34 | +Style/NumericLiterals: |
| 35 | + MinDigits: 6 |
| 36 | + |
| 37 | +# explicit return is sometimes good for consistency |
| 38 | +Style/RedundantReturn: |
| 39 | + Enabled: false |
| 40 | + |
| 41 | +# `x == :error ? error-case : normal-case` does not look beautiful to me |
| 42 | +Style/NegatedIfElseCondition: |
| 43 | + Enabled: false |
| 44 | + |
| 45 | +# I like `foo {|x| bar(x) }` and `foo { bar }` |
| 46 | +Layout/SpaceInsideBlockBraces: |
| 47 | + EnforcedStyleForEmptyBraces: space |
| 48 | + SpaceBeforeBlockParameters: false |
| 49 | + |
| 50 | +# `"foo#{bar}baz"` looks too dense to me |
| 51 | +Layout/SpaceInsideStringInterpolation: |
| 52 | + EnforcedStyle: space |
| 53 | + |
| 54 | +# I consistently use double quotes |
| 55 | +Style/StringLiterals: |
| 56 | + EnforcedStyle: double_quotes |
| 57 | +Style/StringLiteralsInInterpolation: |
| 58 | + EnforcedStyle: double_quotes |
| 59 | + |
| 60 | +# A trailing comma in array/hash literal is super cool |
| 61 | +Style/TrailingCommaInArrayLiteral: |
| 62 | + Enabled: false |
| 63 | +Style/TrailingCommaInHashLiteral: |
| 64 | + Enabled: false |
| 65 | + |
| 66 | +# I don't like this so much but virtually needed for ffi struct layout |
| 67 | +Style/TrailingCommaInArguments: |
| 68 | + Enabled: false |
| 69 | + |
| 70 | +# I don't want to fill my code with `.freeze` |
| 71 | +Style/MutableConstant: |
| 72 | + Enabled: false |
| 73 | + |
| 74 | +# I have no idea why this is prohibited... |
| 75 | +Style/ParallelAssignment: |
| 76 | + Enabled: false |
| 77 | + |
| 78 | +# Backrefs are indeed dirty, but `Regexp.last_match` is too verbose |
| 79 | +Style/PerlBackrefs: |
| 80 | + Enabled: false |
| 81 | + |
| 82 | +# I think `{|ary| ary.size }` is not so bad since its type is explicit |
| 83 | +Style/SymbolProc: |
| 84 | + Enabled: false |
| 85 | + |
| 86 | +# Wrapping a code is so bad? Case-by-case. |
| 87 | +Style/GuardClause: |
| 88 | + Enabled: false |
| 89 | + |
| 90 | +# I use hyphen-separated case for script program. |
| 91 | +Naming/FileName: |
| 92 | + Exclude: |
| 93 | + - 'tools/*.rb' |
| 94 | + |
| 95 | +# I don't care class/module size |
| 96 | +Metrics/ClassLength: |
| 97 | + Max: 1000 |
| 98 | +Metrics/ModuleLength: |
| 99 | + Max: 1000 |
| 100 | + |
| 101 | +# I accept two-screen size (about 100 lines?) |
| 102 | +Metrics/MethodLength: |
| 103 | + Max: 100 |
| 104 | +Metrics/BlockLength: |
| 105 | + Max: 100 |
| 106 | + |
| 107 | +# Don't worry, my terminal is big enough |
| 108 | +Layout/LineLength: |
| 109 | + Max: 120 |
| 110 | + |
| 111 | +# Code metrics is good, but I think the default is too strict... |
| 112 | +Metrics/CyclomaticComplexity: |
| 113 | + Max: 40 |
| 114 | +Metrics/PerceivedComplexity: |
| 115 | + Max: 40 |
| 116 | +Metrics/AbcSize: |
| 117 | + Max: 100 |
| 118 | +Metrics/BlockNesting: |
| 119 | + Max: 5 |
| 120 | + |
| 121 | +# I like `x == 0` |
| 122 | +Style/NumericPredicate: |
| 123 | + EnforcedStyle: comparison |
| 124 | + |
| 125 | +# I like `foo1` and `foo_bar_1` |
| 126 | +Naming/VariableNumber: |
| 127 | + Enabled: false |
| 128 | + |
| 129 | +# empty is empty |
| 130 | +Style/EmptyMethod: |
| 131 | + Enabled: false |
| 132 | +Lint/EmptyWhen: |
| 133 | + Enabled: false |
| 134 | + |
| 135 | +# if-elsif-elsif... looks awkward to me |
| 136 | +Style/EmptyCaseCondition: |
| 137 | + Enabled: false |
| 138 | + |
| 139 | +# `rescue StandardError` looks redundant to me |
| 140 | +Style/RescueStandardError: |
| 141 | + Enabled: false |
| 142 | + |
| 143 | +# `END` is always my heredoc delimiter |
| 144 | +Naming/HeredocDelimiterNaming: |
| 145 | + Enabled: false |
| 146 | + |
| 147 | +# I like `%w()` |
| 148 | +Style/PercentLiteralDelimiters: |
| 149 | + PreferredDelimiters: |
| 150 | + '%w': '()' |
| 151 | + |
| 152 | +# I cannot use `%i()` since I want to make this code run in 1.8 |
| 153 | +Style/SymbolArray: |
| 154 | + EnforcedStyle: brackets |
| 155 | + |
| 156 | +# `0 <= n && n <= 0x7f` is completely innocent |
| 157 | +Style/YodaCondition: |
| 158 | + Enabled: false |
| 159 | + |
| 160 | +# I understand but `while true` is faster than `loop do` |
| 161 | +Lint/LiteralAsCondition: |
| 162 | + Enabled: false |
| 163 | + |
| 164 | +# What I want to do is to puts a message to stderr, not to warn users |
| 165 | +Style/StderrPuts: |
| 166 | + Exclude: |
| 167 | + - 'tools/shim.rb' |
| 168 | + |
| 169 | +# Leave me alone |
| 170 | +Style/CommentedKeyword: |
| 171 | + Enabled: false |
| 172 | + |
| 173 | +# I want to casually use %s for simple format |
| 174 | +Style/FormatStringToken: |
| 175 | + Enabled: false |
| 176 | + |
| 177 | +# Indeed, if having a single-line body is not so smart, but just not smart |
| 178 | +Style/IfUnlessModifier: |
| 179 | + Enabled: false |
| 180 | + |
| 181 | +# Let me choose "" + "" |
| 182 | +Style/StringConcatenation: |
| 183 | + Enabled: false |
| 184 | + |
| 185 | +# Keyword arguments cannot be used in Ruby 1.8 |
| 186 | +Style/OptionalBooleanParameter: |
| 187 | + Enabled: false |
| 188 | + |
| 189 | +# I don't use `Kernel#Array` |
| 190 | +Style/ArrayCoercion: |
| 191 | + Enabled: false |
| 192 | + |
| 193 | +# `(1 + 1)**-1` looks awkward |
| 194 | +Layout/SpaceAroundOperators: |
| 195 | + Enabled: false |
| 196 | + |
| 197 | +# One-letter variable is cute |
| 198 | +Naming/MethodParameterName: |
| 199 | + Enabled: false |
| 200 | + |
| 201 | +# It highly depends on the context |
| 202 | +Layout/EmptyLineAfterGuardClause: |
| 203 | + Enabled: false |
| 204 | + |
| 205 | +# Hash table literal is a kind of an art, difficult for machine |
| 206 | +Layout/HashAlignment: |
| 207 | + Enabled: false |
| 208 | + |
| 209 | +# The program needs to work on old rubies |
| 210 | +Style/SafeNavigation: |
| 211 | + Enabled: false |
| 212 | + |
| 213 | +# I want to use %w() only when the length is long |
| 214 | +Style/WordArray: |
| 215 | + Enabled: false |
| 216 | + |
| 217 | +# I want to align lines |
| 218 | +Layout/SpaceAroundMethodCallOperator: |
| 219 | + Enabled: false |
| 220 | + |
| 221 | +# shim is shim |
| 222 | +Layout/EmptyLinesAroundAttributeAccessor: |
| 223 | + Exclude: |
| 224 | + - 'tools/shim.rb' |
| 225 | + |
| 226 | +# This is sometimes a good habit |
| 227 | +Style/RedundantAssignment: |
| 228 | + Enabled: false |
| 229 | + |
| 230 | +# We support Ruby 1.8 |
| 231 | +Gemspec/RequiredRubyVersion: |
| 232 | + Enabled: false |
| 233 | + |
| 234 | +# Ruby 1.8 does not allow rescue clause in a block |
| 235 | +Style/RedundantBegin: |
| 236 | + Enabled: false |
0 commit comments