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

Offen
#1,261 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #1262 von @marco-c — ohne Merge geschlossen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python, rust
Bereich
tooling

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
469
Forks
74
Ø Merge
17 Std. 16 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus mozilla/rust-code-analysis

Alle Issues in mozilla/rust-code-analysis

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.