.rubocop.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. Style/ClassAndModuleChildren:
  125. Description: 'Checks style of children classes and modules.'
  126. Enabled: false
  127. # 2.0
  128. Metrics/PerceivedComplexity:
  129. Description: >-
  130. A complexity metric geared towards measuring complexity for a
  131. human reader.
  132. Enabled: false
  133. Metrics/AbcSize:
  134. Description: >-
  135. A calculated magnitude based on number of assignments,
  136. branches, and conditions.
  137. Enabled: false
  138. # TODO
  139. Style/FileName:
  140. Description: 'Use snake_case for source file names.'
  141. StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
  142. Enabled: true
  143. Exclude:
  144. - 'script/websocket-server.rb'
  145. Style/Documentation:
  146. Description: 'Document classes and non-namespace modules.'
  147. Enabled: false
  148. Style/RedundantSelf:
  149. Enabled: false
  150. Style/CommentIndentation:
  151. Enabled: false
  152. Metrics/CyclomaticComplexity:
  153. Enabled: false
  154. Style/GlobalVars:
  155. Enabled: false
  156. Rails/TimeZone:
  157. Enabled: false
  158. Metrics/BlockNesting:
  159. Enabled: false
  160. Lint/RescueException:
  161. Enabled: false
  162. Style/PredicateName:
  163. Enabled: false
  164. Style/ClassVars:
  165. Enabled: false
  166. Style/SpaceBeforeComment:
  167. Enabled: false
  168. Lint/UselessAssignment:
  169. Enabled: false
  170. Lint/UnreachableCode:
  171. Enabled: false
  172. Lint/ShadowingOuterLocalVariable:
  173. Enabled: false
  174. Lint/Eval:
  175. Enabled: false
  176. Style/ModuleFunction:
  177. Enabled: false