.rubocop.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. require:
  2. - rubocop-rails
  3. AllCops:
  4. TargetRubyVersion: 2.5
  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/IfUnlessModifier:
  178. Enabled: false
  179. Style/InverseMethods:
  180. Enabled: false
  181. Style/Lambda:
  182. Enabled: false
  183. Style/MutableConstant:
  184. Enabled: false
  185. Style/PercentLiteralDelimiters:
  186. PreferredDelimiters:
  187. '%i': '()'
  188. '%w': '()'
  189. Style/PerlBackrefs:
  190. AutoCorrect: false
  191. Style/RedundantAssignment:
  192. Enabled: false
  193. Style/RedundantFetchBlock:
  194. Enabled: true
  195. Style/RedundantFileExtensionInRequire:
  196. Enabled: true
  197. Style/RedundantRegexpCharacterClass:
  198. Enabled: false
  199. Style/RedundantRegexpEscape:
  200. Enabled: false
  201. Style/RedundantReturn:
  202. Enabled: true
  203. Style/RedundantBegin:
  204. Enabled: false
  205. Style/RegexpLiteral:
  206. Enabled: false
  207. Style/RescueStandardError:
  208. Enabled: false
  209. Style/SignalException:
  210. Enabled: false
  211. Style/SlicingWithRange:
  212. Enabled: true
  213. Style/SymbolArray:
  214. Enabled: false
  215. Style/TrailingCommaInArrayLiteral:
  216. EnforcedStyleForMultiline: 'comma'
  217. Style/TrailingCommaInHashLiteral:
  218. EnforcedStyleForMultiline: 'comma'
  219. Style/UnpackFirst:
  220. Enabled: false