Skip to content

Add synopsis to dune rules/aliases. Show synopsis in dune show aliases #11522

Open
@maxim092001

Description

@maxim092001

Desired Behavior

As a user of dune, I define a lot of different rules in my project:

  • Generate OCaml types from some schema
  • Run CLI tool to make network request to do some validation of my OCaml code
  • Download some binary executable to run before/during build
  • Run tests/executable with some pre-defined flags

Usually, I add an alias to each dune rule:

(rule
 (deps
  (glob_files schema.json))
 (alias validate_schema)
 (action
  (run
   validation_bin
   --mode
   validate
   --schema
   schema.json)))

Rules may get really complex and it is hard for me as a user to understand what kind of rules I have in project, especially when I switch projects often.

Currently, dune has support to show aliases in a top level dune file via dune show aliases. I propose to enhance this functionality.

Example

User should be able to add synopsis to a dune rule:

(rule
 (synopsis "Schema validation via validation_bin tool")
 (deps
  (glob_files schema.json))
 (alias validate_schema)
 (action
  (run
   validation_bin
   --mode
   validate
   --schema
   schema.json)))

And dune show aliases should be able to display validate_schema with synopsis in its output such as:

all
default
doc
fmt
install
validate_schema --- Schema validation via validation_bin tool

I believe synopsis for default aliases can also be added as part of this feature.

I would be happy to contribute this functionality if there is an agreement that it is useful and needed. I, though, would need some on boarding....

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCommand line relatedfeature-requestUser wanted features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions