.rubocop.yml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. # Default enabled cops
  2. # https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
  3. # TODO:
  4. # https://github.com/bbatsov/rubocop#includingexcluding-files
  5. AllCops:
  6. RunRailsCops: true
  7. Exclude:
  8. - 'bin/rails'
  9. - 'bin/rake'
  10. - 'bin/spring'
  11. - 'db/schema.rb'
  12. # Zammad StyleGuide
  13. Metrics/LineLength:
  14. Description: 'Limit lines to 80 characters.'
  15. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
  16. Enabled: false
  17. Style/NegatedIf:
  18. Description: >-
  19. Favor unless over if for negative conditions
  20. (or control flow or).
  21. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
  22. Enabled: false
  23. Style/IfUnlessModifier:
  24. Description: >-
  25. Favor modifier if/unless usage when you have a
  26. single-line body.
  27. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
  28. Enabled: false
  29. Style/TrailingComma:
  30. Description: 'Checks for trailing comma in parameter lists and literals.'
  31. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
  32. Enabled: false
  33. Style/SpaceInsideParens:
  34. Description: 'No spaces after ( or before ).'
  35. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
  36. Enabled: false
  37. Style/SpaceAfterMethodName:
  38. Description: >-
  39. Do not put a space between a method name and the opening
  40. parenthesis in a method definition.
  41. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
  42. Enabled: false
  43. Style/SingleSpaceBeforeFirstArg:
  44. Description: >-
  45. Checks that exactly one space is used between a method name
  46. and the first argument for method calls without parentheses.
  47. Enabled: false
  48. Style/LeadingCommentSpace:
  49. Description: 'Comments should start with a space.'
  50. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
  51. Enabled: false
  52. Style/MethodCallParentheses:
  53. Description: 'Do not use parentheses for method calls with no arguments.'
  54. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
  55. Enabled: false
  56. Style/SpaceInsideBrackets:
  57. Description: 'No spaces after [ or before ].'
  58. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
  59. Enabled: false
  60. Style/DefWithParentheses:
  61. Description: 'Use def with parentheses when there are arguments.'
  62. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
  63. Enabled: false
  64. Style/MethodDefParentheses:
  65. Description: >-
  66. Checks if the method definitions have or don't have
  67. parentheses.
  68. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
  69. Enabled: false
  70. Style/EmptyLinesAroundClassBody:
  71. Description: "Keeps track of empty lines around class bodies."
  72. Enabled: false
  73. Style/EmptyLinesAroundMethodBody:
  74. Description: "Keeps track of empty lines around method bodies."
  75. Enabled: false
  76. Style/EmptyLinesAroundBlockBody:
  77. Description: "Keeps track of empty lines around block bodies."
  78. Enabled: false
  79. Style/EmptyLinesAroundModuleBody:
  80. Description: "Keeps track of empty lines around module bodies."
  81. Enabled: false
  82. Style/BlockDelimiters:
  83. Description: >-
  84. Avoid using {...} for multi-line blocks (multiline chaining is
  85. always ugly).
  86. Prefer {...} over do...end for single-line blocks.
  87. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
  88. Enabled: false
  89. Style/MultilineBlockChain:
  90. Description: 'Avoid multi-line chains of blocks.'
  91. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
  92. Enabled: false
  93. Metrics/ClassLength:
  94. Description: 'Avoid classes longer than 100 lines of code.'
  95. Enabled: false
  96. Metrics/MethodLength:
  97. Description: 'Avoid methods longer than 10 lines of code.'
  98. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
  99. Enabled: false
  100. Style/BlockComments:
  101. Description: 'Do not use block comments.'
  102. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
  103. Enabled: false
  104. Style/PerlBackrefs:
  105. Description: 'Avoid Perl-style regex back references.'
  106. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
  107. Enabled: false
  108. Style/SelfAssignment:
  109. Description: >-
  110. Checks for places where self-assignment shorthand should have
  111. been used.
  112. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
  113. Enabled: false
  114. Style/BracesAroundHashParameters:
  115. Description: 'Enforce braces style around hash parameters.'
  116. Enabled: false
  117. Rails/FindEach:
  118. Description: 'Prefer all.find_each over all.find.'
  119. Enabled: false
  120. Rails/HasAndBelongsToMany:
  121. Description: 'Prefer has_many :through to has_and_belongs_to_many.'
  122. # StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
  123. Enabled: false
  124. Metrics/PerceivedComplexity:
  125. Description: >-
  126. A complexity metric geared towards measuring complexity for a
  127. human reader.
  128. Enabled: false
  129. # TODO
  130. Style/FileName:
  131. Description: 'Use snake_case for source file names.'
  132. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
  133. Enabled: true
  134. Exclude:
  135. - 'script/websocket-server.rb'
  136. Style/Documentation:
  137. Description: 'Document classes and non-namespace modules.'
  138. Enabled: false
  139. Style/EmptyLineBetweenDefs:
  140. Description: 'Use empty lines between defs.'
  141. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
  142. Enabled: false
  143. Rails/ActionFilter:
  144. Description: 'Enforces consistent use of action filter methods.'
  145. Enabled: false
  146. Rails/FindBy:
  147. Description: 'Prefer find_by over where.first.'
  148. Enabled: false
  149. Style/NilComparison:
  150. Description: 'Prefer x.nil? to x == nil.'
  151. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
  152. Enabled: false
  153. Style/SymbolProc:
  154. Description: 'Use symbols as procs instead of blocks when possible.'
  155. Enabled: false
  156. Style/RedundantBegin:
  157. Description: "Don't use begin blocks when they are not needed."
  158. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
  159. Enabled: false
  160. Lint/UnusedBlockArgument:
  161. Description: 'Checks for unused block arguments.'
  162. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
  163. Enabled: false
  164. Lint/UnusedMethodArgument:
  165. Description: 'Checks for unused method arguments.'
  166. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
  167. Enabled: false
  168. Style/SignalException:
  169. Description: 'Checks for proper usage of fail and raise.'
  170. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
  171. Enabled: false
  172. Style/WordArray:
  173. Description: 'Use %w or %W for arrays of words.'
  174. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
  175. Enabled: false
  176. Metrics/AbcSize:
  177. Description: >-
  178. A calculated magnitude based on number of assignments,
  179. branches, and conditions.
  180. Enabled: false
  181. Style/RedundantSelf:
  182. Enabled: false
  183. Style/Next:
  184. Enabled: false
  185. Lint/UselessAccessModifier:
  186. Enabled: false
  187. Style/CommentIndentation:
  188. Enabled: false
  189. Metrics/CyclomaticComplexity:
  190. Enabled: false
  191. Style/ClassAndModuleChildren:
  192. Enabled: false
  193. Lint/StringConversionInInterpolation:
  194. Enabled: false
  195. Style/GlobalVars:
  196. Enabled: false
  197. Rails/TimeZone:
  198. Enabled: false
  199. Metrics/BlockNesting:
  200. Enabled: false
  201. Lint/RescueException:
  202. Enabled: false
  203. Style/PredicateName:
  204. Enabled: false
  205. Style/ClassVars:
  206. Enabled: false
  207. Style/SpaceBeforeComment:
  208. Enabled: false
  209. Lint/UselessAssignment:
  210. Enabled: false
  211. Lint/UnreachableCode:
  212. Enabled: false
  213. Lint/ShadowingOuterLocalVariable:
  214. Enabled: false
  215. Lint/Eval:
  216. Enabled: false
  217. Style/ModuleFunction:
  218. Enabled: false