diff --git a/CHANGES.md b/CHANGES.md index 739919bc584..673396ee530 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,9 +41,6 @@ - Fix an issue where C stubs would be rebuilt whenever the stderr of Dune was redirected. (#10883, fixes #10882, @nojb) -- Format long lists in s-expressions to fill the line instead of formatting - them in a vertical way (#10892, fixes #10860, @nojb) - - Fix the URL opened by the command `dune ocaml doc`. (#10897, @gridbugs) - Fix the file referred to in the error/warning message displayed due to the diff --git a/src/dune_lang/format.ml b/src/dune_lang/format.ml index 00a4996c119..f94dfac6427 100644 --- a/src/dune_lang/format.ml +++ b/src/dune_lang/format.ml @@ -26,10 +26,7 @@ let print_wrapped_list ~version x = let inner = Pp.concat_map ~sep:Pp.space ~f:pp_simple x in if version < (2, 8) then Pp.char '(' ++ Pp.hovbox ~indent:1 inner ++ Pp.char ')' - else - (if version < (3, 17) then Pp.hvbox else Pp.hovbox) - ~indent:1 - (Pp.char '(' ++ inner ++ Pp.char ')') + else Pp.hvbox ~indent:1 (Pp.char '(' ++ inner ++ Pp.char ')') ;; let pp_comment_line l = Pp.char ';' ++ Pp.verbatim l diff --git a/test/blackbox-tests/test-cases/describe/describe-workspace-pp.t b/test/blackbox-tests/test-cases/describe/describe-workspace-pp.t index 006932d1786..a017204273c 100644 --- a/test/blackbox-tests/test-cases/describe/describe-workspace-pp.t +++ b/test/blackbox-tests/test-cases/describe/describe-workspace-pp.t @@ -104,13 +104,20 @@ not stable across different setups. (executables ((names (exe)) (requires - (c39d8e11db2363236e69af7750ce7b9a c9367091ddd9a70d99fc22ede348f17c - 1f2b5eb300ea716920494385a31bb5fb 5014e215e204cf8da6c32644cda1b31e - 249b2edaf3cc552a247667041bb5f015 ba85adfb1c97e7d7af3df35b16b2fc0d - 2363fd46dac995a1c79679dfa1a9881b 43b7cbe1f93f4f502ec614971027cff9 - e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be - 449445be7a24ce51e119d57e9e255d3f 5ae836dcdead11d5c16815297c5a1ae6 - 2c61db8e94cb08e0fe642152aee8121a 6fb5d46437c55abca48c8b995f8afa51 + (c39d8e11db2363236e69af7750ce7b9a + c9367091ddd9a70d99fc22ede348f17c + 1f2b5eb300ea716920494385a31bb5fb + 5014e215e204cf8da6c32644cda1b31e + 249b2edaf3cc552a247667041bb5f015 + ba85adfb1c97e7d7af3df35b16b2fc0d + 2363fd46dac995a1c79679dfa1a9881b + 43b7cbe1f93f4f502ec614971027cff9 + e68a558facd1546b51c7abdbf6aed1cb + 24f4eb12e3ff51b310dbf7443c6087be + 449445be7a24ce51e119d57e9e255d3f + 5ae836dcdead11d5c16815297c5a1ae6 + 2c61db8e94cb08e0fe642152aee8121a + 6fb5d46437c55abca48c8b995f8afa51 f9851d3f8ae32391e7594cf97332a78c)) (modules (((name Exe) @@ -140,7 +147,8 @@ not stable across different setups. (uid f9851d3f8ae32391e7594cf97332a78c) (local true) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2c61db8e94cb08e0fe642152aee8121a + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2c61db8e94cb08e0fe642152aee8121a 6fb5d46437c55abca48c8b995f8afa51)) (source_dir _build/default/dummy_ppx) (modules @@ -179,10 +187,14 @@ not stable across different setups. (uid 2c61db8e94cb08e0fe642152aee8121a) (local false) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b - 5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9 - e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be - 5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015 + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2363fd46dac995a1c79679dfa1a9881b + 5014e215e204cf8da6c32644cda1b31e + 43b7cbe1f93f4f502ec614971027cff9 + e68a558facd1546b51c7abdbf6aed1cb + 24f4eb12e3ff51b310dbf7443c6087be + 5ae836dcdead11d5c16815297c5a1ae6 + 249b2edaf3cc552a247667041bb5f015 449445be7a24ce51e119d57e9e255d3f)) (source_dir /FINDLIB/ppxlib) (modules ()) @@ -284,7 +296,8 @@ not stable across different setups. (uid f9851d3f8ae32391e7594cf97332a78c) (local true) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2c61db8e94cb08e0fe642152aee8121a + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2c61db8e94cb08e0fe642152aee8121a 6fb5d46437c55abca48c8b995f8afa51)) (source_dir _build/default/dummy_ppx) (modules @@ -336,10 +349,14 @@ not stable across different setups. (uid 2c61db8e94cb08e0fe642152aee8121a) (local false) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b - 5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9 - e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be - 5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015 + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2363fd46dac995a1c79679dfa1a9881b + 5014e215e204cf8da6c32644cda1b31e + 43b7cbe1f93f4f502ec614971027cff9 + e68a558facd1546b51c7abdbf6aed1cb + 24f4eb12e3ff51b310dbf7443c6087be + 5ae836dcdead11d5c16815297c5a1ae6 + 249b2edaf3cc552a247667041bb5f015 449445be7a24ce51e119d57e9e255d3f)) (source_dir /FINDLIB/ppxlib) (modules ()) diff --git a/test/blackbox-tests/test-cases/describe/describe.t b/test/blackbox-tests/test-cases/describe/describe.t index d283af9e5f1..598fde3193d 100644 --- a/test/blackbox-tests/test-cases/describe/describe.t +++ b/test/blackbox-tests/test-cases/describe/describe.t @@ -546,10 +546,14 @@ not stable across different setups. (uid 2c61db8e94cb08e0fe642152aee8121a) (local false) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b - 5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9 - e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be - 5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015 + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2363fd46dac995a1c79679dfa1a9881b + 5014e215e204cf8da6c32644cda1b31e + 43b7cbe1f93f4f502ec614971027cff9 + e68a558facd1546b51c7abdbf6aed1cb + 24f4eb12e3ff51b310dbf7443c6087be + 5ae836dcdead11d5c16815297c5a1ae6 + 249b2edaf3cc552a247667041bb5f015 449445be7a24ce51e119d57e9e255d3f)) (source_dir /FINDLIB/ppxlib) (modules ()) @@ -1116,10 +1120,14 @@ not stable across different setups. (uid 2c61db8e94cb08e0fe642152aee8121a) (local false) (requires - (ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b - 5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9 - e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be - 5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015 + (ba85adfb1c97e7d7af3df35b16b2fc0d + 2363fd46dac995a1c79679dfa1a9881b + 5014e215e204cf8da6c32644cda1b31e + 43b7cbe1f93f4f502ec614971027cff9 + e68a558facd1546b51c7abdbf6aed1cb + 24f4eb12e3ff51b310dbf7443c6087be + 5ae836dcdead11d5c16815297c5a1ae6 + 249b2edaf3cc552a247667041bb5f015 449445be7a24ce51e119d57e9e255d3f)) (source_dir /FINDLIB/ppxlib) (modules ()) diff --git a/test/blackbox-tests/test-cases/formatting/format-dune-file.t/run.t b/test/blackbox-tests/test-cases/formatting/format-dune-file.t/run.t index 42d6fcca263..9fd4bab833b 100644 --- a/test/blackbox-tests/test-cases/formatting/format-dune-file.t/run.t +++ b/test/blackbox-tests/test-cases/formatting/format-dune-file.t/run.t @@ -49,7 +49,7 @@ When a list is indented, there is no extra space at the end. When there is a long list of atoms, quoted strings, templates and singletons, it gets wrapped. - $ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file --dune-version 3.16 + $ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file (library (name dune) (libraries @@ -68,18 +68,6 @@ it gets wrapped. (action (run %{project_root}/src/let-syntax/pp.exe %{input-file})))) -The same file, but in the current version: - - $ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file - (library - (name dune) - (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang - ocaml_config which_program) - (synopsis "Internal Dune library, do not use!") - (preprocess - (action - (run %{project_root}/src/let-syntax/pp.exe %{input-file})))) - In multi-line strings, newlines are escaped, but their syntax is not preserved. $ dune format-dune-file <