Skip to content

Commit

Permalink
Fix deps on ppx_show
Browse files Browse the repository at this point in the history
Now ppx_show is used only with tests.

Remove comments.

Signed-off-by: s-khechnev <hechnev@gmail.com>

Fix message of parser about line in diff

Signed-off-by: s-khechnev <hechnev@gmail.com>
  • Loading branch information
s-khechnev authored and Kakadu committed May 30, 2023
1 parent 1c8a5e0 commit 02462f9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dune-project
Expand Up @@ -57,7 +57,7 @@
(>= 4.14)
(< 5.0)))
ppx_inline_test
ppx_show
(ppx_show :with-test)
ppx_expect
curly
stdio
Expand Down
9 changes: 2 additions & 7 deletions review/main.ml
Expand Up @@ -9,12 +9,6 @@ let _example () =
| Error e -> Format.printf "Failed: %a" Curly.Error.pp e
;;

(* let your_token =
match Sys.getenv "TOKEN" with
| s -> s
| exception Not_found -> failwith "Setup token using env TOKEN"
;; *)

type info =
{ mutable commit_id : string option
; mutable pull_number : int option
Expand Down Expand Up @@ -207,5 +201,6 @@ let () =
; "-list_reviews", Arg.Unit (fun () -> list_reviews info), " "
]
(fun _ -> assert false)
"Use -owner [OWNER] -repo [REPO NAME] -pr_number [PR NUMBER] -commit [HASH] -token [READ-WRITE TOKEN] -irdjsonl [PATH] -review to create review"
"Use -owner [OWNER] -repo [REPO NAME] -pr_number [PR NUMBER] -commit [HASH] -token \
[READ-WRITE TOKEN] -irdjsonl [PATH] -review to create review"
;;
5 changes: 4 additions & 1 deletion review/parser.ml
Expand Up @@ -69,7 +69,10 @@ let () =
| { file = Some file; line = Some line } ->
(match Diff_parser.lookup parsed ~file ~line with
| Some diff_pos ->
Format.printf "Got something. It should be at %d line in diff\n" diff_pos
Format.printf
"Got something. It should be at %d lines below from the first chunk header \
of file in diff\n"
diff_pos
| None -> Format.eprintf "Couldn't find it.\n")
| _ -> Format.eprintf "File or line was not initialized\n")
| Error s -> Format.eprintf "Parsing failed: %s\n" s
Expand Down
2 changes: 1 addition & 1 deletion review_tests/test1.t/run.t
@@ -1,2 +1,2 @@
$ cat blob1.diff | ../../review/parser.exe - -f new/changed.txt -l 2
Got something. It should be at 2 line in diff
Got something. It should be at 2 lines below from the first chunk header of file in diff
2 changes: 1 addition & 1 deletion review_tests/test2.t/run.t
@@ -1,2 +1,2 @@
$ cat test.diff | ../../review/parser.exe - -f test.js -l 21
Got something. It should be at 25 line in diff
Got something. It should be at 25 lines below from the first chunk header of file in diff
2 changes: 1 addition & 1 deletion reviewer.opam
Expand Up @@ -12,7 +12,7 @@ depends: [
"dune" {>= "3.4"}
"ocaml" {>= "4.14" & < "5.0"}
"ppx_inline_test"
"ppx_show"
"ppx_show" {with-test}
"ppx_expect"
"curly"
"stdio"
Expand Down

0 comments on commit 02462f9

Please sign in to comment.