From 7dc52d8c9178ce23da92ff635e219b7568541344 Mon Sep 17 00:00:00 2001 From: Fab Date: Sat, 3 Dec 2022 21:17:29 +0100 Subject: [PATCH 1/4] feat(Gem): add rubocop gems (+ rubocop-performance, + rubocop-minitest). --- Gemfile | 4 ++++ Gemfile.lock | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) 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 From c4845f3a73299453d5e7f4602132aa391cfafe9e Mon Sep 17 00:00:00 2001 From: Fab Date: Sat, 3 Dec 2022 21:18:11 +0100 Subject: [PATCH 2/4] feat(Rubocop): add minimal config --- .rubocop.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..5061880 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,16 @@ +# This template is inspired on https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml + +require: + - rubocop-performance + - rubocop-minitest + +AllCops: + TargetRubyVersion: 3.1 + # 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/**/*' From 77c716708acfb91f00be5543d0bbbd0d269c8498 Mon Sep 17 00:00:00 2001 From: Fab Date: Sat, 3 Dec 2022 21:29:25 +0100 Subject: [PATCH 3/4] feat(Rubocop): remove ruby targeted version value. --- .rubocop.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5061880..9562d7e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,11 +1,9 @@ -# This template is inspired on https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml - require: - rubocop-performance - rubocop-minitest AllCops: - TargetRubyVersion: 3.1 + 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 From 047e844bb9ae32a6f9812f277fdcd4944764d7a2 Mon Sep 17 00:00:00 2001 From: Fab Date: Sat, 3 Dec 2022 22:04:12 +0100 Subject: [PATCH 4/4] feat(Rubocop): add information into readme.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) 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 .`