Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Dependencies can be more than imports or used binaries

Aperta
#6 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
dart
Ambito
tooling

Direzione di ricerca

Inizia con le regole sulle dipendenze descritte nel README, in particolare il passaggio relativo agli import e all’uso degli eseguibili. Determina se le dipendenze esposte tramite tipi API inferiti o restituiti debbano essere rilevate, segnalate con un avviso o soltanto documentate; il lavoro è completo quando sono definiti un comportamento e la relativa validazione.

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

Descrizione

From the README:

Some packages are not imported by any dart files but are used for their executables.

Based on this sentence I'm assuming that only import statements are found programatically. There is another way that a dependency can sneak in that you might want to consider, or at least warn in the readme so it can be treated the same way as executables.

If a class is returned from an API that isn't defined in the package, you can silently be depending on a method signature defined in some other package that you might not import.

import 'package:b/b.dart' as b;
// no import to package:c

void main() {
  b.someBMethod().someCMethod();
  // If someBMethod returned a class from C I have an implicit dependency on C
}

Here package:b could plausibly move to a new version of package:c without a breaking change version bump.

With type inference this 'type leaking' can happen in sneaker ways:

import 'package:b/b.dart' as b;
// no import to package:c

void main() {
  // Assume someBMethod has the signature: int someBMethod(C c)
  var x = someBMethod;
  x = (value) => value.someCMethod();
 // due to type inference I got autocomplete and would now break if someCMethod is renamed.
}
Lingua principale
Dart
Stelle
66
Fork
26
Merge medio
10h 59m
PR unite (30g)
4

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 Workiva/dependency_validator

Tutte le issue di Workiva/dependency_validator

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.