From 549e7ef9051096d6ebf2031a965b838327c7413a Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 11 Mar 2023 14:31:44 -0300 Subject: [PATCH] rubocop'ing --- .rubocop.yml | 22 ++++++++++++++-------- Rakefile.rb | 6 +++--- rules/assets.rules | 1 + rules/pages/surah/id_redirect.rules | 1 + rules/pages/surah/index.rules | 3 ++- rules/pages/surah/random.rules | 1 + rules/pages/surah/redirect.rules | 1 + rules/pages/surah/stream.rules | 1 + 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6ae31fa..2f487ff 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,28 +1,34 @@ ## # Defaults AllCops: - TargetRubyVersion: 3.1 - -## -# Plugins -require: - - standard + TargetRubyVersion: 3.2 + Include: + - Rakefile.rb + - rules/*.rules + - rules/**/**/*.rules + - lib/*.rb + - lib/**/*.rb + - lib/**/**.rb ## # Defaults: standard-rb +require: + - standard inherit_gem: standard: config/base.yml ## -# Extra cops +# Extra Style/FrozenStringLiteralComment: Enabled: true ## -# Disabled cops (lib-specific) +# Disabled Layout/MultilineMethodCallIndentation: Enabled: false Layout/ArgumentAlignment: Enabled: false +Layout/ArrayAlignment: + Enabled: false Style/TrivialAccessors: Enabled: false diff --git a/Rakefile.rb b/Rakefile.rb index 01bbc57..036c745 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -66,7 +66,7 @@ end namespace :env do desc "Verify the production branch is being used" - task :'verify-production-branch' do + task :"verify-production-branch" do git_branch = `git branch --show-current`.chomp if git_branch != "production" warn "This task can only be run on the 'production' branch." @@ -75,13 +75,13 @@ namespace :env do end desc "Set environment variables for the production environment" - task :'set-production-vars' do + task :"set-production-vars" do require "dotenv" Dotenv.load end desc "Set environment variables for the development environment" - task :'set-development-vars' do + task :"set-development-vars" do ENV["NODE_ENV"] ||= "development" end end diff --git a/rules/assets.rules b/rules/assets.rules index 286a557..4041eb4 100644 --- a/rules/assets.rules +++ b/rules/assets.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Contains rules that are related to assets (eg images, fonts, etc) diff --git a/rules/pages/surah/id_redirect.rules b/rules/pages/surah/id_redirect.rules index e828271..d78bbb4 100644 --- a/rules/pages/surah/id_redirect.rules +++ b/rules/pages/surah/id_redirect.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Rules for a redirect from a surah id to a surah name diff --git a/rules/pages/surah/index.rules b/rules/pages/surah/index.rules index b92486d..e2d0915 100644 --- a/rules/pages/surah/index.rules +++ b/rules/pages/surah/index.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Rules for the surah index available at // (eg /en/) and its @@ -7,7 +8,7 @@ locales.each do |locale| compile "/html/pages/surah/index.html.erb", rep: "/#{locale}/surah/index" do filter :erb, locals: {locale:} - write "/#{locale}/index.html" + write "/#{locale}/index.html" end end diff --git a/rules/pages/surah/random.rules b/rules/pages/surah/random.rules index 5bd7262..fbe0faf 100644 --- a/rules/pages/surah/random.rules +++ b/rules/pages/surah/random.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Rules for a redirect from //random/ to a random surah diff --git a/rules/pages/surah/redirect.rules b/rules/pages/surah/redirect.rules index b165b56..0e59c3d 100644 --- a/rules/pages/surah/redirect.rules +++ b/rules/pages/surah/redirect.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Rules for a redirect from the root path to the surah index for a given locale diff --git a/rules/pages/surah/stream.rules b/rules/pages/surah/stream.rules index 19127f4..f9fb27b 100644 --- a/rules/pages/surah/stream.rules +++ b/rules/pages/surah/stream.rules @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ## # Rules for the surah stream available at /// (eg /ar/al-fatihah/)