.rubocop.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. AllowedMethods:
  56. - process_update
  57. Metrics/BlockLength:
  58. Max: 55
  59. Exclude:
  60. - 'lib/tasks/**/*'
  61. - 'lib/mastodon/*_cli.rb'
  62. Metrics/BlockNesting:
  63. Max: 3
  64. Exclude:
  65. - 'lib/mastodon/*_cli.rb'
  66. Metrics/ClassLength:
  67. CountComments: false
  68. Max: 500
  69. Exclude:
  70. - 'lib/mastodon/*_cli.rb'
  71. Metrics/CyclomaticComplexity:
  72. Max: 25
  73. Exclude:
  74. - 'lib/mastodon/*_cli.rb'
  75. AllowedMethods:
  76. - process_update
  77. Layout/LineLength:
  78. AllowURI: true
  79. Enabled: false
  80. Metrics/MethodLength:
  81. CountComments: false
  82. Max: 65
  83. Exclude:
  84. - 'lib/mastodon/*_cli.rb'
  85. Metrics/ModuleLength:
  86. CountComments: false
  87. Max: 200
  88. Metrics/ParameterLists:
  89. Max: 5
  90. CountKeywordArgs: true
  91. Metrics/PerceivedComplexity:
  92. Max: 25
  93. AllowedMethods:
  94. - process_update
  95. Naming/MemoizedInstanceVariableName:
  96. Enabled: false
  97. Naming/MethodParameterName:
  98. Enabled: true
  99. Rails:
  100. Enabled: true
  101. Rails/ApplicationController:
  102. Enabled: false
  103. Exclude:
  104. - 'app/controllers/well_known/**/*.rb'
  105. Rails/BelongsTo:
  106. Enabled: false
  107. Rails/ContentTag:
  108. Enabled: false
  109. Rails/EnumHash:
  110. Enabled: false
  111. Rails/Exit:
  112. Exclude:
  113. - 'lib/mastodon/*'
  114. - 'lib/cli.rb'
  115. Rails/FilePath:
  116. Enabled: false
  117. Rails/HasAndBelongsToMany:
  118. Enabled: false
  119. Rails/HasManyOrHasOneDependent:
  120. Enabled: false
  121. Rails/HelperInstanceVariable:
  122. Enabled: false
  123. Rails/HttpStatus:
  124. Enabled: false
  125. Rails/IndexBy:
  126. Enabled: false
  127. Rails/InverseOf:
  128. Enabled: false
  129. Rails/LexicallyScopedActionFilter:
  130. Enabled: false
  131. Rails/OutputSafety:
  132. Enabled: true
  133. Rails/RakeEnvironment:
  134. Enabled: false
  135. Rails/RedundantForeignKey:
  136. Enabled: false
  137. Rails/SkipsModelValidations:
  138. Enabled: false
  139. Rails/UniqueValidationWithoutIndex:
  140. Enabled: false
  141. Style/AccessorGrouping:
  142. Enabled: true
  143. Style/AccessModifierDeclarations:
  144. Enabled: false
  145. Style/ArrayCoercion:
  146. Enabled: true
  147. Style/BisectedAttrAccessor:
  148. Enabled: true
  149. Style/CaseLikeIf:
  150. Enabled: false
  151. Style/ClassAndModuleChildren:
  152. Enabled: false
  153. Style/CollectionMethods:
  154. Enabled: true
  155. PreferredMethods:
  156. find_all: 'select'
  157. Style/Documentation:
  158. Enabled: false
  159. Style/DoubleNegation:
  160. Enabled: true
  161. Style/ExpandPathArguments:
  162. Enabled: false
  163. Style/ExponentialNotation:
  164. Enabled: true
  165. Style/FormatString:
  166. Enabled: false
  167. Style/FormatStringToken:
  168. Enabled: false
  169. Style/FrozenStringLiteralComment:
  170. Enabled: true
  171. Style/GuardClause:
  172. Enabled: false
  173. Style/HashAsLastArrayItem:
  174. Enabled: false
  175. Style/HashEachMethods:
  176. Enabled: true
  177. Style/HashLikeCase:
  178. Enabled: true
  179. Style/HashTransformKeys:
  180. Enabled: true
  181. Style/HashTransformValues:
  182. Enabled: false
  183. Style/IfUnlessModifier:
  184. Enabled: false
  185. Style/InverseMethods:
  186. Enabled: false
  187. Style/Lambda:
  188. Enabled: false
  189. Style/MutableConstant:
  190. Enabled: false
  191. Style/PercentLiteralDelimiters:
  192. PreferredDelimiters:
  193. '%i': '()'
  194. '%w': '()'
  195. Style/PerlBackrefs:
  196. AutoCorrect: false
  197. Style/RedundantAssignment:
  198. Enabled: false
  199. Style/RedundantFetchBlock:
  200. Enabled: true
  201. Style/RedundantFileExtensionInRequire:
  202. Enabled: true
  203. Style/RedundantRegexpCharacterClass:
  204. Enabled: false
  205. Style/RedundantRegexpEscape:
  206. Enabled: false
  207. Style/RedundantReturn:
  208. Enabled: true
  209. Style/RedundantBegin:
  210. Enabled: false
  211. Style/RegexpLiteral:
  212. Enabled: false
  213. Style/RescueStandardError:
  214. Enabled: false
  215. Style/SignalException:
  216. Enabled: false
  217. Style/SlicingWithRange:
  218. Enabled: true
  219. Style/SymbolArray:
  220. Enabled: false
  221. Style/TrailingCommaInArrayLiteral:
  222. EnforcedStyleForMultiline: 'comma'
  223. Style/TrailingCommaInHashLiteral:
  224. EnforcedStyleForMultiline: 'comma'
  225. Style/UnpackFirst:
  226. Enabled: false