закрыты известные остатки
- документ самоуправления объявляется ключом governance, а не угадывается по «он один и без ключей оси»: конвенция, потерявшая topic, была от него неотличима и тихо теряла все проверки об отъезде к потребителю - проверка путей канона больше не ловит README.md и READING.md — эти два имени значат что-то и на стороне потребителя - lang.Recognize требует совпадения и слов, и номера версии; директории компонентов сверяются на вложенность, а не только на равенство - у обеих проверок появился --json, а convy sync называет ссылки на темы, которых компонент не взял
This commit is contained in:
@@ -88,8 +88,17 @@ func (s *Section) Retire(key, note string) {
|
||||
// Manifest is a parsed suite manifest.
|
||||
type Manifest struct {
|
||||
Language Language `toml:"language"`
|
||||
Topics Section `toml:"topics,omitempty"`
|
||||
Prefixes Section `toml:"prefixes,omitempty"`
|
||||
// Governance is the path of the document the suite governs itself by: the
|
||||
// one written in the conventions language yet belonging to no topic, so
|
||||
// that nobody can subscribe to it and it travels nowhere.
|
||||
//
|
||||
// It is declared rather than guessed. A convention that lost its topic key
|
||||
// looks exactly like it, and the loss is the expensive one — the file keeps
|
||||
// every check of form while quietly dropping every check about travelling
|
||||
// to a consumer.
|
||||
Governance string `toml:"governance,omitempty"`
|
||||
Topics Section `toml:"topics,omitempty"`
|
||||
Prefixes Section `toml:"prefixes,omitempty"`
|
||||
|
||||
// Path is where the manifest was read from.
|
||||
Path string `toml:"-"`
|
||||
@@ -207,6 +216,11 @@ func (m *Manifest) PathOf(prefix string) (string, bool) {
|
||||
return path, ok
|
||||
}
|
||||
|
||||
// Governs reports whether the path is the document the suite governs itself by.
|
||||
func (m *Manifest) Governs(path string) bool {
|
||||
return m.Governance != "" && filepath.ToSlash(m.Governance) == filepath.ToSlash(path)
|
||||
}
|
||||
|
||||
// TopicLive reports whether the topic is declared among the live ones.
|
||||
func (m *Manifest) TopicLive(topic string) bool {
|
||||
_, ok := m.Topics.Live[topic]
|
||||
|
||||
Reference in New Issue
Block a user