Problem
gaze crap --analyzer snake-eyes --language python . fails immediately with:
Root Cause
In cmd/gaze/main.go, line ~929, runCrap calls loader.FindModuleRoot() unconditionally before checking the --analyzer flag. For non-Go projects (Python, TypeScript, etc.), there is no go.mod, causing an immediate failure before the external analyzer path is ever reached.
Correct Pattern
gaze quality handles this correctly — it defers module resolution until after checking --analyzer, and when an external analyzer is set, it uses os.Getwd() instead of FindModuleRoot(). See runQualityWithExternalAnalyzer in PR #242.
Reproduction
# In any Python project with snake-eyes installed:
gaze crap --analyzer snake-eyes --language python .
# => Error: no go.mod found
# Compare with quality, which works:
gaze quality --analyzer snake-eyes --language python .
# => Runs successfully
Proposed Fix
Follow the same pattern as runQualityWithExternalAnalyzer: check for --analyzer before calling loader.FindModuleRoot(). When an external analyzer is set, use os.Getwd() for the module directory and skip Go-specific module resolution.
Impact
HIGH — gaze crap is completely unusable with external analyzers for non-Go projects. This blocks the primary CRAP score use case for language analyzers like snake-eyes.
Related
Problem
gaze crap --analyzer snake-eyes --language python .fails immediately with:Root Cause
In
cmd/gaze/main.go, line ~929,runCrapcallsloader.FindModuleRoot()unconditionally before checking the--analyzerflag. For non-Go projects (Python, TypeScript, etc.), there is nogo.mod, causing an immediate failure before the external analyzer path is ever reached.Correct Pattern
gaze qualityhandles this correctly — it defers module resolution until after checking--analyzer, and when an external analyzer is set, it usesos.Getwd()instead ofFindModuleRoot(). SeerunQualityWithExternalAnalyzerin PR #242.Reproduction
Proposed Fix
Follow the same pattern as
runQualityWithExternalAnalyzer: check for--analyzerbefore callingloader.FindModuleRoot(). When an external analyzer is set, useos.Getwd()for the module directory and skip Go-specific module resolution.Impact
HIGH —
gaze crapis completely unusable with external analyzers for non-Go projects. This blocks the primary CRAP score use case for language analyzers like snake-eyes.Related