|
| 1 | +--- |
| 2 | +# Explicitly disable pending cops for now. This is the default behaviour but |
| 3 | +# this avoids a large warning every time we run it. |
| 4 | +# Stop RuboCop nagging about rubocop-rake. |
| 5 | +# Ensure that RuboCop validates according to the lowest version of Ruby that we support. |
| 6 | +AllCops: |
| 7 | + Exclude: |
| 8 | + - "bin/*" |
| 9 | + NewCops: enable |
| 10 | + SuggestExtensions: false |
| 11 | + TargetRubyVersion: 3.2.0 |
| 12 | + |
| 13 | +# Whether MFA is required or not should be left to the token configuration. |
| 14 | +Gemspec/RequireMFA: |
| 15 | + Enabled: false |
| 16 | + |
| 17 | +# Don't require this extra line break, it can be excessive. |
| 18 | +Layout/EmptyLineAfterGuardClause: |
| 19 | + Enabled: false |
| 20 | + |
| 21 | +# Don't leave complex assignment values hanging off to the right. |
| 22 | +Layout/EndAlignment: |
| 23 | + EnforcedStyleAlignWith: variable |
| 24 | + |
| 25 | +Layout/FirstArrayElementLineBreak: |
| 26 | + Enabled: true |
| 27 | + |
| 28 | +Layout/FirstHashElementLineBreak: |
| 29 | + Enabled: true |
| 30 | + |
| 31 | +Layout/FirstMethodArgumentLineBreak: |
| 32 | + Enabled: true |
| 33 | + |
| 34 | +Layout/FirstMethodParameterLineBreak: |
| 35 | + Enabled: true |
| 36 | + |
| 37 | +# Set a reasonable line length; rely on other cops to correct long lines. |
| 38 | +Layout/LineLength: |
| 39 | + AllowedPatterns: |
| 40 | + - "^\\s*#.*$" |
| 41 | + - ^require(_relative)? |
| 42 | + - "Scrapegraphai::Internal::Type::BaseModel$" |
| 43 | + - "^\\s*[A-Z0-9_]+ = :" |
| 44 | + - "Scrapegraphai::(Models|Resources|Test)::" |
| 45 | + Max: 110 |
| 46 | + |
| 47 | +Layout/MultilineArrayLineBreaks: |
| 48 | + Enabled: true |
| 49 | + |
| 50 | +# Start the assignment on the same line variable is mentioned. |
| 51 | +Layout/MultilineAssignmentLayout: |
| 52 | + EnforcedStyle: same_line |
| 53 | + |
| 54 | +Layout/MultilineHashKeyLineBreaks: |
| 55 | + Enabled: true |
| 56 | + |
| 57 | +Layout/MultilineMethodArgumentLineBreaks: |
| 58 | + Enabled: true |
| 59 | + |
| 60 | +Layout/MultilineMethodParameterLineBreaks: |
| 61 | + Enabled: true |
| 62 | + |
| 63 | +# Prefer compact hash literals. |
| 64 | +Layout/SpaceInsideHashLiteralBraces: |
| 65 | + EnforcedStyle: no_space |
| 66 | + Exclude: |
| 67 | + - "**/*.rbi" |
| 68 | + |
| 69 | +Lint/BooleanSymbol: |
| 70 | + Enabled: false |
| 71 | + |
| 72 | +# This option occasionally mangles identifier names |
| 73 | +Lint/DeprecatedConstants: |
| 74 | + Exclude: |
| 75 | + - "**/*.rbi" |
| 76 | + |
| 77 | +# We use pattern assertion in tests to ensure correctness. |
| 78 | +Lint/DuplicateMatchPattern: |
| 79 | + Exclude: |
| 80 | + - "test/**/*" |
| 81 | + |
| 82 | +# Fairly useful in tests for pattern assertions. |
| 83 | +Lint/EmptyInPattern: |
| 84 | + Exclude: |
| 85 | + - "test/**/*" |
| 86 | + |
| 87 | +Lint/MissingCopEnableDirective: |
| 88 | + Exclude: |
| 89 | + - "examples/**/*.rb" |
| 90 | + |
| 91 | +Lint/MissingSuper: |
| 92 | + Exclude: |
| 93 | + - "**/*.rbi" |
| 94 | + |
| 95 | +Lint/SymbolConversion: |
| 96 | + Exclude: |
| 97 | + - "**/*.rbi" |
| 98 | + |
| 99 | +# Disabled for safety reasons, this option changes code semantics. |
| 100 | +Lint/UnusedMethodArgument: |
| 101 | + AutoCorrect: false |
| 102 | + |
| 103 | +# This option is prone to causing accidental bugs. |
| 104 | +Lint/UselessAssignment: |
| 105 | + AutoCorrect: false |
| 106 | + Exclude: |
| 107 | + - "examples/**/*.rb" |
| 108 | + |
| 109 | +Metrics/AbcSize: |
| 110 | + Enabled: false |
| 111 | + |
| 112 | +Metrics/BlockLength: |
| 113 | + AllowedPatterns: |
| 114 | + - assert_pattern |
| 115 | + - type_alias |
| 116 | + - define_sorbet_constant! |
| 117 | + Exclude: |
| 118 | + - "**/*.rbi" |
| 119 | + |
| 120 | +Metrics/ClassLength: |
| 121 | + Enabled: false |
| 122 | + |
| 123 | +Metrics/CyclomaticComplexity: |
| 124 | + Enabled: false |
| 125 | + |
| 126 | +Metrics/MethodLength: |
| 127 | + Enabled: false |
| 128 | + |
| 129 | +Metrics/ModuleLength: |
| 130 | + Enabled: false |
| 131 | + |
| 132 | +Metrics/ParameterLists: |
| 133 | + Enabled: false |
| 134 | + |
| 135 | +Metrics/PerceivedComplexity: |
| 136 | + Enabled: false |
| 137 | + |
| 138 | +Naming/AccessorMethodName: |
| 139 | + Enabled: false |
| 140 | + |
| 141 | +# Need to preserve block identifier for documentation. |
| 142 | +Naming/BlockForwarding: |
| 143 | + Enabled: false |
| 144 | + |
| 145 | +# Underscores are generally useful for disambiguation. |
| 146 | +Naming/ClassAndModuleCamelCase: |
| 147 | + Enabled: false |
| 148 | + |
| 149 | +Naming/MethodParameterName: |
| 150 | + Enabled: false |
| 151 | + |
| 152 | +Naming/PredicateName: |
| 153 | + Exclude: |
| 154 | + - "**/*.rbi" |
| 155 | + |
| 156 | +Naming/VariableNumber: |
| 157 | + Enabled: false |
| 158 | + |
| 159 | +# Nothing wrong with inline private methods. |
| 160 | +Style/AccessModifierDeclarations: |
| 161 | + Enabled: false |
| 162 | + |
| 163 | +Style/AccessorGrouping: |
| 164 | + Exclude: |
| 165 | + - "**/*.rbi" |
| 166 | + |
| 167 | +# Behaviour of alias_method is more predictable. |
| 168 | +Style/Alias: |
| 169 | + EnforcedStyle: prefer_alias_method |
| 170 | + |
| 171 | +# And/or have confusing precedence, avoid them. |
| 172 | +Style/AndOr: |
| 173 | + EnforcedStyle: always |
| 174 | + |
| 175 | +Style/ArgumentsForwarding: |
| 176 | + Enabled: false |
| 177 | + |
| 178 | +Style/BisectedAttrAccessor: |
| 179 | + Exclude: |
| 180 | + - "**/*.rbi" |
| 181 | + |
| 182 | +# We prefer nested modules in lib/, but are currently using compact style for tests. |
| 183 | +Style/ClassAndModuleChildren: |
| 184 | + Exclude: |
| 185 | + - "test/**/*" |
| 186 | + |
| 187 | +Style/CommentAnnotation: |
| 188 | + Enabled: false |
| 189 | + |
| 190 | +# We should go back and add these docs, but ignore for now. |
| 191 | +Style/Documentation: |
| 192 | + Enabled: false |
| 193 | + |
| 194 | +# Allow explicit empty elses, for clarity. |
| 195 | +Style/EmptyElse: |
| 196 | + Enabled: false |
| 197 | + |
| 198 | +Style/EmptyMethod: |
| 199 | + Exclude: |
| 200 | + - "**/*.rbi" |
| 201 | + |
| 202 | +# We commonly use ENV['KEY'], it's OK. |
| 203 | +Style/FetchEnvVar: |
| 204 | + Enabled: false |
| 205 | + |
| 206 | +# Just to be safe, ensure nobody is mutating our internal strings. |
| 207 | +Style/FrozenStringLiteralComment: |
| 208 | + EnforcedStyle: always |
| 209 | + Exclude: |
| 210 | + - "**/*.rbi" |
| 211 | + |
| 212 | +# Nothing wrong with clear if statements. |
| 213 | +Style/IfUnlessModifier: |
| 214 | + Enabled: false |
| 215 | + |
| 216 | +# Rubocop is pretty bad about mangling single line lambdas. |
| 217 | +Style/Lambda: |
| 218 | + Enabled: false |
| 219 | + |
| 220 | +# Prefer consistency in method calling syntax. |
| 221 | +Style/MethodCallWithArgsParentheses: |
| 222 | + AllowedMethods: |
| 223 | + - raise |
| 224 | + Enabled: true |
| 225 | + Exclude: |
| 226 | + - "**/*.gemspec" |
| 227 | + |
| 228 | +Style/MultilineBlockChain: |
| 229 | + Enabled: false |
| 230 | + |
| 231 | +# Perfectly fine. |
| 232 | +Style/MultipleComparison: |
| 233 | + Enabled: false |
| 234 | + |
| 235 | +Style/MutableConstant: |
| 236 | + Exclude: |
| 237 | + - "**/*.rbi" |
| 238 | + |
| 239 | +# Not all parameters should be named. |
| 240 | +Style/NumberedParameters: |
| 241 | + Enabled: false |
| 242 | + |
| 243 | +Style/NumberedParametersLimit: |
| 244 | + Max: 2 |
| 245 | + |
| 246 | +# Reasonable to use brackets for errors with long messages. |
| 247 | +Style/RaiseArgs: |
| 248 | + Enabled: false |
| 249 | + |
| 250 | +# Be explicit about `RuntimeError`s. |
| 251 | +Style/RedundantException: |
| 252 | + Enabled: false |
| 253 | + |
| 254 | +Style/RedundantInitialize: |
| 255 | + Exclude: |
| 256 | + - "**/*.rbi" |
| 257 | + |
| 258 | +Style/RedundantParentheses: |
| 259 | + Exclude: |
| 260 | + - "**/*.rbi" |
| 261 | + |
| 262 | +# Prefer slashes for regex literals. |
| 263 | +Style/RegexpLiteral: |
| 264 | + EnforcedStyle: slashes |
| 265 | + |
| 266 | +# Allow explicit ifs, especially for imperative use. |
| 267 | +Style/SafeNavigation: |
| 268 | + Enabled: false |
| 269 | + |
| 270 | +Style/SignalException: |
| 271 | + Exclude: |
| 272 | + - Rakefile |
| 273 | + - "**/*.rake" |
| 274 | + |
| 275 | +# We use these sparingly, where we anticipate future branches for the |
| 276 | +# inner conditional. |
| 277 | +Style/SoleNestedConditional: |
| 278 | + Enabled: false |
| 279 | + |
| 280 | +# Prefer double quotes so that interpolation can be easily added. |
| 281 | +Style/StringLiterals: |
| 282 | + EnforcedStyle: double_quotes |
| 283 | + |
| 284 | +# Prefer explicit symbols for clarity; you can search for `:the_symbol`. |
| 285 | +Style/SymbolArray: |
| 286 | + EnforcedStyle: brackets |
| 287 | + |
| 288 | +# This option makes examples harder to read for ruby novices. |
| 289 | +Style/SymbolProc: |
| 290 | + Exclude: |
| 291 | + - "examples/**/*.rb" |
0 commit comments