Check the PHP version from composer.json require.php

Aperta Adatta ai principianti
#66 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
json, php, python
Ambito
devtools

Direzione di ricerca

Inizia dalla lista RUNTIMES in src/devready/checks/runtimes.py e dal pattern degli extractor presente lì, poi leggi SAFE_SPEC in versions.py e le voci di explain.py. Aggiungi una riga di runtime per php e un extractor per composer.json che legga solo require.php tramite json.loads, restituendolo solo se corrisponde a SAFE_SPEC. È completato quando un composer.json con ^8.1 e PHP 7.4 installato produce un unico fail che mostra entrambe le versioni, un repository senza composer.json non produce alcun risultato PHP, e pytest, ruff check e ruff format --check passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement good first issue help wanted

Problem: A PHP project declares its PHP version in composer.json ("require": {"php": "^8.1"}). DevReady does not check PHP, so a too-old or missing php only shows up when composer install fails.

Do:

  • Add a php row to RUNTIMES in src/devready/checks/runtimes.py (exe php, args --version, .tool-versions name php). Runtimes are only checked when the project declares them, so nothing changes for other repos.
  • Add an extractor for composer.json: json.loads, read require.php only, return it only if it matches SAFE_SPEC in versions.py (^, ~, || are already supported).
  • Id: project.php.composer, miss = fail (Composer refuses to install on a platform mismatch).
  • Add the explain.py entry, a docs/checks.md row, a CHANGELOG line, the README check list mention and unit tests (match, too old, missing php, no require.php, invalid JSON, hostile spec).

Done when:

  • composer.json with "php": "^8.1" and PHP 7.4 installed gives one fail showing both versions.
  • A repo without composer.json gets no PHP result.

Done when: see the list above, plus pytest, ruff check and ruff format --check pass.

Notes:

  • Read-only: never execute project files, never echo file contents; only a validated version or spec reaches the report.
  • No network, no new runtime dependencies (Python >= 3.10 stdlib only).
  • Comment below to claim it and I will assign you.
Lingua principale
Python
Stelle
2
Fork
3
Merge medio
10h 51m
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Evalogical-Inc/devReady

Tutte le issue di Evalogical-Inc/devReady

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.