From a869f18db8a634b07ac19a42cbda492252af4d21 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sun, 2 Jun 2019 18:16:23 +0000 Subject: [PATCH 1/3] Add Rubocop and enable the following cops: - Layout/TrailingWhitespace - Style/FrozenStringLiteralComment --- .rubocop.yml | 31 +++++++++++++++++++++++++++++++ Gemfile | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..336ee50 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,31 @@ +AllCops: + TargetRubyVersion: 2.3 + TargetRailsVersion: 5.2 + # 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 + Exclude: + - '**/vendor/**/*' + - '**/tmp/**/*' + - '**/bin/**/*' + - '**/plugins/**/*' + - '**/extra/**/*' + - '**/lib/generators/**/templates/*' + - '**/lib/tasks/**/*' + - '**/files/**/*' + +Rails: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always + Exclude: + - 'db/**/*.rb' + - 'Gemfile' + - 'Rakefile' + - 'config.ru' diff --git a/Gemfile b/Gemfile index 8bfa48b..fd7e9c6 100644 --- a/Gemfile +++ b/Gemfile @@ -84,6 +84,8 @@ group :test do gem 'puma', '~> 3.7' gem "capybara", '~> 2.13' gem "selenium-webdriver" + # Rubocop + gem 'rubocop', '~> 0.71.0' end local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") -- 2.1.4