From 0baa7901b248db6d587ebf5815dc07bdc4be0964 Mon Sep 17 00:00:00 2001 From: Malaber Date: Sun, 15 Aug 2021 14:28:03 +0200 Subject: [PATCH] Readd current version of rubocop --- .rubocop.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ Gemfile | 3 +++ Gemfile.lock | 10 ++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..472e0f0 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,49 @@ +require: + - rubocop-performance + - rubocop-rails + +# Stolen from https://gist.github.com/jhass/a5ae80d87f18e53e7b56 +AllCops: + Exclude: + - "bin/**/*" + - "db/schema.rb" + +# Enable Rails +Rails: + Enabled: true + +# Commonly used screens these days easily fit more than 80 characters. +Metrics/LineLength: + Max: 120 + +# Too short methods lead to extraction of single-use methods, which can make +# the code easier to read (by naming things), but can also clutter the class +Metrics/MethodLength: + Exclude: + - "db/migrate/*" + Max: 50 + +# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC +Metrics/ClassLength: + Max: 1500 +Metrics/ModuleLength: + Max: 1500 + +# Raise AbcSize from 15 to 20 +Metrics/AbcSize: + Exclude: + - "db/migrate/*" + Max: 50 + +Metrics/BlockLength: + ExcludedMethods: + - "namespace" + - "create_table" + Exclude: + - "config/**/*.rb" + - "spec/**/*.rb" + +# Disable documentation checks for now +# should be done with yard instead +Style/Documentation: + Enabled: false diff --git a/Gemfile b/Gemfile index 2a00f85..2afaccd 100644 --- a/Gemfile +++ b/Gemfile @@ -56,6 +56,9 @@ group :development do gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'railroady' + gem 'rubocop' + gem 'rubocop-performance' + gem 'rubocop-rails' gem 'solargraph' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 7793cbf..073e79c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -231,6 +231,13 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.10.0) parser (>= 3.0.1.1) + rubocop-performance (1.11.4) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rails (2.11.3) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.7.0, < 2.0) ruby-progressbar (1.11.0) ruby_dep (1.5.0) shoulda-matchers (5.0.0) @@ -311,6 +318,9 @@ DEPENDENCIES railroady rails (~> 6.0.3) rspec-rails + rubocop + rubocop-performance + rubocop-rails shoulda-matchers solargraph spring