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 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. inherit_from: .rubocop_todo.yml
  2. AllCops:
  3. TargetRubyVersion: 2.3
  4. TargetRailsVersion: 5.2
  5. Exclude:
  6. - '**/vendor/**/*'
  7. - '**/tmp/**/*'
  8. - '**/bin/**/*'
  9. - '**/plugins/**/*'
  10. - '**/extra/**/*'
  11. - '**/lib/generators/**/templates/*'
  12. - '**/lib/tasks/**/*'
  13. - '**/files/**/*'
  14. - 'db/schema.rb'
  15. # Enable extensions
  16. require:
  17. - rubocop-performance
  18. - rubocop-rails
  19. # Rules for Redmine
  20. Bundler/OrderedGems:
  21. Enabled: false
  22. Layout/CaseIndentation:
  23. Exclude:
  24. - 'config/initializers/10-patches.rb'
  25. Layout/EmptyLineBetweenDefs:
  26. AllowAdjacentOneLineDefs: true
  27. Layout/SpaceBeforeBlockBraces:
  28. # "space" is used more than "no_space".
  29. # But "no_space" is more natural in one liner.
  30. # str = path.to_s.split(%r{[/\\]}).select{|p| !p.blank?}.join("/")
  31. Enabled: false
  32. # You can see results by "rubocop --only Layout/SpaceInsideBlockBraces"
  33. Layout/SpaceInsideBlockBraces:
  34. EnforcedStyle: no_space
  35. SpaceBeforeBlockParameters: false
  36. # You can see results by "rubocop --only Layout/SpaceInsideHashLiteralBraces"
  37. Layout/SpaceInsideHashLiteralBraces:
  38. EnforcedStyle: no_space
  39. Lint/RaiseException:
  40. Enabled: true
  41. Lint/StructNewOverride:
  42. Enabled: true
  43. Lint/SuppressedException:
  44. AllowComments: true
  45. Layout/TrailingWhitespace:
  46. AllowInHeredoc: true
  47. Metrics:
  48. Enabled: false
  49. Naming/AccessorMethodName:
  50. Enabled: false
  51. Naming/BinaryOperatorParameterName:
  52. Enabled: false
  53. Naming/PredicateName:
  54. Enabled: false
  55. Rails/BulkChangeTable:
  56. Exclude:
  57. - 'db/migrate/20120714122200_add_workflows_rule_fields.rb'
  58. - 'db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb'
  59. Rails/HelperInstanceVariable:
  60. Enabled: false
  61. Style/AsciiComments:
  62. Exclude:
  63. # Copyright credit has non ascii character.
  64. # We can not change nor remove it.
  65. - 'app/models/repository/git.rb'
  66. Style/EmptyElse:
  67. EnforcedStyle: empty
  68. Style/FormatString:
  69. EnforcedStyle: sprintf
  70. Style/FormatStringToken:
  71. Enabled: false
  72. Style/FrozenStringLiteralComment:
  73. Enabled: true
  74. EnforcedStyle: always
  75. Exclude:
  76. - 'db/**/*.rb'
  77. - 'Gemfile'
  78. - 'Rakefile'
  79. - 'config.ru'
  80. - 'config/additional_environment.rb'
  81. Style/HashEachMethods:
  82. Enabled: true
  83. Style/HashSyntax:
  84. Enabled: true
  85. EnforcedStyle: no_mixed_keys
  86. Style/HashTransformKeys:
  87. Enabled: true
  88. Style/HashTransformValues:
  89. Enabled: true
  90. Style/IdenticalConditionalBranches:
  91. Exclude:
  92. - 'config/initializers/10-patches.rb'
  93. - 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
  94. Style/TrailingCommaInArrayLiteral:
  95. Enabled: false
  96. Style/TrailingCommaInHashLiteral:
  97. Enabled: false