RepoPilot

wagoodman / dive

Search wagoodman/dive

GitHub

Code

How wagoodman/dive is laid out, and where to start for common changes.

There is no import map for this report yet.

Where to start reading

  1. Repository root
  2. Repository root
  3. Likely start-up file
  4. Suggested starting pointAI
  5. Suggested starting pointAI
  6. Suggested starting pointAI
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a new container runtime backend (e.g., containerd)

  • Create a new resolver struct in dive/image/{runtime}/ implementing the Resolver interface from dive/image/resolver.go
  • Register the new resolver in dive/get_image_resolver.go by adding a case to the resolver selection logic
  • Add CLI flag and option parsing in cmd/dive/cli/internal/options/application.go to enable runtime selection

Add a new analysis metric or efficiency rule

  • Define the metric calculation in dive/filetree/efficiency.go by adding a new method to the EfficiencyCalculator
  • Extend the Layer or Image struct in dive/image/image.go or dive/image/layer.go to store the new metric
  • Expose the metric in dive/image/analysis.go where the Image is populated during analysis
  • Display the metric in cmd/dive/cli/internal/ui/v1/format/format.go or add a new UI view

Add a new CI evaluation rule

  • Define the rule type and logic in cmd/dive/cli/internal/command/ci/rule.go
  • Parse the rule from user configuration in cmd/dive/cli/internal/command/ci/rules.go
  • Apply the rule in cmd/dive/cli/internal/command/ci/evaluator.go during evaluation
  • Test the rule in cmd/dive/cli/internal/command/ci/evaluator_test.go with example images

Add a new export format (e.g., YAML, CSV)

  • Create a new exporter in cmd/dive/cli/internal/command/export/export.go with a format handler function
  • Register the format option in cmd/dive/cli/internal/options/export.go
  • Test the export in cmd/dive/cli/internal/command/export/export_test.go with snapshot validation

Trace runtime behavior

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • Files marked “likely” are guessed from their names.

Code quality and hotspots

Largest source files

  • Branch points6 per file on average
  • Code issues0 errors, 6 warnings
  • Largest file846 lines
  • Hotspot load0 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions2 workflows
  • Tests18 test filesGo test · 0.19 test files per source file (file count, not coverage)
  • Dependency updatesDependabot

Test folders: cmd/dive/cli · dive/filetree · cmd/dive/cli/internal/command/export

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.