From 7ce507710018d3368b13f3c29820bfb061cdca24 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 3 Oct 2017 17:27:24 +0100 Subject: [PATCH] Add Rubocop and sensible default rules. --- .rubocop.yml | 27 +++++++++++++++++++++++++++ Gemfile | 1 + Gemfile.lock | 17 +++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000000..78bc878098f --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,27 @@ +AllCops: + TargetRubyVersion: 2.4 + Exclude: + - '**/bin/**/*' + - '**/db/**/*' + - '**/script/setup' + - '**/vendor/**/*' + +Lint/AssignmentInCondition: + Enabled: false + +Metrics/BlockLength: + Enabled: false + +Metrics/LineLength: + Max: 100 + IgnoredPatterns: ['\A\s*#'] + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/TrailingCommaInLiteral: + EnforcedStyleForMultiline: consistent_comma + diff --git a/Gemfile b/Gemfile index 1c1c0e181f1..e6a3f1f7973 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" group :test do gem "minitest", "~> 5.10.3" gem "rake" + gem "rubocop", "~> 0.50.0" gem "safe_yaml", "~> 1.0.4" end diff --git a/Gemfile.lock b/Gemfile.lock index 052618af625..0b30e41424f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,25 @@ GEM remote: https://rubygems.org/ specs: + ast (2.3.0) minitest (5.10.3) + parallel (1.12.0) + parser (2.4.0.0) + ast (~> 2.2) + powerpack (0.1.1) + rainbow (2.2.2) + rake rake (12.0.0) + rubocop (0.50.0) + parallel (~> 1.10) + parser (>= 2.3.3.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.9.0) safe_yaml (1.0.4) + unicode-display_width (1.3.0) PLATFORMS ruby @@ -11,6 +27,7 @@ PLATFORMS DEPENDENCIES minitest (~> 5.10.3) rake + rubocop (~> 0.50.0) safe_yaml (~> 1.0.4) BUNDLED WITH