rubocop'ing
This commit is contained in:
parent
f691875012
commit
549e7ef905
8 changed files with 24 additions and 12 deletions
22
.rubocop.yml
22
.rubocop.yml
|
@ -1,28 +1,34 @@
|
||||||
##
|
##
|
||||||
# Defaults
|
# Defaults
|
||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 3.1
|
TargetRubyVersion: 3.2
|
||||||
|
Include:
|
||||||
##
|
- Rakefile.rb
|
||||||
# Plugins
|
- rules/*.rules
|
||||||
require:
|
- rules/**/**/*.rules
|
||||||
- standard
|
- lib/*.rb
|
||||||
|
- lib/**/*.rb
|
||||||
|
- lib/**/**.rb
|
||||||
|
|
||||||
##
|
##
|
||||||
# Defaults: standard-rb
|
# Defaults: standard-rb
|
||||||
|
require:
|
||||||
|
- standard
|
||||||
inherit_gem:
|
inherit_gem:
|
||||||
standard: config/base.yml
|
standard: config/base.yml
|
||||||
|
|
||||||
##
|
##
|
||||||
# Extra cops
|
# Extra
|
||||||
Style/FrozenStringLiteralComment:
|
Style/FrozenStringLiteralComment:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Disabled cops (lib-specific)
|
# Disabled
|
||||||
Layout/MultilineMethodCallIndentation:
|
Layout/MultilineMethodCallIndentation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Layout/ArgumentAlignment:
|
Layout/ArgumentAlignment:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Layout/ArrayAlignment:
|
||||||
|
Enabled: false
|
||||||
Style/TrivialAccessors:
|
Style/TrivialAccessors:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
|
@ -66,7 +66,7 @@ end
|
||||||
|
|
||||||
namespace :env do
|
namespace :env do
|
||||||
desc "Verify the production branch is being used"
|
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
|
git_branch = `git branch --show-current`.chomp
|
||||||
if git_branch != "production"
|
if git_branch != "production"
|
||||||
warn "This task can only be run on the 'production' branch."
|
warn "This task can only be run on the 'production' branch."
|
||||||
|
@ -75,13 +75,13 @@ namespace :env do
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Set environment variables for the production environment"
|
desc "Set environment variables for the production environment"
|
||||||
task :'set-production-vars' do
|
task :"set-production-vars" do
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
Dotenv.load
|
Dotenv.load
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Set environment variables for the development environment"
|
desc "Set environment variables for the development environment"
|
||||||
task :'set-development-vars' do
|
task :"set-development-vars" do
|
||||||
ENV["NODE_ENV"] ||= "development"
|
ENV["NODE_ENV"] ||= "development"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Contains rules that are related to assets (eg images, fonts, etc)
|
# Contains rules that are related to assets (eg images, fonts, etc)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Rules for a redirect from a surah id to a surah name
|
# Rules for a redirect from a surah id to a surah name
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Rules for the surah index available at /<locale>/ (eg /en/) and its
|
# Rules for the surah index available at /<locale>/ (eg /en/) and its
|
||||||
|
@ -7,7 +8,7 @@
|
||||||
locales.each do |locale|
|
locales.each do |locale|
|
||||||
compile "/html/pages/surah/index.html.erb", rep: "/#{locale}/surah/index" do
|
compile "/html/pages/surah/index.html.erb", rep: "/#{locale}/surah/index" do
|
||||||
filter :erb, locals: {locale:}
|
filter :erb, locals: {locale:}
|
||||||
write "/#{locale}/index.html"
|
write "/#{locale}/index.html"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Rules for a redirect from /<locale>/random/ to a random surah
|
# Rules for a redirect from /<locale>/random/ to a random surah
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Rules for a redirect from the root path to the surah index for a given locale
|
# Rules for a redirect from the root path to the surah index for a given locale
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
##
|
##
|
||||||
# Rules for the surah stream available at /<locale>/<name>/ (eg /ar/al-fatihah/)
|
# Rules for the surah stream available at /<locale>/<name>/ (eg /ar/al-fatihah/)
|
||||||
|
|
Loading…
Reference in a new issue