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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. inherit_from: .rubocop_todo.yml
  2. AllCops:
  3. TargetRubyVersion: 2.4
  4. TargetRailsVersion: 5.2
  5. NewCops: enable
  6. Exclude:
  7. - '**/vendor/**/*'
  8. - '**/tmp/**/*'
  9. - '**/bin/**/*'
  10. - '**/plugins/**/*'
  11. - '**/extra/**/*'
  12. - '**/lib/generators/**/templates/*'
  13. - '**/lib/tasks/**/*'
  14. - '**/files/**/*'
  15. - 'db/schema.rb'
  16. # Enable extensions
  17. require:
  18. - rubocop-performance
  19. - rubocop-rails
  20. # Rules for Redmine
  21. Bundler/OrderedGems:
  22. Enabled: false
  23. Layout/CaseIndentation:
  24. Exclude:
  25. - 'config/initializers/10-patches.rb'
  26. Layout/EmptyLineBetweenDefs:
  27. AllowAdjacentOneLineDefs: true
  28. Layout/SpaceAroundEqualsInParameterDefault:
  29. Enabled: false
  30. Layout/SpaceBeforeBlockBraces:
  31. # "space" is used more than "no_space".
  32. # But "no_space" is more natural in one liner.
  33. # str = path.to_s.split(%r{[/\\]}).select{|p| !p.blank?}.join("/")
  34. Enabled: false
  35. Layout/SpaceInsideBlockBraces:
  36. Enabled: false
  37. Layout/SpaceInsideHashLiteralBraces:
  38. Enabled: false
  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/RaiseArgs:
  95. Enabled: false
  96. Style/TrailingCommaInArrayLiteral:
  97. Enabled: false
  98. Style/TrailingCommaInHashLiteral:
  99. Enabled: false