-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Don't wrap pipelines #1080
Comments
I agree, if we find a good heuristics we could also removes this option in favor of an auto mode:
|
I wonder if using the precedence of the operator would be a reasonable criterion. For example, perhaps everything at the precedence of |
For maximal headaches, the threshold precedence level could be an int configure option. :-P |
Commenting my opinion on this suggestion as it came up in #1851. We use let all_6_2char_hex a b c d e f =
- is_2char_hex a
- && is_2char_hex b
- && is_2char_hex c
- && is_2char_hex d
- && is_2char_hex e
- && is_2char_hex f
+ is_2char_hex a && is_2char_hex b && is_2char_hex c && is_2char_hex d
+ && is_2char_hex e && is_2char_hex f let pf0 =
let open Utils.Parallel_folders in
- open_ construct
- |+ misc_stats_folder header
+ open_ construct |+ misc_stats_folder header
|+ elapsed_wall_over_blocks_folder header block_count
|+ elapsed_cpu_over_blocks_folder header block_count
|+ Span_folder.create header.initial_stats.timestamp_wall block_count
|+ cpu_usage_folder header block_count
- |+ pack_folder
- |+ tree_folder
- |+ index_folder
- |+ gc_folder
- |+ disk_folder
+ |+ pack_folder |+ tree_folder |+ index_folder |+ gc_folder |+ disk_folder
+ |+ Store_watched_nodes_folder.create block_count
|> seal let cmd =
root
- ^ "_build"
- / "default"
+ ^ "_build" / "default"
/ Fmt.str "%s serve %d %d &" Sys.argv.(0) i id.id
in Overall, it's not clear to me why we should split e.g. large lists / chains of
(I don't even think that @Julow's original example is much worse when split onto multiple lines. Again, if I kept these arguments in a list, they would be formatted in the same way.) Overall, I think the formatting experience would be better (and much less surprising), with the existing CC: @samoht |
The option
break-infix=fit-or-vertical
allows to break before every infix operators if the whole expression does not fit on a single line:This works well for pipelines, boolean operators and sometimes list cons/concat but not with most other expressions:
This is clearly not what we want when the operands are short or when the expression is dense (eg. arithmetic, cmdliner's
&
and$
).I'd like
fit-or-vertical
in thedefault
profile but only for pipelines.Should we implement that ? How to decide what is a pipeline and what is not ?
There have been discussions before, in #69 then
break-infix
has been added in #150.The text was updated successfully, but these errors were encountered: