Skip to content

Running visualize with no arguments does not fail elegantlyΒ #6787

@davesmith00000

Description

@davesmith00000

On Mill 1.1.1.

If you just run ./mill visualize, you get an unhelpful error:

3/3, 1 FAILED] ./mill visualize 3s
3] [error] visualize
scala.MatchError: List() (of class scala.collection.immutable.Nil$)
  mill.resolve.Resolve.handleScriptModule$1(Resolve.scala:395)
  mill.resolve.Resolve.$anonfun$1(Resolve.scala:423)
  scala.collection.immutable.List.map(List.scala:240)
  ..etc

I'm going to be cheeky and suggest levels of improvement (which you can totally ignore, of course), if there are no arguments supplied:

Bronze

A minimal improvement would just be to print a nice message there, something like:
Mill visualize requires at least one argument specifying the task to visualize, e.g. ./mill visualize __.compile

Silver

A really nice improvement would be to visualise the module dependencies. In my case I have a project with an ever growing number of modules and all I really want to do is review the dependency chain that I have set up currently (or while I'm busy altering it...), so that I can quickly look for anything that looks odd.

Gold

..same as silver but output an ascii diagram to the terminal. 😁

Claude makes these sorts of things, which are surprisingly helpful because it makes my ask questions like "is the physics module really in the right place there? Seems wrong...":

indigoengine-shared (base module)
    ↓
indigo-core
    ↓
ultraviolet (jvm & js) ─────────────────┐
    ↓                                   β”‚
indigo-shaders                          β”‚
    ↓                                   β”‚
indigo-scenegraph                       β”‚
    ↓                                   β”‚
indigo-physics                          β”‚
    ↓                                   β”‚
indigo β†β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    ↓
indigo-extras
    ↓
roguelike-starterkit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions