You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: gaze crap --analyzer fails with 'no go.mod found' for non-Go projects #250
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.
Activity
fix: allow gaze crap --analyzer on non-Go projects
fix: allow gaze crap --analyzer on non-Go projects
fix(#257): defer FindModuleRoot in runReport after --analyzer check
fix(#257): defer FindModuleRoot in runReport after --analyzer check