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

Inflections are generated in one direction, so an inflected file name is never carried by its stem

Aperta
#64 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
tooling

Direzione di ricerca

Inizia con namespace.Contains e la logica di generazione delle forme flesse, quindi riproduci il comportamento usando internal/ssa/tracing.go e gli esempi di tracing/tracer nell'issue. Confronta il vocabulary workaround esistente con il comportamento proposto e determina come devono essere gestite le forme verbali equivalenti. Il lavoro è completato quando la stessa famiglia verbale viene trattata in modo coerente senza far corrispondere nomi non correlati come story e store.

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

Descrizione

Inflected forms are generated from the namespace, and only ever longer ones. A namespace that is itself an inflected form is never carried by its own stem, so the verdict depends on which form the file name happens to use.

store.go    storingThing   carried
storing.go  storeOther     not carried

trace.go    tracingZ       carried
trace.go    tracerW        carried
tracing.go  traceX         not carried
tracing.go  tracerY        not carried

Every pair above is the same English verb. The rule separates them on nothing an author would recognise as a rule.

Where it came from

namespace.Contains allows the namespace anywhere in the name, with a free right edge. That covers a name longer than the namespace: store is a prefix of storing, so storingThing carries it without any generation at all.

Generation exists for the two inflections that change the namespace's own spelling, store to storing and apply to applies. It is built from the namespace side on purpose, so that only constructed forms are accepted and story never carries store.

That decision is still right. The gap is that generation only ever lengthens. Nothing produces trace from tracing, and the free right edge cannot help, since the namespace is the longer string.

This is real, not hypothetical

zerologlintctx has internal/ssa/tracing.go, whose declarations are tracerType, tracerEvent, traceValue, traceCommon, tracePhi. Under qualify: ondemand the file is asked for tracingTracerType and tracingTraceValue, which stutter. Renaming the file to tracer.go silences five of them and leaves the trace* ones, so the file name decides how much stuttering is demanded.

Options

Generate the stem as well. Reversing the e-drop turns tracing into trace, and that is the answer here. It is also how ring becomes r and string becomes str, so it needs a guard beyond stripping ing, and any guard is a rule about English rather than about Go.

Leave it to rules.naming.vocabulary. One line covers the case, and the free right edge makes it reach the whole family:

rules:
  naming:
    vocabulary:
      tracing: [trace]

This works today. It asks the author to notice a distinction that has no reason behind it, which is the part worth fixing.

Report it. A namespace the generator can recognise as an inflected form could carry a note in the diagnostic, pointing at the vocabulary key rather than at a rename that stutters.

Note

The rule is off by default, so nothing is broken for a project that has not opted in. What the vocabulary covers, it covers well. The asymmetry is the defect: two files spelled by the same verb are treated differently, and the author has no way to predict which one is which.

Lingua principale
Go
Stelle
18
Fork
0
Merge medio
57m
PR unite (30g)
92

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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.

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.