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.

.rubocop.yml 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. require: rubocop-rspec
  2. AllCops:
  3. TargetRubyVersion: 1.9
  4. Include:
  5. - ./**/*.rb
  6. Exclude:
  7. - files/**/*
  8. - vendor/**/*
  9. - .vendor/**/*
  10. - pkg/**/*
  11. - spec/fixtures/**/*
  12. Lint/ConditionPosition:
  13. Enabled: True
  14. Lint/ElseLayout:
  15. Enabled: True
  16. Lint/UnreachableCode:
  17. Enabled: True
  18. Lint/UselessComparison:
  19. Enabled: True
  20. Lint/EnsureReturn:
  21. Enabled: True
  22. Lint/HandleExceptions:
  23. Enabled: True
  24. Lint/LiteralInCondition:
  25. Enabled: True
  26. Lint/ShadowingOuterLocalVariable:
  27. Enabled: True
  28. Lint/LiteralInInterpolation:
  29. Enabled: True
  30. Style/HashSyntax:
  31. Enabled: True
  32. Style/RedundantReturn:
  33. Enabled: True
  34. Lint/AmbiguousOperator:
  35. Enabled: True
  36. Lint/AssignmentInCondition:
  37. Enabled: True
  38. Style/SpaceBeforeComment:
  39. Enabled: True
  40. Style/AndOr:
  41. Enabled: True
  42. Style/RedundantSelf:
  43. Enabled: True
  44. Metrics/BlockLength:
  45. Enabled: False
  46. # Method length is not necessarily an indicator of code quality
  47. Metrics/MethodLength:
  48. Enabled: False
  49. # Module length is not necessarily an indicator of code quality
  50. Metrics/ModuleLength:
  51. Enabled: False
  52. Style/WhileUntilModifier:
  53. Enabled: True
  54. Lint/AmbiguousRegexpLiteral:
  55. Enabled: True
  56. Lint/Eval:
  57. Enabled: True
  58. Lint/BlockAlignment:
  59. Enabled: True
  60. Lint/DefEndAlignment:
  61. Enabled: True
  62. Lint/EndAlignment:
  63. Enabled: True
  64. Lint/DeprecatedClassMethods:
  65. Enabled: True
  66. Lint/Loop:
  67. Enabled: True
  68. Lint/ParenthesesAsGroupedExpression:
  69. Enabled: True
  70. Lint/RescueException:
  71. Enabled: True
  72. Lint/StringConversionInInterpolation:
  73. Enabled: True
  74. Lint/UnusedBlockArgument:
  75. Enabled: True
  76. Lint/UnusedMethodArgument:
  77. Enabled: True
  78. Lint/UselessAccessModifier:
  79. Enabled: True
  80. Lint/UselessAssignment:
  81. Enabled: True
  82. Lint/Void:
  83. Enabled: True
  84. Style/AccessModifierIndentation:
  85. Enabled: True
  86. Style/AccessorMethodName:
  87. Enabled: True
  88. Style/Alias:
  89. Enabled: True
  90. Style/AlignArray:
  91. Enabled: True
  92. Style/AlignHash:
  93. Enabled: True
  94. Style/AlignParameters:
  95. Enabled: True
  96. Metrics/BlockNesting:
  97. Enabled: True
  98. Style/AsciiComments:
  99. Enabled: True
  100. Style/Attr:
  101. Enabled: True
  102. Style/BracesAroundHashParameters:
  103. Enabled: True
  104. Style/CaseEquality:
  105. Enabled: True
  106. Style/CaseIndentation:
  107. Enabled: True
  108. Style/CharacterLiteral:
  109. Enabled: True
  110. Style/ClassAndModuleCamelCase:
  111. Enabled: True
  112. Style/ClassAndModuleChildren:
  113. Enabled: False
  114. Style/ClassCheck:
  115. Enabled: True
  116. # Class length is not necessarily an indicator of code quality
  117. Metrics/ClassLength:
  118. Enabled: False
  119. Style/ClassMethods:
  120. Enabled: True
  121. Style/ClassVars:
  122. Enabled: True
  123. Style/WhenThen:
  124. Enabled: True
  125. Style/WordArray:
  126. Enabled: True
  127. Style/UnneededPercentQ:
  128. Enabled: True
  129. Style/Tab:
  130. Enabled: True
  131. Style/SpaceBeforeSemicolon:
  132. Enabled: True
  133. Style/TrailingBlankLines:
  134. Enabled: True
  135. Style/SpaceInsideBlockBraces:
  136. Enabled: True
  137. Style/SpaceInsideBrackets:
  138. Enabled: True
  139. Style/SpaceInsideHashLiteralBraces:
  140. Enabled: True
  141. Style/SpaceInsideParens:
  142. Enabled: True
  143. Style/LeadingCommentSpace:
  144. Enabled: True
  145. Style/SpaceBeforeFirstArg:
  146. Enabled: True
  147. Style/SpaceAfterColon:
  148. Enabled: True
  149. Style/SpaceAfterComma:
  150. Enabled: True
  151. Style/SpaceAfterMethodName:
  152. Enabled: True
  153. Style/SpaceAfterNot:
  154. Enabled: True
  155. Style/SpaceAfterSemicolon:
  156. Enabled: True
  157. Style/SpaceAroundEqualsInParameterDefault:
  158. Enabled: True
  159. Style/SpaceAroundOperators:
  160. Enabled: True
  161. Style/SpaceBeforeBlockBraces:
  162. Enabled: True
  163. Style/SpaceBeforeComma:
  164. Enabled: True
  165. Style/CollectionMethods:
  166. Enabled: True
  167. Style/CommentIndentation:
  168. Enabled: True
  169. Style/ColonMethodCall:
  170. Enabled: True
  171. Style/CommentAnnotation:
  172. Enabled: True
  173. # 'Complexity' is very relative
  174. Metrics/CyclomaticComplexity:
  175. Enabled: False
  176. Style/ConstantName:
  177. Enabled: True
  178. Style/Documentation:
  179. Enabled: False
  180. Style/DefWithParentheses:
  181. Enabled: True
  182. Style/PreferredHashMethods:
  183. Enabled: True
  184. Style/DotPosition:
  185. EnforcedStyle: trailing
  186. Style/DoubleNegation:
  187. Enabled: True
  188. Style/EachWithObject:
  189. Enabled: True
  190. Style/EmptyLineBetweenDefs:
  191. Enabled: True
  192. Style/IndentArray:
  193. Enabled: True
  194. Style/IndentHash:
  195. Enabled: True
  196. Style/IndentationConsistency:
  197. Enabled: True
  198. Style/IndentationWidth:
  199. Enabled: True
  200. Style/EmptyLines:
  201. Enabled: True
  202. Style/EmptyLinesAroundAccessModifier:
  203. Enabled: True
  204. Style/EmptyLiteral:
  205. Enabled: True
  206. # Configuration parameters: AllowURI, URISchemes.
  207. Metrics/LineLength:
  208. Enabled: False
  209. Style/MethodCallParentheses:
  210. Enabled: True
  211. Style/MethodDefParentheses:
  212. Enabled: True
  213. Style/LineEndConcatenation:
  214. Enabled: True
  215. Style/TrailingWhitespace:
  216. Enabled: True
  217. Style/StringLiterals:
  218. Enabled: True
  219. Style/TrailingCommaInArguments:
  220. Enabled: True
  221. Style/TrailingCommaInLiteral:
  222. Enabled: True
  223. Style/GlobalVars:
  224. Enabled: True
  225. Style/GuardClause:
  226. Enabled: True
  227. Style/IfUnlessModifier:
  228. Enabled: True
  229. Style/MultilineIfThen:
  230. Enabled: True
  231. Style/NegatedIf:
  232. Enabled: True
  233. Style/NegatedWhile:
  234. Enabled: True
  235. Style/Next:
  236. Enabled: True
  237. Style/SingleLineBlockParams:
  238. Enabled: True
  239. Style/SingleLineMethods:
  240. Enabled: True
  241. Style/SpecialGlobalVars:
  242. Enabled: True
  243. Style/TrivialAccessors:
  244. Enabled: True
  245. Style/UnlessElse:
  246. Enabled: True
  247. Style/VariableInterpolation:
  248. Enabled: True
  249. Style/VariableName:
  250. Enabled: True
  251. Style/WhileUntilDo:
  252. Enabled: True
  253. Style/EvenOdd:
  254. Enabled: True
  255. Style/FileName:
  256. Enabled: True
  257. Style/For:
  258. Enabled: True
  259. Style/Lambda:
  260. Enabled: True
  261. Style/MethodName:
  262. Enabled: True
  263. Style/MultilineTernaryOperator:
  264. Enabled: True
  265. Style/NestedTernaryOperator:
  266. Enabled: True
  267. Style/NilComparison:
  268. Enabled: True
  269. Style/FormatString:
  270. Enabled: True
  271. Style/MultilineBlockChain:
  272. Enabled: True
  273. Style/Semicolon:
  274. Enabled: True
  275. Style/SignalException:
  276. Enabled: True
  277. Style/NonNilCheck:
  278. Enabled: True
  279. Style/Not:
  280. Enabled: True
  281. Style/NumericLiterals:
  282. Enabled: True
  283. Style/OneLineConditional:
  284. Enabled: True
  285. Style/OpMethod:
  286. Enabled: True
  287. Style/ParenthesesAroundCondition:
  288. Enabled: True
  289. Style/PercentLiteralDelimiters:
  290. Enabled: True
  291. Style/PerlBackrefs:
  292. Enabled: True
  293. Style/PredicateName:
  294. Enabled: True
  295. Style/RedundantException:
  296. Enabled: True
  297. Style/SelfAssignment:
  298. Enabled: True
  299. Style/Proc:
  300. Enabled: True
  301. Style/RaiseArgs:
  302. Enabled: True
  303. Style/RedundantBegin:
  304. Enabled: True
  305. Style/RescueModifier:
  306. Enabled: True
  307. # based on https://github.com/voxpupuli/modulesync_config/issues/168
  308. Style/RegexpLiteral:
  309. EnforcedStyle: percent_r
  310. Enabled: True
  311. Lint/UnderscorePrefixedVariableName:
  312. Enabled: True
  313. Metrics/ParameterLists:
  314. Enabled: False
  315. Lint/RequireParentheses:
  316. Enabled: True
  317. Style/SpaceBeforeFirstArg:
  318. Enabled: True
  319. Style/ModuleFunction:
  320. Enabled: True
  321. Lint/Debugger:
  322. Enabled: True
  323. Style/IfWithSemicolon:
  324. Enabled: True
  325. Style/Encoding:
  326. Enabled: True
  327. Style/BlockDelimiters:
  328. Enabled: True
  329. Style/MultilineBlockLayout:
  330. Enabled: True
  331. # 'Complexity' is very relative
  332. Metrics/AbcSize:
  333. Enabled: False
  334. # 'Complexity' is very relative
  335. Metrics/PerceivedComplexity:
  336. Enabled: False
  337. Lint/UselessAssignment:
  338. Enabled: True
  339. Style/ClosingParenthesisIndentation:
  340. Enabled: True
  341. # RSpec
  342. # We don't use rspec in this way
  343. RSpec/DescribeClass:
  344. Enabled: False
  345. # Example length is not necessarily an indicator of code quality
  346. RSpec/ExampleLength:
  347. Enabled: False
  348. RSpec/NamedSubject:
  349. Enabled: False