MCPcopy Create free account
hub / github.com/alibaba/open-code-review / writeRulesCheckTestFile

Function writeRulesCheckTestFile

cmd/opencodereview/rules_cmd_test.go:31–40  ·  view source on GitHub ↗
(t *testing.T, repo, relPath, content string)

Source from the content-addressed store, hash-verified

29}
30
31func writeRulesCheckTestFile(t *testing.T, repo, relPath, content string) {
32 t.Helper()
33 full := filepath.Join(repo, relPath)
34 if err := os.MkdirAll(filepath.Dir(full), 0o755); err != nil {
35 t.Fatal(err)
36 }
37 if err := os.WriteFile(full, []byte(content), 0o644); err != nil {
38 t.Fatal(err)
39 }
40}
41
42// setRulesCheckRepo points the rulesCheckCmd's package-level --repo flag at
43// repo for the duration of the test, restoring it afterward. runRulesCheck

Calls

no outgoing calls

Tested by

no test coverage detected