1
0

.rubocop.yml 4.5 KB

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