You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

313 lines
4.7 KiB

  1. require:
  2. - rubocop-rails
  3. AllCops:
  4. TargetRubyVersion: 2.7
  5. NewCops: disable
  6. Exclude:
  7. - 'spec/**/*'
  8. - 'db/**/*'
  9. - 'app/views/**/*'
  10. - 'config/**/*'
  11. - 'bin/*'
  12. - 'Rakefile'
  13. - 'node_modules/**/*'
  14. - 'Vagrantfile'
  15. - 'vendor/**/*'
  16. - 'lib/json_ld/*'
  17. - 'lib/templates/**/*'
  18. Bundler/OrderedGems:
  19. Enabled: false
  20. Layout/AccessModifierIndentation:
  21. EnforcedStyle: indent
  22. Layout/EmptyLineAfterMagicComment:
  23. Enabled: false
  24. Layout/EmptyLineAfterGuardClause:
  25. Enabled: false
  26. Layout/EmptyLineBetweenDefs:
  27. AllowAdjacentOneLineDefs: true
  28. Layout/EmptyLinesAroundAttributeAccessor:
  29. Enabled: true
  30. Layout/FirstHashElementIndentation:
  31. EnforcedStyle: consistent
  32. Layout/HashAlignment:
  33. Enabled: false
  34. Layout/SpaceAroundMethodCallOperator:
  35. Enabled: true
  36. Layout/SpaceInsideHashLiteralBraces:
  37. EnforcedStyle: space
  38. Lint/DeprecatedOpenSSLConstant:
  39. Enabled: true
  40. Lint/DuplicateElsifCondition:
  41. Enabled: true
  42. Lint/MixedRegexpCaptureTypes:
  43. Enabled: true
  44. Lint/RaiseException:
  45. Enabled: true
  46. Lint/StructNewOverride:
  47. Enabled: true
  48. Lint/UselessAccessModifier:
  49. ContextCreatingMethods:
  50. - class_methods
  51. Metrics/AbcSize:
  52. Max: 115
  53. Exclude:
  54. - 'lib/mastodon/*_cli.rb'
  55. Metrics/BlockLength:
  56. Max: 55
  57. Exclude:
  58. - 'lib/tasks/**/*'
  59. - 'lib/mastodon/*_cli.rb'
  60. Metrics/BlockNesting:
  61. Max: 3
  62. Exclude:
  63. - 'lib/mastodon/*_cli.rb'
  64. Metrics/ClassLength:
  65. CountComments: false
  66. Max: 500
  67. Exclude:
  68. - 'lib/mastodon/*_cli.rb'
  69. Metrics/CyclomaticComplexity:
  70. Max: 25
  71. Exclude:
  72. - 'lib/mastodon/*_cli.rb'
  73. Layout/LineLength:
  74. AllowURI: true
  75. Enabled: false
  76. Metrics/MethodLength:
  77. CountComments: false
  78. Max: 65
  79. Exclude:
  80. - 'lib/mastodon/*_cli.rb'
  81. Metrics/ModuleLength:
  82. CountComments: false
  83. Max: 200
  84. Metrics/ParameterLists:
  85. Max: 5
  86. CountKeywordArgs: true
  87. Metrics/PerceivedComplexity:
  88. Max: 25
  89. Naming/MemoizedInstanceVariableName:
  90. Enabled: false
  91. Naming/MethodParameterName:
  92. Enabled: true
  93. Rails:
  94. Enabled: true
  95. Rails/ApplicationController:
  96. Enabled: false
  97. Exclude:
  98. - 'app/controllers/well_known/**/*.rb'
  99. Rails/BelongsTo:
  100. Enabled: false
  101. Rails/ContentTag:
  102. Enabled: false
  103. Rails/EnumHash:
  104. Enabled: false
  105. Rails/Exit:
  106. Exclude:
  107. - 'lib/mastodon/*'
  108. - 'lib/cli.rb'
  109. Rails/FilePath:
  110. Enabled: false
  111. Rails/HasAndBelongsToMany:
  112. Enabled: false
  113. Rails/HasManyOrHasOneDependent:
  114. Enabled: false
  115. Rails/HelperInstanceVariable:
  116. Enabled: false
  117. Rails/HttpStatus:
  118. Enabled: false
  119. Rails/IndexBy:
  120. Enabled: false
  121. Rails/InverseOf:
  122. Enabled: false
  123. Rails/LexicallyScopedActionFilter:
  124. Enabled: false
  125. Rails/OutputSafety:
  126. Enabled: true
  127. Rails/RakeEnvironment:
  128. Enabled: false
  129. Rails/RedundantForeignKey:
  130. Enabled: false
  131. Rails/SkipsModelValidations:
  132. Enabled: false
  133. Rails/UniqueValidationWithoutIndex:
  134. Enabled: false
  135. Style/AccessorGrouping:
  136. Enabled: true
  137. Style/AccessModifierDeclarations:
  138. Enabled: false
  139. Style/ArrayCoercion:
  140. Enabled: true
  141. Style/BisectedAttrAccessor:
  142. Enabled: true
  143. Style/CaseLikeIf:
  144. Enabled: false
  145. Style/ClassAndModuleChildren:
  146. Enabled: false
  147. Style/CollectionMethods:
  148. Enabled: true
  149. PreferredMethods:
  150. find_all: 'select'
  151. Style/Documentation:
  152. Enabled: false
  153. Style/DoubleNegation:
  154. Enabled: true
  155. Style/ExpandPathArguments:
  156. Enabled: false
  157. Style/ExponentialNotation:
  158. Enabled: true
  159. Style/FormatString:
  160. Enabled: false
  161. Style/FormatStringToken:
  162. Enabled: false
  163. Style/FrozenStringLiteralComment:
  164. Enabled: true
  165. Style/GuardClause:
  166. Enabled: false
  167. Style/HashAsLastArrayItem:
  168. Enabled: false
  169. Style/HashEachMethods:
  170. Enabled: true
  171. Style/HashLikeCase:
  172. Enabled: true
  173. Style/HashTransformKeys:
  174. Enabled: true
  175. Style/HashTransformValues:
  176. Enabled: false
  177. Style/HashSyntax:
  178. Enabled: true
  179. EnforcedStyle: ruby19_no_mixed_keys
  180. Style/IfUnlessModifier:
  181. Enabled: false
  182. Style/InverseMethods:
  183. Enabled: false
  184. Style/Lambda:
  185. Enabled: false
  186. Style/MutableConstant:
  187. Enabled: false
  188. Style/PercentLiteralDelimiters:
  189. PreferredDelimiters:
  190. '%i': '()'
  191. '%w': '()'
  192. Style/PerlBackrefs:
  193. AutoCorrect: false
  194. Style/RedundantAssignment:
  195. Enabled: false
  196. Style/RedundantFetchBlock:
  197. Enabled: true
  198. Style/RedundantFileExtensionInRequire:
  199. Enabled: true
  200. Style/RedundantRegexpCharacterClass:
  201. Enabled: false
  202. Style/RedundantRegexpEscape:
  203. Enabled: false
  204. Style/RedundantReturn:
  205. Enabled: true
  206. Style/RedundantBegin:
  207. Enabled: false
  208. Style/RegexpLiteral:
  209. Enabled: false
  210. Style/RescueStandardError:
  211. Enabled: false
  212. Style/SignalException:
  213. Enabled: false
  214. Style/SlicingWithRange:
  215. Enabled: true
  216. Style/SymbolArray:
  217. Enabled: false
  218. Style/TrailingCommaInArrayLiteral:
  219. EnforcedStyleForMultiline: 'comma'
  220. Style/TrailingCommaInHashLiteral:
  221. EnforcedStyleForMultiline: 'comma'
  222. Style/UnpackFirst:
  223. Enabled: false