Enhancement: fall back to `.php-version` and `.tool-versions` for the PHP runtime

オープン 初心者向け
#710 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php, typescript
領域
cli

調査の方向性

src/core-open/scanners/php-scanner.ts の parseComposerJson と test/php-config-platform-runtime.test.ts のテストから始めます。Composer のランタイム値がどのように選択されるかを追い、issue に記載された pin ファイルの優先順位、トークンの解析、コメント、空行、読み取り不能なファイルのテストカバレッジを追加します。受け入れケースが通り、pin ファイルがない場合や読み取れない場合もスキャンが失敗しなければ完了です。

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

説明

enhancement good first issue
  • Difficulty: small
  • Area: PHP scanner
Problem

parseComposerJson in src/core-open/scanners/php-scanner.ts (around lines 102–107) takes the PHP runtime only from require.php, then config.platform.php (#647). A project that pins the interpreter with phpenv or asdf, and does not declare those Composer keys, reports no runtime:

# .php-version
8.3.12

# .tool-versions
php 8.3.12
Expected behaviour

When require.php and config.platform.php are both absent, read .php-version in the same directory as composer.json, then .tool-versions. Use the first version token (8.3, 8.3.12; drop a leading v). Skip system and other non-version tokens. require.php still wins over config.platform.php, which still wins over the pin files. .php-version wins over .tool-versions. A missing or unreadable pin file never fails the scan.

Acceptance
  • Add tests next to test/php-config-platform-runtime.test.ts.
  • Cases: only .php-version; only .tool-versions (php 8.3.12); both (.php-version wins); require.php present (Composer wins); config.platform.php present and no require.php (platform wins); a system entry yields no runtime; comments and blank lines are ignored.

主要言語
TypeScript
スター
4
フォーク
3
平均マージ
1日 22時間
マージ済み PR(30日)
76

環境構築

はじめの一歩

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

vibgrate/cli のほかの issue

vibgrate/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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