.rubocop.yml 4.5 KB

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