diff --git a/checks/noscripts/go.mod b/checks/noscripts/go.mod new file mode 100644 index 00000000..e1554e3c --- /dev/null +++ b/checks/noscripts/go.mod @@ -0,0 +1,3 @@ +module checks/noscripts + +go 1.22 diff --git a/checks/noscripts/noscripts_test.go b/checks/noscripts/noscripts_test.go new file mode 100644 index 00000000..a96022c4 --- /dev/null +++ b/checks/noscripts/noscripts_test.go @@ -0,0 +1,19 @@ +package noscripts + +import ( + "errors" + "os" + "path/filepath" + "testing" +) + +// The catalogue's checks are Go tests (novox/hq ADR 0529 clause 5, ADR 0445): the checker runs every nested Go module's tests by +// the language's convention and no script at the root says what else to run. A script back at the root would be a check nobody +// runs (ADR 0503 ยง3: since R4e the checker has not run them), so it is refused. +func TestNoScriptOfTheOldCheckStandsAtTheRoot(t *testing.T) { + for _, name := range []string{"merge-check.sh", "merge-check-typescript.sh", "check-nested-modules.sh"} { + if _, err := os.Stat(filepath.Join("..", "..", name)); !errors.Is(err, os.ErrNotExist) { + t.Errorf("%s stands at the catalogue's root (%v): what it ran is a Go test in checks/ or a step of the build module", name, err) + } + } +}