File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed
Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 22 Syntax error in code block in docstring
33 FormatDocstringsTestError.res:5:10-6:3
44
5- 3 [2m│[0m
6- 4 [2m│[0m
7- [1;31m5[0m [2m│[0m let name=[1;31m [0m
8- [1;31m6[0m [2m│[0m [1;31mlet[0m x=12
5+ 3 │
6+ 4 │
7+ 5 │ let name=
8+ 6 │ let x=12
99
1010 This let-binding misses an expression
1111
Original file line number Diff line number Diff line change 1919# Test format-docstrings command
2020for file in src/docstrings-format/* .{res,resi}; do
2121 output=" src/expected/$( basename $file ) .expected"
22- ../../_build/install/default/bin/rescript-tools format-docstrings " $file " --stdout > $output
22+ DISABLE_COLOR=true ../../_build/install/default/bin/rescript-tools format-docstrings " $file " --stdout > $output
2323 # # CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
2424 if [ " $RUNNER_OS " == " Windows" ]; then
2525 perl -pi -e ' s/\r\n/\n/g' -- $output
Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ let main () =
5454 logAndExit (Tools. extractDocs ~entry PointFile:path ~debug: false )
5555 | _ -> logAndExit (Error docHelp))
5656 | "format-docstrings" :: rest -> (
57+ (try
58+ match Sys. getenv " DISABLE_COLOR" with
59+ | "true" -> Clflags. color := Some Misc.Color. Never
60+ | _ -> ()
61+ with Not_found -> () );
5762 match rest with
5863 | [" -h" ] | [" --help" ] -> logAndExit (Ok formatDocstringsHelp)
5964 | [path; " --stdout" ] -> (
Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ module FormatDocstrings = struct
764764 ~display_filename: displayFilename ~source: codeWithOffset
765765 in
766766 if invalid then (
767- let buf = Buffer. create 32 in
767+ let buf = Buffer. create 1000 in
768768 let formatter = Format. formatter_of_buffer buf in
769769 Res_diagnostics. print_report ~formatter
770770 ~custom_intro: (Some " Syntax error in code block in docstring" )
You can’t perform that action at this time.
0 commit comments