Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git-scm.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-10-05 13:25:09 +0300
committerJeff King <peff@peff.net>2022-10-05 16:27:57 +0300
commit3f05244c4c27dbe4b7043e276f6c95b91e1744b8 (patch)
tree10a4f49511470cb131cfd0a1a82d3e795c82187a
parent7a9afb13ef7403efb79c1f986d59835d95c203b7 (diff)
run rubocop --autocorrect --only Lint/UnusedBlockArgument
Most of these could just be removed, but maybe it's useful to indicate what we expect the block to be seeing.
-rw-r--r--lib/tasks/book2.rake6
-rw-r--r--lib/tasks/index.rake6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/tasks/book2.rake b/lib/tasks/book2.rake
index 046f35f3..85838f54 100644
--- a/lib/tasks/book2.rake
+++ b/lib/tasks/book2.rake
@@ -5,7 +5,7 @@ require "octokit"
require "pathname"
def expand(content, path, &get_content)
- content.gsub(/include::(\S+)\[\]/) do |line|
+ content.gsub(/include::(\S+)\[\]/) do |_line|
if File.dirname(path) == "."
new_fname = $1
else
@@ -45,7 +45,7 @@ def genbook(code, &get_content)
chapter_files = /(book\/[01A-C].*\/1-[^\/]*?\.asc|(?:ch[0-9]{2}|[ABC])-[^\/]*?\.asc)/
chaps = progit.scan(chapter_files).flatten
- chaps.each_with_index do |filename, index|
+ chaps.each_with_index do |filename, _index|
# select the chapter files
if /(book\/[01].*\/1-[^\/]*\.asc|ch[0-9]{2}-.*\.asc)/.match?(filename)
chnumber += 1
@@ -191,7 +191,7 @@ task remote_genbook2: :environment do
@octokit = Octokit::Client.new(access_token: ENV["GITHUB_API_TOKEN"])
if ENV["GENLANG"]
- books = Book.all_books.select { |code, repo| code == ENV["GENLANG"] }
+ books = Book.all_books.select { |code, _repo| code == ENV["GENLANG"] }
else
books = Book.all_books.select do |code, repo|
repo_head = @octokit.commit(repo, "HEAD").sha
diff --git a/lib/tasks/index.rake b/lib/tasks/index.rake
index 4f4c9e59..ae99fce7 100644
--- a/lib/tasks/index.rake
+++ b/lib/tasks/index.rake
@@ -99,7 +99,7 @@ def index_l10n_doc(filter_tags, doc_list, get_content)
line = "<a href='/docs/#{x[1]}/#{lang}'>#{x[1]}[#{x[2]}]</a>"
end
# HTML anchor on hdlist1 (i.e. command options)
- html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |m|
+ html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m|
text = $1.tr("^A-Za-z0-9-", "")
anchor = "#{path}-#{text}"
# handle anchor collisions by appending -1
@@ -234,7 +234,7 @@ def index_doc(filter_tags, doc_list, get_content)
end
def expand_content(content, path, get_f_content, generated)
- content.gsub(/include::(\S+)\.txt\[\]/) do |line|
+ content.gsub(/include::(\S+)\.txt\[\]/) do |_line|
if File.dirname(path) == "."
new_fname = "#{$1}.txt"
else
@@ -275,7 +275,7 @@ def index_doc(filter_tags, doc_list, get_content)
line = "<a href='/docs/#{x[1]}'>#{x[1]}[#{x[2]}]</a>"
end
# HTML anchor on hdlist1 (i.e. command options)
- html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |m|
+ html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m|
text = $1.tr("^A-Za-z0-9-", "")
anchor = "#{path}-#{text}"
# handle anchor collisions by appending -1