diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..e432d92 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,73 @@ +AllCops: + TargetRubyVersion: 2.5 + Include: + - '**/Rakefile' + - '**/config.ru' + Exclude: + - 'lib/tasks/auto_annotate_models.rake' + - 'db/**/*' + - 'config/**/*' + - 'script/**/*' + - 'bin/**/*' + - !ruby/regexp /old_and_unused\.rb$/ + - 'app/admin/*' + - 'tmp/*' + - Gemfile + +Documentation: + Enabled: false + +FrozenStringLiteralComment: + Enabled: false + +ClassAndModuleChildren: + Enabled: false + +Metrics/BlockLength: + Enabled: true + Exclude: + - lib/tasks/**/* + + +AsciiComments: + Enabled: false + +AlignParameters: + Enabled: false + +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + +Metrics/LineLength: + Max: 100 + +Style/BlockDelimiters: + EnforcedStyle: semantic + +Style/Lambda: + Enabled: false + +Style/SignalException: + EnforcedStyle: semantic + +Style/NumericLiteralPrefix: + Enabled: false + +Style/NumericLiterals: + Enabled: false + +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/SymbolArray: + Enabled: false + +Style/TrailingCommaInArguments: + EnforcedStyleForMultiline: comma + +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma + +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma diff --git a/Gemfile b/Gemfile index 42089ad..1c05223 100644 --- a/Gemfile +++ b/Gemfile @@ -45,6 +45,7 @@ group :development do gem 'spring-watcher-listen', '~> 2.0.0' gem 'capistrano-rails' + gem 'rubocop', '~> 0.56' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 0fe7aa7..47e8479 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,6 +49,7 @@ GEM archive-zip (0.11.0) io-like (~> 0.3.0) arel (9.0.0) + ast (2.4.0) bcrypt (3.1.12) bindex (0.5.0) bootsnap (1.3.0) @@ -116,6 +117,10 @@ GEM nio4r (2.3.1) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) + parallel (1.12.1) + parser (2.5.1.0) + ast (~> 2.4.0) + powerpack (0.1.1) public_suffix (3.0.2) puma (3.11.4) rack (2.0.5) @@ -145,10 +150,19 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) + rainbow (3.0.0) rake (12.3.1) rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) + rubocop (0.56.0) + parallel (~> 1.10) + parser (>= 2.5) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.9.0) ruby_dep (1.5.0) rubyzip (1.2.1) sass (3.5.6) @@ -190,6 +204,7 @@ GEM thread_safe (~> 0.1) uglifier (4.1.10) execjs (>= 0.3.0, < 3) + unicode-display_width (1.3.2) web-console (3.6.2) actionview (>= 5.0) activemodel (>= 5.0) @@ -216,6 +231,7 @@ DEPENDENCIES mysql2 (>= 0.4.4, < 0.6.0) puma (~> 3.11) rails (~> 5.2.0) + rubocop (~> 0.56) sass-rails (~> 5.0) selenium-webdriver spring diff --git a/Rakefile b/Rakefile index e85f913..9a5ea73 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,6 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require_relative 'config/application' +require_relative "config/application" Rails.application.load_tasks diff --git a/config.ru b/config.ru index f7ba0b5..441e6ff 100644 --- a/config.ru +++ b/config.ru @@ -1,5 +1,5 @@ # This file is used by Rack-based servers to start the application. -require_relative 'config/environment' +require_relative "config/environment" run Rails.application