Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

rake -P output is ambiguous with prereq namespaces

オープン
#704 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
ruby
領域
build-system, cli

調査の方向性

rake -P/--prereqs の出力エントリポイントから開始し、issue に示されている Rakefile を再現します。tool:run と tool:run2 の namespaced prerequisite がどのように解決されるかを追跡し、その後、両方について表示される prerequisite が完全修飾され、曖昧でないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

When tasks are in a namespace, their pre-reqs "inherit" the namespace prefix.

Given the following rakefile:

task :setup do
  puts "global setup, oops"
end

namespace :tool do
  task :setup do
    puts "setting up"
  end
  task run: :setup do
    puts "running"
  end
  task run2: 'tool:setup' do
    puts "running a second way"
  end
end

The both tasks run and run2 have the same pre-req (setup). However, task run omits the namespace, while run2 is explicit with its pre-req's namespace. Both forms work as expected:

$ rake tool:run
setting up
running

$ rake tool:run2
setting up
running a second way

However, when the pre-req tree is printed, rake is not clear about what the pre-reqs' full names are.

$ rake -P
rake setup
rake tool:run
    setup  # <--- This is ambiguous!
rake tool:run2
    tool:setup
rake tool:setup

The expectation is that rake -P prints the "fully resolved" pre-reqs and is thus clear about what task will actually be run. In the example above, it is not clear what tool:run's pre-req is. Is it the "global" setup, task as it appears in the -P output? Or is it in fact tool:setup because it is namespaced?

To be clear, rake's invocation behavior matches my expectations: tool:run invokes tool:setup, not setup. But this behavior is not evident in rake's --prereqs output.

主要言語
Ruby
スター
2.5k
フォーク
650
平均マージ
6分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ruby/rake のほかの issue

ruby/rake の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。