From 48140f74e9244d15ccdf3300d2500634e87c1011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 26 Oct 2018 11:34:08 +0200 Subject: [PATCH 1/3] Remove rubocop_todo file No developers are maintaining it anymore. --- .rubocop.yml | 1 - .rubocop_todo.yml | 71 ----------------------------------------------- 2 files changed, 72 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 93a1a6ce9..b076ce64b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,3 @@ -inherit_from: .rubocop_todo.yml require: rubocop-rspec AllCops: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index f3a40d8ab..000000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2018-02-10 21:25:09 +0100 using RuboCop version 0.52.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 10 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: normal, rails -Layout/IndentationConsistency: - Exclude: - - 'spec/features/tracks_spec.rb' - - 'spec/models/budget/investment_spec.rb' - - 'spec/models/legislation/draft_version_spec.rb' - - 'spec/models/proposal_spec.rb' - -# Offense count: 1225 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 248 - -# Offense count: 4 -# Cop supports --auto-correct. -Performance/RedundantMatch: - Exclude: - - 'app/controllers/valuation/budget_investments_controller.rb' - - 'app/controllers/valuation/spending_proposals_controller.rb' - -# Offense count: 11 -RSpec/DescribeClass: - Exclude: - - 'spec/customization_engine_spec.rb' - - 'spec/i18n_spec.rb' - - 'spec/lib/acts_as_paranoid_aliases_spec.rb' - - 'spec/lib/cache_spec.rb' - - 'spec/lib/graphql_spec.rb' - - 'spec/lib/tasks/communities_spec.rb' - - 'spec/lib/tasks/dev_seed_spec.rb' - - 'spec/lib/tasks/map_location_spec.rb' - - 'spec/lib/tasks/settings_spec.rb' - - 'spec/models/abilities/organization_spec.rb' - - 'spec/views/welcome/index.html.erb_spec.rb' - -# Offense count: 2 -# Configuration parameters: SkipBlocks, EnforcedStyle. -# SupportedStyles: described_class, explicit -RSpec/DescribedClass: - Exclude: - - 'spec/controllers/concerns/has_filters_spec.rb' - - 'spec/controllers/concerns/has_orders_spec.rb' - -# Offense count: 6 -RSpec/ExpectActual: - Exclude: - - 'spec/routing/**/*' - - 'spec/features/admin/budget_investments_spec.rb' - -# Offense count: 830 -# Configuration parameters: AssignmentOnly. -RSpec/InstanceVariable: - Enabled: false - -# Offense count: 1 -# Configuration parameters: IgnoreSymbolicNames. -RSpec/VerifiedDoubles: - Exclude: - - 'spec/models/verification/management/email_spec.rb' From 4048d17203e1798193607139b9079a13ed61de39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 26 Oct 2018 11:37:07 +0200 Subject: [PATCH 2/3] Add basic rubocop configuraton for Hound This way we can ask contributors to follow some basic guidelines like removing trailing whitespaces while not overwhelming them with all our rules. --- .hound.yml | 2 ++ .rubocop.yml | 29 +---------------------------- .rubocop_basic.yml | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 .hound.yml create mode 100644 .rubocop_basic.yml diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 000000000..a9bd7cf34 --- /dev/null +++ b/.hound.yml @@ -0,0 +1,2 @@ +rubocop: + config_file: .rubocop_basic.yml \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index b076ce64b..02cf06874 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,35 +1,8 @@ -require: rubocop-rspec - -AllCops: - DisplayCopNames: true - DisplayStyleGuide: true - Include: - - '**/Rakefile' - - '**/config.ru' - Exclude: - - 'db/**/*' - - 'config/**/*' - - 'script/**/*' - TargetRubyVersion: 2.3 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true +inherit_from: .rubocop_basic.yml Metrics/LineLength: Max: 100 -Layout/IndentationConsistency: - EnforcedStyle: rails - -Layout/EndOfLine: - EnforcedStyle: lf - -Layout/TrailingBlankLines: - Enabled: true - -Layout/TrailingWhitespace: - Enabled: true - Bundler/DuplicatedGem: Enabled: true diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml new file mode 100644 index 000000000..3c95a8a60 --- /dev/null +++ b/.rubocop_basic.yml @@ -0,0 +1,28 @@ +require: rubocop-rspec + +AllCops: + DisplayCopNames: true + DisplayStyleGuide: true + Include: + - '**/Rakefile' + - '**/config.ru' + Exclude: + - 'db/**/*' + - 'config/**/*' + - 'script/**/*' + TargetRubyVersion: 2.3 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + +Layout/IndentationConsistency: + EnforcedStyle: rails + +Layout/EndOfLine: + EnforcedStyle: lf + +Layout/TrailingBlankLines: + Enabled: true + +Layout/TrailingWhitespace: + Enabled: true From 7794690b8c9337c215735f5116f095e94bd95cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 26 Oct 2018 12:13:06 +0200 Subject: [PATCH 3/3] Enable SCSS rules in Hound --- .hound.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.hound.yml b/.hound.yml index a9bd7cf34..26cdad927 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,2 +1,4 @@ rubocop: - config_file: .rubocop_basic.yml \ No newline at end of file + config_file: .rubocop_basic.yml +scss: + config_file: .scss-lint.yml \ No newline at end of file