The root of the problem is the root: How to get a root at all times in a codebase (or no root at all)

Offen
#25 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Refactoring
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
tooling

Rechercherichtung

Es werden keine Quelldateien oder Tests genannt. Beginne mit der Überprüfung der Codebase-Klassen und des Verhaltens von ScanCode TK --from-json und --strip-root, einschließlich der Handhabung von virtual_root und der Pfadreihenfolge. Abgeschlossen ist die Aufgabe, wenn eine abgestimmte, dokumentierte Spezifikation vorliegt, die die Root-Semantik für POSIX, Windows, Teilmengen und die projektübergreifende Verwendung klärt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

The root problem is this:

  1. ScanCode TK demands a single root named Resource in a Codebase
  2. ScanCode TK creates a fake "virtual_root" name if there is no common root in several scans (--from-json /VirtualCodebases)
  3. ScanCode.io does not have a single root for a project (or rather it has one which might be the "codebase" directory, but never reports it.
  4. on Windows there is no single root: each "drive" is its own root.
  5. on POSIX, there is a single root, but it has no name: this is name only "/" and it can have files and directories as children
  6. ScanCode TK and CommonCode generally ignore or even strip a leading slash therefore making the POSIX root moot
  7. When you "--strip-root" in ScanCode TK (leaving aside the possible loss of data attached to a root dir) it is potentially problematic to further read this with --from-json because we have no root anymore.
  8. Scanning a subset of paths or a collections of path in ScanCode is problematic because of this need for root
  9. The Codebase classes expect some sort order when creating Resources which may not make sense in all cases and may be overly restrictive as we cannot predict this sort order at all times
  10. Somethings are not entirely clear:
  • what is the different between a Codebase and a root Resource?
  • why could a Codebase not be just a collection of paths? And why do we even need a root?

We need to define a clean and well spec way to handle this across all projects

Vorherrschende Sprache
Python
Sterne
4
Forks
25
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

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 aboutcode-org/commoncode

Alle Issues in aboutcode-org/commoncode

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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