Skip to content

bug: gaze crap --analyzer fails with 'no go.mod found' for non-Go projects #250

Closed

Description

@jflowers

Problem

gaze crap --analyzer snake-eyes --language python . fails immediately with:

Error: no go.mod found

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

Activity

  1. added
    bug
    on Sep 2, 2026
  2. self-assigned this
    on Sep 2, 2026
  3. moved this to In Progress 📋 in Unbound Force Planningon Sep 2, 2026
  4. moved this from In Progress 📋 to Ready for Review 👀 in Unbound Force Planningon Sep 4, 2026
  5. added a commit that references this issue on Sep 8, 2026
    c893e6a
  6. added a commit that references this issue on Sep 14, 2026
    ec204ea
  7. added 2 commits that reference this issue on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions