Add RuboCop to enforce some styles (#31509).

Patch by Marius BALTEANU and Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@18259 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2019-06-19 00:49:28 +00:00
parent dd55d8f7e7
commit 8baddf11bc
4 changed files with 2263 additions and 0 deletions

44
.rubocop.yml Normal file
View File

@@ -0,0 +1,44 @@
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.3
TargetRailsVersion: 5.2
Exclude:
- '**/vendor/**/*'
- '**/tmp/**/*'
- '**/bin/**/*'
- '**/plugins/**/*'
- '**/extra/**/*'
- '**/lib/generators/**/templates/*'
- '**/lib/tasks/**/*'
- '**/files/**/*'
# Enable extensions
Rails:
Enabled: true
# Rules for Redmine
Layout/SpaceBeforeBlockBraces:
Enabled: false
Rails/BulkChangeTable:
Exclude:
- 'db/migrate/20120714122200_add_workflows_rule_fields.rb'
- 'db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb'
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Exclude:
- 'db/**/*.rb'
- 'Gemfile'
- 'Rakefile'
- 'config.ru'
- 'config/additional_environment.rb'
Style/HashSyntax:
Enabled: true
EnforcedStyle: no_mixed_keys