Skip to content

auto formatting of run shouldn't split its content into one word per line #10860

@Khady

Description

@Khady

Desired Behavior

When using run in a rule stanza we can have long command with many arguments which quickly end up being split into one word per line. It would tend to look better if run could keep everything on a single line as much as possible. And when it splits things into multiple lines it would put as much content as possible on every line.

Example

The current

(rule
 (target sql_file1.ml)
 (deps
  gen_file2.sql
  gen_file3.sql)
 (mode promote)
 (action
  (with-stdout-to
   %{target}
   (run
    sqlgg
    -static-header
    -gen
    caml_io
    -name
    Make
    -params
    unnamed
    -category
    none
    gen_file2.sql
    -category
    all
    gen_file3.sql))))

could look more like this

(rule
 (target sql_file1.ml)
 (deps 
  gen_file2.sql
  gen_file3s.sql)
 (mode promote)
 (action
  (with-stdout-to
   %{target}
   (run  sqlgg -static-header -gen caml_io -name Make -params unnamed -category none gen_file2.sql -category all gen_file3.sql))))

or if the line is longer than the limit, it could look like this

   (run  sqlgg -static-header -gen caml_io -name Make -params unnamed -category none 
            gen_file2.sql -category all gen_file3.sql))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions