закрыты известные остатки
- документ самоуправления объявляется ключом governance, а не угадывается по «он один и без ключей оси»: конвенция, потерявшая topic, была от него неотличима и тихо теряла все проверки об отъезде к потребителю - проверка путей канона больше не ловит README.md и READING.md — эти два имени значат что-то и на стороне потребителя - lang.Recognize требует совпадения и слов, и номера версии; директории компонентов сверяются на вложенность, а не только на равенство - у обеих проверок появился --json, а convy sync называет ссылки на темы, которых компонент не взял
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"git.vakhrushev.me/av/convy/internal/check"
|
||||
"git.vakhrushev.me/av/convy/internal/manifest"
|
||||
"git.vakhrushev.me/av/convy/internal/project"
|
||||
)
|
||||
@@ -181,9 +182,31 @@ func syncComponent(env Env, o *opened, c manifest.Component, dry bool) (changed,
|
||||
}
|
||||
fmt.Fprintf(env.Out, " = %-28s the guide to reading a rule\n", guide)
|
||||
}
|
||||
reportDangling(env, o, c)
|
||||
return changed, left, OK
|
||||
}
|
||||
|
||||
// reportDangling says which copies point at topics this component did not take.
|
||||
// It is a note rather than a finding: naming a rule of another topic outside
|
||||
// the norm is allowed, and the reader loses a pointer rather than a
|
||||
// requirement. But it is also the one thing about a copy that cannot be seen
|
||||
// without the suite, so it is said where the suite is at hand.
|
||||
func reportDangling(env Env, o *opened, c manifest.Component) {
|
||||
docs, _ := copies(o.Root, c.Dir)
|
||||
for _, d := range docs {
|
||||
refs := check.Dangling(d, o.Suite, c.Subscribed)
|
||||
if len(refs) == 0 {
|
||||
continue
|
||||
}
|
||||
var parts []string
|
||||
for _, ref := range refs {
|
||||
parts = append(parts, fmt.Sprintf("%s (%s)", ref.Text, check.TopicOf(o.Suite, ref.Prefix)))
|
||||
}
|
||||
fmt.Fprintf(env.Out, " ? %-28s points at %s — not taken by this component\n",
|
||||
d.Path, strings.Join(parts, ", "))
|
||||
}
|
||||
}
|
||||
|
||||
// orphan is a copy in a component directory that the manifest does not call for.
|
||||
type orphan struct {
|
||||
path string
|
||||
|
||||
Reference in New Issue
Block a user