diff --git a/.hound.yml b/.hound.yml index 9e537b95c..973ad515c 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,7 +1,6 @@ -ruby: - config_file: .rubocop.yml - exclude: - -"config/initializers/wice_grid_config.rb" +# Run as commit-hook instead +rubocop: + enabled: false java_script: config_file: .javascript-style.json exclude: diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 000000000..a1e04320c --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,4 @@ +PreCommit: + StandardRb: + enabled: true + command: ['bundle', 'exec', 'standardrb', '--fix'] # Invoke within Bundler context diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index e6d5bb0a8..000000000 --- a/.rubocop.yml +++ /dev/null @@ -1,56 +0,0 @@ -AllCops: - TargetRubyVersion: 2.5 - Exclude: - - 'db/schema.rb' - -Style/ClassAndModuleChildren: - Description: 'Checks style of children classes and modules.' - Enabled: true - EnforcedStyle: compact - -Style/EmptyMethod: - Description: 'Checks the formatting of empty method definitions.' - StyleGuide: '#no-single-line-methods' - Enabled: true - EnforcedStyle: expanded - -Style/Documentation: - Description: 'Document classes and non-namespace modules.' - Enabled: false - Exclude: - - 'spec/**/*' - - 'test/**/*' - -Style/GuardClause: - Description: 'Check for conditionals that can be replaced with guard clauses' - StyleGuide: '#no-nested-conditionals' - Enabled: false - -Metrics/AbcSize: - Description: >- - A calculated magnitude based on number of assignments, - branches, and conditions. - Reference: 'http://c2.com/cgi/wiki?AbcMetric' - Enabled: true - Max: 17.5 - -Metrics/MethodLength: - Description: 'Avoid methods longer than 10 lines of code.' - StyleGuide: '#short-methods' - Enabled: true - Max: 15 - -Metrics/LineLength: - Description: 'Limit lines to 80 characters.' - StyleGuide: '#80-character-limits' - Enabled: true - Max: 110 - -Style/SymbolArray: - EnforcedStyle: brackets - -Style/FrozenStringLiteralComment: - EnforcedStyle: never - -Style/AndOr: - EnforcedStyle: conditionals diff --git a/Gemfile b/Gemfile index ef462ba36..b07de0017 100644 --- a/Gemfile +++ b/Gemfile @@ -87,6 +87,7 @@ group :development do gem "bullet" gem "foreman" gem "onesky-rails" + gem "overcommit", "~> 0.58.0" gem "standard", "~> 1.3" gem "web-console" end