claudetool/codereview: new package extracted from claudetool
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/claudetool/patch.go b/claudetool/patch.go
index 0886e66..419e966 100644
--- a/claudetool/patch.go
+++ b/claudetool/patch.go
@@ -127,7 +127,7 @@
likelyGoFile := strings.HasSuffix(input.Path, ".go")
- autogenerated := likelyGoFile && isAutogeneratedGoFile(orig)
+ autogenerated := likelyGoFile && IsAutogeneratedGoFile(orig)
parsed := likelyGoFile && parseGo(orig) != nil
origStr := string(orig)
@@ -262,7 +262,8 @@
return err
}
-func isAutogeneratedGoFile(buf []byte) bool {
+// IsAutogeneratedGoFile reports whether a Go file has markers indicating it was autogenerated.
+func IsAutogeneratedGoFile(buf []byte) bool {
for _, sig := range autogeneratedSignals {
if bytes.Contains(buf, []byte(sig)) {
return true