rubocop'ing

This commit is contained in:
0x1eef 2023-03-11 14:31:44 -03:00
parent f691875012
commit 549e7ef905
8 changed files with 24 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Contains rules that are related to assets (eg images, fonts, etc)

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Rules for a redirect from a surah id to a surah name

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Rules for the surah index available at /<locale>/ (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

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Rules for a redirect from /<locale>/random/ to a random surah

View file

@ -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

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Rules for the surah stream available at /<locale>/<name>/ (eg /ar/al-fatihah/)