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

How to handle tool-specific magic comments

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
ruby
領域
documentation

調査の方向性

この issue では実装ファイルもテストも指定されていません。RDoc で例を再現し、shebang と Ruby のマジックコメントの処理を追跡してから、# typed: true や # rbs_inline: enabled のようなツール固有のコメントと比較してください。これらのコメントがトップレベルのドキュメントとして表示されなくなり、RDoc の既存のマジックコメントの動作を壊していなければ完了です。

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

説明

rdoc currently removes shebangs and ruby magic comments from rendered documetantion.

But other tools like sorbet and rbs-inline provide their own comments like # typed: true or rbs_inline: enabled which aren't excluded. If I have a file like this:

# frozen_string_literal: true
# rbs_inline: enabled
# :markup: markdown

module Prism
  module Foo
    # ...
  end
end

Then for each file, you get one rbs_inline comment on the top-level namespace. I feel like either rdoc should

  • ignore any magic-style comment, regardless of if it is "official" or not
  • Not attach comments where there is whitespace before the top-level. I guess this is not feasable for backwards compat since rdoc itself makes heavy use of that style.

This can be worked around by inserting #-- before the magic comments but I don't think I should need to care about this at all.

主要言語
Ruby
スター
927
フォーク
467
平均マージ
23時間 47分
マージ済み PR(30日)
12

環境構築

はじめの一歩

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

ruby/rdoc のほかの issue

ruby/rdoc の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

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

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