From ad3a93329f85cbcb02880032a5a8aa3b25aa25d6 Mon Sep 17 00:00:00 2001 From: Aleksandergreg Date: Tue, 24 Jun 2025 15:55:32 +0200 Subject: [PATCH] Implemented .rubocop.yml to ignore certain metrics we don't care about --- .github/workflows/ci.yaml | 4 ++-- sinatra/.rubocop.yml | 26 ++++++++++++++++++++++++++ sinatra/views/layout.erb | 3 +-- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 sinatra/.rubocop.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c54182d..d88f15f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -64,11 +64,11 @@ jobs: - name: Auto-correct RuboCop issues working-directory: sinatra - run: bundle exec rubocop -A || true + run: bundle exec rubocop -A - name: Run RuboCop working-directory: sinatra - run: bundle exec rubocop || true + run: bundle exec rubocop # Job 3: Lint Dockerfiles lint-docker: diff --git a/sinatra/.rubocop.yml b/sinatra/.rubocop.yml new file mode 100644 index 0000000..016c058 --- /dev/null +++ b/sinatra/.rubocop.yml @@ -0,0 +1,26 @@ +# Disable specific cops for the entire project +AllCops: + Exclude: + - 'db/schema.rb' + - 'vendor/**/*' + - 'node_modules/**/*' + +# Ignore line length warnings +Layout/LineLength: + Enabled: false + +# Ignore warnings about blocks being too long +Metrics/BlockLength: + Enabled: false + +# Ignore warnings about methods being too long +Metrics/MethodLength: + Enabled: false + +# Ignore warnings about assignment, branch, and condition size +Metrics/AbcSize: + Enabled: false + +# Ignore warnings about classes being too long +Metrics/ClassLength: + Enabled: false \ No newline at end of file diff --git a/sinatra/views/layout.erb b/sinatra/views/layout.erb index 272a1be..d65eb0e 100644 --- a/sinatra/views/layout.erb +++ b/sinatra/views/layout.erb @@ -41,8 +41,7 @@ <%# Correct path for script located in public/js/search.js %>