runs and runs compare print target text without the control-character cleaning the reports use

Ouverte Adaptée aux débutants
#129 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
78/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
cli

Piste de recherche

Commence par runRunsCompare dans internal/cli/runs.go (environ lignes 308-322) et printRunRow (lignes 88-98), où Title, Location, Target et Extra sont affichés sans échappement. Lis le nettoyage existant dans internal/report/doc.go (lignes 576-583) et terminal.go pour le réutiliser, par exemple en l'exportant sous le nom report.CleanText. C'est terminé lorsque la sortie texte de runs et de runs compare ne contient aucun caractère de contrôle C0/C1 provenant du contenu du ledger. Cela se vérifie par un test qui enregistre un constat contenant un octet ESC dans son title et sa location, exécuté avec go test ./internal/cli ./internal/report.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug good first issue severity: low

Summary

The report renderers strip control characters from target-derived text before printing (internal/report/doc.go:576-583), so a scanned repository cannot move the cursor or retitle the operator's terminal. spackle runs compare and the spackle runs list print finding titles, file locations and targets from the ledger without that cleaning.

Where

  • internal/cli/runs.go:308-322 (runRunsCompare text output)
  • internal/cli/runs.go:88-98 (printRunRow)
  • internal/report/doc.go:576-583, internal/report/terminal.go:24-29 (the cleaning the reports apply)

Details

line := fmt.Sprintf("  %s  %-8s %s (%s)", r.ID, r.Severity, r.Title, r.Location)

Titles can be model-written from target content, and locations hold target file names. On POSIX filesystems, file names can contain control bytes.

Impact

A scanned repository can put terminal control sequences into the operator's terminal output when they compare or list runs. This is display-only, but it breaks the guarantee the report path already gives.

Suggested fix

Export the existing cleaning helper (for example report.CleanText) and apply it to Title, Location and Target in runRunsCompare and to Target and Extra in printRunRow. JSON output needs no change.

Acceptance criteria

  • Text output of runs and runs compare contains no C0 or C1 control characters from ledger content.
  • A test stores a finding whose title and location contain an ESC byte and checks the printed text.

Getting started

  • Relevant files: internal/cli/runs.go, internal/report/doc.go
  • How to run tests: go test ./internal/cli ./internal/report

Related: #45


Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: bug|internal/cli/runs.go|runRunsCompare

Langage dominant
Go
Étoiles
0
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Spackle

Toutes les issues de TMHSDigital/Spackle

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.