diff --git a/Rakefile.rb b/Rakefile.rb index cec8352..cc4db50 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -7,7 +7,7 @@ require "yaml" ## # Rake tasks load "rake/tasks/deploy.rake" -load "rake/tasks/linter.rake" +load "rake/tasks/format.rake" load "rake/tasks/nanoc.rake" load "rake/tasks/submodules.rake" @@ -16,11 +16,11 @@ task :server, [:protocol] do |_t, args| require "server" nanoc = Ryo.from(YAML.load_file("./nanoc.yaml")) h = args.to_h - o = if h[:protocol] == 'unix' - {unix: nanoc.server.unix.path} - else - {host: nanoc.server.tcp.host, port: nanoc.server.tcp.port} - end + o = if h[:protocol] == "unix" + {unix: nanoc.server.unix.path} + else + {host: nanoc.server.tcp.host, port: nanoc.server.tcp.port} + end s = Server.dir(nanoc.output_dir, o) s.start(block: true) rescue Interrupt diff --git a/Rules b/Rules index ec87c4a..37ec56b 100644 --- a/Rules +++ b/Rules @@ -43,7 +43,7 @@ end # /sitemap.xml compile "/sitemap.xml.erb" do filter(:erb, locals: {locales:, name_by_id:}) - filter Proc.new { _1.each_line.reject { |s| s.strip.empty? }.join } + filter proc { _1.each_line.reject { |s| s.strip.empty? }.join } write("/sitemap.xml") end diff --git a/nanoc/lib/mixin.rb b/nanoc/lib/mixin.rb index 2551a8a..1647438 100644 --- a/nanoc/lib/mixin.rb +++ b/nanoc/lib/mixin.rb @@ -9,7 +9,7 @@ module Mixin def app_version @app_version ||= begin ver = File.read File.join(Dir.getwd, "VERSION") - ver.gsub(/[^\d.]/, '') + ver.gsub(/[^\d.]/, "") end end diff --git a/nanoc/lib/nanoc/ruledsl/filter.rb b/nanoc/lib/nanoc/ruledsl/filter.rb index 8e0e124..5cb9c93 100644 --- a/nanoc/lib/nanoc/ruledsl/filter.rb +++ b/nanoc/lib/nanoc/ruledsl/filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Nanoc::RuleDSL module Filter ## @@ -28,9 +30,9 @@ module Nanoc::RuleDSL private def random_id - name = item.identifier.to_s.gsub(%r|[./\\]|, "_")[/[A-Za-z0-9_]+/] + name = item.identifier.to_s.gsub(%r{[./\\]}, "_")[/[A-Za-z0-9_]+/] random = SecureRandom.alphanumeric - "__nanoc_#{name}_#{random}".to_sym + :"__nanoc_#{name}_#{random}" end end end diff --git a/nanoc/lib/nanoc/ruledsl/require_rules.rb b/nanoc/lib/nanoc/ruledsl/require_rules.rb index f82965a..5880ceb 100644 --- a/nanoc/lib/nanoc/ruledsl/require_rules.rb +++ b/nanoc/lib/nanoc/ruledsl/require_rules.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Nanoc::RuleDSL module RequireRules ## diff --git a/rake/tasks/linter.rake b/rake/tasks/format.rake similarity index 73% rename from rake/tasks/linter.rake rename to rake/tasks/format.rake index cbbf1fb..7887f95 100644 --- a/rake/tasks/linter.rake +++ b/rake/tasks/format.rake @@ -1,6 +1,6 @@ # frozen_string_literal: true -namespace :linter do +namespace :format do desc "Run rubocop (Ruby)" task :rubocop do sh "bundle exec rubocop -A" @@ -17,5 +17,5 @@ namespace :linter do end end -desc "Run all linters" -task linter: ["linter:rubocop", "linter:eslint", "linter:prettier"] +desc "Run all formats" +task format: ["format:rubocop", "format:eslint", "format:prettier"] diff --git a/src/js/components/Timer.tsx b/src/js/components/Timer.tsx index 32f6e9e..ab360d6 100644 --- a/src/js/components/Timer.tsx +++ b/src/js/components/Timer.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from "react"; -import type { Surah, Ayah, TLocale, TAyat } from "Quran"; +import type { Surah, Ayah, TLocale } from "Quran"; import { formatNumber } from "~/lib/t"; type Maybe = T | null | undefined;