Grammar check tasks compare unrelated files and skip most of the others

Ouverte
#1,261 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

  • #1262 par @marco-c — fermée sans fusion

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
python, rust
Domaine
tooling

Piste de recherche

Start in check-grammar-crate.py at the compare-metrics path that invokes json-minimal-tests on the old and new metrics directories. Read the linked json-minimal-tests walk in src/main.rs around the parallel WalkDir zip to confirm the misalignment, then decide whether to sort the inputs or compare entries by relative path instead of filename. Done means every file present in both metric directories is paired with its counterpart, and mismatched old/new files are no longer reported; note that PR #1262 is closed unmerged, so check the comment thread before redoing that approach.

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

Description

check-grammar-crate.py compare-metrics runs json-minimal-tests on the two directories containing the old and new metrics. Given two directories, json-minimal-tests walks them in parallel, zipping the two WalkDir iterators, and compares two entries only if their file names are equal.

The two walks are unsorted, and the two directories are filled in a different order by the concurrent runs of rust-code-analysis-cli, so the entries quickly get misaligned. Then:

  • files with the same name in different directories are compared with each other, which reports differences that don't exist (e.g. the old metrics of media/libvpx/config/generic/vp9_rtcd.h, 114 lines, were the ones of media/libvpx/config/linux/ia32/vp9_rtcd.h, 193 lines; same for test262's prop-desc.js and shell.js, libffi's ffi.c and ffitarget.h, ...);
  • all the other misaligned pairs are skipped, so most files are never compared and real differences can go unnoticed.

In the grammar check tasks for #1253 (https://community-tc.services.mozilla.com/tasks/groups/VF3vy5QbQ7G3-7Pp57HjVQ), all the global sloc differences in mozjs and mozcpp files that parse without errors came from such mismatched pairs.

Langage dominant
Rust
Étoiles
469
Forks
74
Merge moyen
17 h 16 min
PR mergées (30 j)
10

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

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 mozilla/rust-code-analysis

Toutes les issues de mozilla/rust-code-analysis

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

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