.rubocop.yml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. AllCops:
  2. TargetRubyVersion: 2.3
  3. Exclude:
  4. - "vendor/**/*"
  5. - "db/**/*"
  6. - "spec/vcr_cassettes/**/*"
  7. UseCache: false
  8. Style/ClassAndModuleChildren:
  9. Description: 'Checks style of children classes and modules.'
  10. Enabled: false
  11. Style/ClassVars:
  12. Description: 'Avoid the use of class variables.'
  13. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
  14. Enabled: false
  15. Style/CollectionMethods:
  16. Description: Preferred collection methods.
  17. StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
  18. Enabled: true
  19. PreferredMethods:
  20. collect: map
  21. collect!: map!
  22. find: detect
  23. find_all: select
  24. reduce: inject
  25. Style/DotPosition:
  26. Description: Checks the position of the dot in multi-line method calls.
  27. StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
  28. Enabled: true
  29. EnforcedStyle: trailing
  30. SupportedStyles:
  31. - leading
  32. - trailing
  33. Style/FileName:
  34. Description: Use snake_case for source file names.
  35. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
  36. Enabled: false
  37. Exclude: []
  38. Style/GuardClause:
  39. Description: Check for conditionals that can be replaced with guard clauses
  40. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
  41. Enabled: false
  42. MinBodyLength: 1
  43. Style/IfUnlessModifier:
  44. Description: Favor modifier if/unless usage when you have a single-line body.
  45. StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
  46. Enabled: false
  47. MaxLineLength: 80
  48. Style/OptionHash:
  49. Description: Don't use option hashes when you can use keyword arguments.
  50. Enabled: false
  51. Style/PercentLiteralDelimiters:
  52. Description: Use `%`-literal delimiters consistently
  53. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
  54. Enabled: false
  55. PreferredDelimiters:
  56. "%": "()"
  57. "%i": "()"
  58. "%q": "()"
  59. "%Q": "()"
  60. "%r": "{}"
  61. "%s": "()"
  62. "%w": "()"
  63. "%W": "()"
  64. "%x": "()"
  65. Style/PredicateName:
  66. Description: Check the names of predicate methods.
  67. StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
  68. Enabled: true
  69. NamePrefix:
  70. - is_
  71. - has_
  72. - have_
  73. NamePrefixBlacklist:
  74. - is_
  75. Exclude:
  76. - spec/**/*
  77. Style/RaiseArgs:
  78. Description: Checks the arguments passed to raise/fail.
  79. StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
  80. Enabled: false
  81. EnforcedStyle: exploded
  82. SupportedStyles:
  83. - compact
  84. - exploded
  85. Style/SignalException:
  86. Description: Checks for proper usage of fail and raise.
  87. StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
  88. Enabled: false
  89. EnforcedStyle: semantic
  90. SupportedStyles:
  91. - only_raise
  92. - only_fail
  93. - semantic
  94. Style/SingleLineBlockParams:
  95. Description: Enforces the names of some block params.
  96. StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
  97. Enabled: false
  98. Methods:
  99. - reduce:
  100. - a
  101. - e
  102. - inject:
  103. - a
  104. - e
  105. Style/SingleLineMethods:
  106. Description: Avoid single-line methods.
  107. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
  108. Enabled: false
  109. AllowIfMethodIsEmpty: true
  110. Style/StringLiterals:
  111. Description: Checks if uses of quotes match the configured preference.
  112. StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
  113. Enabled: false
  114. EnforcedStyle: single_quotes
  115. SupportedStyles:
  116. - single_quotes
  117. - double_quotes
  118. Style/StringLiteralsInInterpolation:
  119. Description: Checks if uses of quotes inside expressions in interpolated strings
  120. match the configured preference.
  121. Enabled: false
  122. EnforcedStyle: single_quotes
  123. SupportedStyles:
  124. - single_quotes
  125. - double_quotes
  126. Style/TrailingCommaInArguments:
  127. Description: 'Checks for trailing comma in argument lists.'
  128. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
  129. Enabled: false
  130. EnforcedStyleForMultiline: no_comma
  131. SupportedStyles:
  132. - comma
  133. - consistent_comma
  134. - no_comma
  135. Style/TrailingCommaInLiteral:
  136. Description: 'Checks for trailing comma in array and hash literals.'
  137. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
  138. Enabled: false
  139. EnforcedStyleForMultiline: no_comma
  140. SupportedStyles:
  141. - comma
  142. - consistent_comma
  143. - no_comma
  144. Metrics/LineLength:
  145. Max: 100
  146. Enabled: false
  147. Metrics/AbcSize:
  148. Description: A calculated magnitude based on number of assignments, branches, and
  149. conditions.
  150. Enabled: false
  151. Max: 15
  152. Metrics/ClassLength:
  153. Description: Avoid classes longer than 100 lines of code.
  154. Enabled: false
  155. CountComments: false
  156. Max: 100
  157. Metrics/ModuleLength:
  158. CountComments: false
  159. Max: 100
  160. Description: Avoid modules longer than 100 lines of code.
  161. Enabled: false
  162. Metrics/CyclomaticComplexity:
  163. Description: A complexity metric that is strongly correlated to the number of test
  164. cases needed to validate a method.
  165. Enabled: false
  166. Max: 6
  167. Metrics/MethodLength:
  168. Description: Avoid methods longer than 10 lines of code.
  169. StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
  170. Enabled: false
  171. CountComments: false
  172. Max: 10
  173. Metrics/ParameterLists:
  174. Description: Avoid parameter lists longer than three or four parameters.
  175. StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
  176. Enabled: false
  177. Max: 5
  178. CountKeywordArgs: true
  179. Metrics/PerceivedComplexity:
  180. Description: A complexity metric geared towards measuring complexity for a human
  181. reader.
  182. Enabled: false
  183. Max: 7
  184. Lint/AssignmentInCondition:
  185. Description: Don't use assignment in conditions.
  186. StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
  187. Enabled: false
  188. AllowSafeAssignment: true
  189. Style/InlineComment:
  190. Description: Avoid inline comments.
  191. Enabled: false
  192. Style/AccessorMethodName:
  193. Description: Check the naming of accessor methods for get_/set_.
  194. Enabled: false
  195. Style/Alias:
  196. Description: Use alias_method instead of alias.
  197. StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
  198. Enabled: false
  199. Style/Documentation:
  200. Description: Document classes and non-namespace modules.
  201. Enabled: false
  202. Style/DoubleNegation:
  203. Description: Checks for uses of double negation (!!).
  204. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
  205. Enabled: false
  206. Style/EachWithObject:
  207. Description: Prefer `each_with_object` over `inject` or `reduce`.
  208. Enabled: false
  209. Style/EmptyLiteral:
  210. Description: Prefer literals to Array.new/Hash.new/String.new.
  211. StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
  212. Enabled: false
  213. Style/NumericLiterals:
  214. Enabled: false
  215. Style/ModuleFunction:
  216. Description: Checks for usage of `extend self` in modules.
  217. StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
  218. Enabled: false
  219. Style/OneLineConditional:
  220. Description: Favor the ternary operator(?:) over if/then/else/end constructs.
  221. StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
  222. Enabled: false
  223. Style/PerlBackrefs:
  224. Description: Avoid Perl-style regex back references.
  225. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
  226. Enabled: false
  227. Style/Send:
  228. Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
  229. may overlap with existing methods.
  230. StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
  231. Enabled: false
  232. Style/SpecialGlobalVars:
  233. Description: Avoid Perl-style global variables.
  234. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
  235. Enabled: false
  236. Style/VariableInterpolation:
  237. Description: Don't interpolate global, instance and class variables directly in
  238. strings.
  239. StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
  240. Enabled: false
  241. Style/WhenThen:
  242. Description: Use when x then ... for one-line cases.
  243. StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
  244. Enabled: false
  245. Lint/EachWithObjectArgument:
  246. Description: Check for immutable argument given to each_with_object.
  247. Enabled: true
  248. Lint/HandleExceptions:
  249. Description: Don't suppress exception.
  250. StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
  251. Enabled: false
  252. Lint/LiteralInCondition:
  253. Description: Checks of literals used in conditions.
  254. Enabled: false
  255. Lint/LiteralInInterpolation:
  256. Description: Checks for literals used in interpolation.
  257. Enabled: false
  258. Lint/UselessAssignment:
  259. Description: 'Checks for useless assignment to a local variable.'
  260. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
  261. Enabled: false