From dd96f713855a3dfbb917e90fe9e1f8eb8fd40319 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Sun, 25 May 2025 15:34:03 +0300 Subject: [PATCH] feat: Added the reek analyser to harden the checks --- .bundle/config | 4 +--- .reek.yml | 3 +++ Dockerfile | 2 +- Gemfile | 1 + Gemfile.lock | 38 +++++++++++++++++++++++++++++++++++++- Rakefile | 3 +++ 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 .reek.yml diff --git a/.bundle/config b/.bundle/config index 363c858e..70275940 100644 --- a/.bundle/config +++ b/.bundle/config @@ -1,5 +1,3 @@ ---- -BUNDLE_PATH: "/home/runner/work/client-ruby/client-ruby/vendor/bundle" +BUNDLE_PATH: "./vendor" BUNDLE_IGNORE_FUNDING_REQUESTS: "true" BUNDLE_JOBS: "4" -BUNDLE_DEPLOYMENT: "true" diff --git a/.reek.yml b/.reek.yml new file mode 100644 index 00000000..d8e1c828 --- /dev/null +++ b/.reek.yml @@ -0,0 +1,3 @@ +exclude_paths: + - lib/zitadel/client/models/**/*.rb + - lib/zitadel/client/api/**/*.rb diff --git a/Dockerfile b/Dockerfile index 2dea200b..72767c54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,4 @@ RUN rm -f *.gem RUN gem build *.gemspec RUN gem install *.gem RUN ruby -e "require 'zitadel_client'" -CMD ["irb"] +CMD ["irb", "-r", "zitadel_client"] diff --git a/Gemfile b/Gemfile index f4baf9a9..53d2b07e 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem 'zeitwerk' group :development do gem 'rbs' + gem 'reek', require: false gem 'rubocop', require: false gem 'rubocop-minitest', require: false gem 'rubocop-rake', require: false diff --git a/Gemfile.lock b/Gemfile.lock index d4d2a2b4..53675158 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,34 @@ GEM multi_json dotenv (3.1.8) drb (2.2.1) + dry-configurable (1.2.0) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) + dry-core (1.0.2) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + dry-inflector (1.1.0) + dry-initializer (3.1.1) + dry-logic (1.5.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) + dry-schema (1.13.4) + concurrent-ruby (~> 1.0) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-logic (>= 1.4, < 2) + dry-types (>= 1.7, < 2) + zeitwerk (~> 2.6) + dry-types (1.7.2) + bigdecimal (~> 3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) ethon (0.16.0) ffi (>= 1.15.0) excon (1.2.5) @@ -48,7 +76,8 @@ GEM logger faraday-net_http (3.4.0) net-http (>= 0.5.0) - ffi (1.17.1) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86_64-linux-gnu) fileutils (1.7.3) hashie (5.0.0) i18n (1.14.7) @@ -96,6 +125,12 @@ GEM ffi (~> 1.0) rbs (3.6.1) logger + reek (6.4.0) + dry-schema (~> 1.13.0) + logger (~> 1.6) + parser (~> 3.3.0) + rainbow (>= 2.0, < 4.0) + rexml (~> 3.1) regexp_parser (2.10.0) rexml (3.4.1) rubocop (1.75.5) @@ -177,6 +212,7 @@ DEPENDENCIES oauth2 rake rbs + reek rubocop rubocop-minitest rubocop-rake diff --git a/Rakefile b/Rakefile index a44ac780..9cb6e553 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,7 @@ require 'rake/testtask' require 'rdoc/task' require 'steep/rake_task' require 'rubocop/rake_task' +require 'reek/rake/task' RuboCop::RakeTask.new(:rubocop) do |task| task.plugins << 'rubocop-minitest' @@ -31,4 +32,6 @@ Rake::TestTask.new(:test) do |task| task.verbose = true end +Reek::Rake::Task.new + task default: :test