diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..9562d7e --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,14 @@ +require: + - rubocop-performance + - rubocop-minitest + +AllCops: + TargetRubyVersion: ~ + # 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 + SuggestExtensions: false + +Performance: + Exclude: + - 'test/**/*' diff --git a/Gemfile b/Gemfile index b952064..c803586 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,7 @@ source 'https://rubygems.org/' gem 'minitest' gem 'rake' + +gem 'rubocop', require: false +gem 'rubocop-minitest', require: false +gem 'rubocop-performance', require: false diff --git a/Gemfile.lock b/Gemfile.lock index baac808..b7aef28 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,35 @@ GEM remote: https://rubygems.org/ specs: + ast (2.4.2) + json (2.6.2) minitest (5.14.4) + parallel (1.22.1) + parser (3.1.3.0) + ast (~> 2.4.1) + rainbow (3.1.1) rake (13.0.4) + regexp_parser (2.6.1) + rexml (3.2.5) + rubocop (1.39.0) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.23.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.24.0) + parser (>= 3.1.1.0) + rubocop-minitest (0.24.0) + rubocop (>= 0.90, < 2.0) + rubocop-performance (1.15.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.11.0) + unicode-display_width (2.3.0) PLATFORMS x86_64-darwin-20 @@ -11,6 +38,9 @@ PLATFORMS DEPENDENCIES minitest rake + rubocop + rubocop-minitest + rubocop-performance BUNDLED WITH 2.2.22 diff --git a/README.md b/README.md index d29a13a..9dbde64 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ A template for your Ruby project! * Basic project structure * Rakefile and test helper to run tests * Github Action workflow +* Rubocop basic configuration # Set up @@ -15,3 +16,7 @@ Run `bundle install` # Testing Run `rake test` + +# Linter + +Run `bundle exec rubocop .`