закрыты известные остатки
- документ самоуправления объявляется ключом governance, а не угадывается по «он один и без ключей оси»: конвенция, потерявшая topic, была от него неотличима и тихо теряла все проверки об отъезде к потребителю - проверка путей канона больше не ловит README.md и READING.md — эти два имени значат что-то и на стороне потребителя - lang.Recognize требует совпадения и слов, и номера версии; директории компонентов сверяются на вложенность, а не только на равенство - у обеих проверок появился --json, а convy sync называет ссылки на темы, которых компонент не взял
This commit is contained in:
@@ -18,6 +18,7 @@ func runSuiteCheck(env Env, args []string) ExitCode {
|
||||
fs.SetOutput(env.Err)
|
||||
root := fs.String("root", "", "root of the suite; by default it is looked up upwards from the current directory")
|
||||
quiet := fs.Bool("quiet", false, "print findings only")
|
||||
asJSON := fs.Bool("json", false, "write the findings as JSON, for a caller that is not a person")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return Usage
|
||||
}
|
||||
@@ -46,13 +47,32 @@ func runSuiteCheck(env Env, args []string) ExitCode {
|
||||
}
|
||||
|
||||
rep := check.Suite(s)
|
||||
printReport(env.Out, rep, s, *quiet)
|
||||
if *asJSON {
|
||||
if code := printJSON(env, rep); code != OK {
|
||||
return code
|
||||
}
|
||||
} else {
|
||||
printReport(env.Out, rep, s, *quiet)
|
||||
}
|
||||
if rep.Errors() > 0 {
|
||||
return Failed
|
||||
}
|
||||
return OK
|
||||
}
|
||||
|
||||
// printJSON writes the findings for a machine. It is the same report the person
|
||||
// gets, in the same order — a second answer that disagreed with the first would
|
||||
// be worse than no second answer.
|
||||
func printJSON(env Env, rep *check.Report) ExitCode {
|
||||
body, err := rep.JSON()
|
||||
if err != nil {
|
||||
fmt.Fprintln(env.Err, err)
|
||||
return Failed
|
||||
}
|
||||
env.Out.Write(body)
|
||||
return OK
|
||||
}
|
||||
|
||||
func printReport(w io.Writer, rep *check.Report, s *suite.Suite, quiet bool) {
|
||||
findings := rep.Findings()
|
||||
printFindings(w, findings)
|
||||
|
||||
Reference in New Issue
Block a user