{"action":"created","comment":{"url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/comments/209837620","pull_request_review_id":145926703,"id":209837620,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTgzNzYyMA==","diff_hunk":"@@ -57,6 +57,73 @@ let tokens_at t ?(filter= fun _ -> true) (l : Location.t) :\n   in\n   loop []\n \n+let find_after t f (loc : Location.t) =\n+  let loc = {loc with loc_start= loc.loc_end} in\n+  let pos = ref loc.loc_end.pos_cnum in\n+  let lexbuf =\n+    Lexing.from_function (fun bytes available ->\n+        let to_write = min (String.length t - !pos) available in\n+        Bytes.From_string.blit ~src:t ~src_pos:!pos ~dst:bytes ~dst_pos:0\n+          ~len:to_write ;\n+        pos := !pos + to_write ;\n+        to_write )\n+  in\n+  let rec loop () =\n+    match Lexer.token lexbuf with\n+    | Parser.EOF -> None\n+    | tok ->\n+        if f tok then\n+          let sub = Location.curr lexbuf in\n+          Some (merge loc ~sub)\n+        else loop ()\n+  in\n+  loop ()\n+\n+let extend_loc_to_include_attributes t (loc : Location.t)\n+    (l : Parsetree.attributes) =\n+  let last_loc =\n+    List.fold l ~init:loc\n+      ~f:(fun (acc : Location.t)\n+         (({loc= loc1; _}, payload) : Parsetree.attribute)\n+         ->\n+        if loc1.loc_ghost then acc\n+        else\n+          let loc2 =\n+            match payload with\n+            | PStr [] -> loc1\n+            | PStr l -> (List.last_exn l).pstr_loc\n+            | PSig [] -> loc1\n+            | PSig l -> (List.last_exn l).psig_loc\n+            | PTyp c -> c.ptyp_loc\n+            | PPat (p, None) -> p.ppat_loc\n+            | PPat (_, Some e) -> e.pexp_loc\n+          in\n+          if loc2.loc_end.pos_cnum <= acc.loc_end.pos_cnum then acc\n+          else loc2 )\n+  in\n+  if phys_equal last_loc loc then loc\n+  else\n+    let loc =\n+      { loc with\n+        loc_end= {loc.loc_end with pos_cnum= last_loc.loc_end.pos_cnum} }\n+    in\n+    let count = ref 0 in\n+    let l =\n+      find_after t\n+        (function\n+          | RBRACKET ->\n+              if !count = 0 then true else ( Int.decr count ; false )\n+          | LBRACKET | LBRACKETBAR | LBRACKETLESS | LBRACKETGREATER\n+           |LBRACKETPERCENT | LBRACKETPERCENTPERCENT | LBRACKETAT\n+           |LBRACKETATAT | LBRACKETATATAT ->\n+              Int.incr count ; false\n+          | _ -> false)\n+        loc\n+    in\n+    match l with\n+    | None -> assert false","path":"src/Source.ml","position":null,"original_position":68,"commit_id":"f608a615eda9246d99007db60357c371ca79105d","original_commit_id":"4c61b6342bd80e02e5528cee6ba34eac7bd5e7fb","user":{"login":"hhugo","id":835209,"node_id":"MDQ6VXNlcjgzNTIwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/835209?v=4","gravatar_id":"","url":"https://api.github.com/users/hhugo","html_url":"https://github.com/hhugo","followers_url":"https://api.github.com/users/hhugo/followers","following_url":"https://api.github.com/users/hhugo/following{/other_user}","gists_url":"https://api.github.com/users/hhugo/gists{/gist_id}","starred_url":"https://api.github.com/users/hhugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhugo/subscriptions","organizations_url":"https://api.github.com/users/hhugo/orgs","repos_url":"https://api.github.com/users/hhugo/repos","events_url":"https://api.github.com/users/hhugo/events{/privacy}","received_events_url":"https://api.github.com/users/hhugo/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-08-14T06:11:56Z","updated_at":"2018-08-14T06:11:56Z","html_url":"https://github.com/ocaml-ppx/ocamlformat/pull/287#discussion_r209837620","pull_request_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/comments/209837620"},"html":{"href":"https://github.com/ocaml-ppx/ocamlformat/pull/287#discussion_r209837620"},"pull_request":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287"}},"in_reply_to_id":209424268},"pull_request":{"url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287","id":206208127,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MjA4MTI3","html_url":"https://github.com/ocaml-ppx/ocamlformat/pull/287","diff_url":"https://github.com/ocaml-ppx/ocamlformat/pull/287.diff","patch_url":"https://github.com/ocaml-ppx/ocamlformat/pull/287.patch","issue_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/287","number":287,"state":"open","locked":false,"title":"locally disable ocamlformat","user":{"login":"hhugo","id":835209,"node_id":"MDQ6VXNlcjgzNTIwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/835209?v=4","gravatar_id":"","url":"https://api.github.com/users/hhugo","html_url":"https://github.com/hhugo","followers_url":"https://api.github.com/users/hhugo/followers","following_url":"https://api.github.com/users/hhugo/following{/other_user}","gists_url":"https://api.github.com/users/hhugo/gists{/gist_id}","starred_url":"https://api.github.com/users/hhugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhugo/subscriptions","organizations_url":"https://api.github.com/users/hhugo/orgs","repos_url":"https://api.github.com/users/hhugo/repos","events_url":"https://api.github.com/users/hhugo/events{/privacy}","received_events_url":"https://api.github.com/users/hhugo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-04T20:15:17Z","updated_at":"2018-08-14T06:11:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ee90117eb9113d79ab602f397aa6b2a0664c1d5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":726912631,"node_id":"MDU6TGFiZWw3MjY5MTI2MzE=","url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/labels/CLA%20Signed","name":"CLA Signed","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287/commits","review_comments_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287/comments","review_comment_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/287/comments","statuses_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/statuses/f608a615eda9246d99007db60357c371ca79105d","head":{"label":"hhugo:disable","ref":"disable","sha":"f608a615eda9246d99007db60357c371ca79105d","user":{"login":"hhugo","id":835209,"node_id":"MDQ6VXNlcjgzNTIwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/835209?v=4","gravatar_id":"","url":"https://api.github.com/users/hhugo","html_url":"https://github.com/hhugo","followers_url":"https://api.github.com/users/hhugo/followers","following_url":"https://api.github.com/users/hhugo/following{/other_user}","gists_url":"https://api.github.com/users/hhugo/gists{/gist_id}","starred_url":"https://api.github.com/users/hhugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhugo/subscriptions","organizations_url":"https://api.github.com/users/hhugo/orgs","repos_url":"https://api.github.com/users/hhugo/repos","events_url":"https://api.github.com/users/hhugo/events{/privacy}","received_events_url":"https://api.github.com/users/hhugo/received_events","type":"User","site_admin":false},"repo":{"id":126765007,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY3NjUwMDc=","name":"ocamlformat","full_name":"hhugo/ocamlformat","owner":{"login":"hhugo","id":835209,"node_id":"MDQ6VXNlcjgzNTIwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/835209?v=4","gravatar_id":"","url":"https://api.github.com/users/hhugo","html_url":"https://github.com/hhugo","followers_url":"https://api.github.com/users/hhugo/followers","following_url":"https://api.github.com/users/hhugo/following{/other_user}","gists_url":"https://api.github.com/users/hhugo/gists{/gist_id}","starred_url":"https://api.github.com/users/hhugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhugo/subscriptions","organizations_url":"https://api.github.com/users/hhugo/orgs","repos_url":"https://api.github.com/users/hhugo/repos","events_url":"https://api.github.com/users/hhugo/events{/privacy}","received_events_url":"https://api.github.com/users/hhugo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hhugo/ocamlformat","description":"Auto-formatter for OCaml code","fork":true,"url":"https://api.github.com/repos/hhugo/ocamlformat","forks_url":"https://api.github.com/repos/hhugo/ocamlformat/forks","keys_url":"https://api.github.com/repos/hhugo/ocamlformat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhugo/ocamlformat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhugo/ocamlformat/teams","hooks_url":"https://api.github.com/repos/hhugo/ocamlformat/hooks","issue_events_url":"https://api.github.com/repos/hhugo/ocamlformat/issues/events{/number}","events_url":"https://api.github.com/repos/hhugo/ocamlformat/events","assignees_url":"https://api.github.com/repos/hhugo/ocamlformat/assignees{/user}","branches_url":"https://api.github.com/repos/hhugo/ocamlformat/branches{/branch}","tags_url":"https://api.github.com/repos/hhugo/ocamlformat/tags","blobs_url":"https://api.github.com/repos/hhugo/ocamlformat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhugo/ocamlformat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhugo/ocamlformat/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhugo/ocamlformat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhugo/ocamlformat/statuses/{sha}","languages_url":"https://api.github.com/repos/hhugo/ocamlformat/languages","stargazers_url":"https://api.github.com/repos/hhugo/ocamlformat/stargazers","contributors_url":"https://api.github.com/repos/hhugo/ocamlformat/contributors","subscribers_url":"https://api.github.com/repos/hhugo/ocamlformat/subscribers","subscription_url":"https://api.github.com/repos/hhugo/ocamlformat/subscription","commits_url":"https://api.github.com/repos/hhugo/ocamlformat/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhugo/ocamlformat/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhugo/ocamlformat/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhugo/ocamlformat/issues/comments{/number}","contents_url":"https://api.github.com/repos/hhugo/ocamlformat/contents/{+path}","compare_url":"https://api.github.com/repos/hhugo/ocamlformat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhugo/ocamlformat/merges","archive_url":"https://api.github.com/repos/hhugo/ocamlformat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhugo/ocamlformat/downloads","issues_url":"https://api.github.com/repos/hhugo/ocamlformat/issues{/number}","pulls_url":"https://api.github.com/repos/hhugo/ocamlformat/pulls{/number}","milestones_url":"https://api.github.com/repos/hhugo/ocamlformat/milestones{/number}","notifications_url":"https://api.github.com/repos/hhugo/ocamlformat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhugo/ocamlformat/labels{/name}","releases_url":"https://api.github.com/repos/hhugo/ocamlformat/releases{/id}","deployments_url":"https://api.github.com/repos/hhugo/ocamlformat/deployments","created_at":"2018-03-26T02:52:22Z","updated_at":"2018-05-07T21:48:56Z","pushed_at":"2018-08-14T06:10:18Z","git_url":"git://github.com/hhugo/ocamlformat.git","ssh_url":"git@github.com:hhugo/ocamlformat.git","clone_url":"https://github.com/hhugo/ocamlformat.git","svn_url":"https://github.com/hhugo/ocamlformat","homepage":"","size":1291,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ocaml-ppx:master","ref":"master","sha":"c7dff8498bc5386a0b3db70f2254ab0d60f4dc58","user":{"login":"ocaml-ppx","id":31065556,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMDY1NTU2","avatar_url":"https://avatars2.githubusercontent.com/u/31065556?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml-ppx","html_url":"https://github.com/ocaml-ppx","followers_url":"https://api.github.com/users/ocaml-ppx/followers","following_url":"https://api.github.com/users/ocaml-ppx/following{/other_user}","gists_url":"https://api.github.com/users/ocaml-ppx/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml-ppx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml-ppx/subscriptions","organizations_url":"https://api.github.com/users/ocaml-ppx/orgs","repos_url":"https://api.github.com/users/ocaml-ppx/repos","events_url":"https://api.github.com/users/ocaml-ppx/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml-ppx/received_events","type":"Organization","site_admin":false},"repo":{"id":106263946,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYyNjM5NDY=","name":"ocamlformat","full_name":"ocaml-ppx/ocamlformat","owner":{"login":"ocaml-ppx","id":31065556,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMDY1NTU2","avatar_url":"https://avatars2.githubusercontent.com/u/31065556?v=4","gravatar_id":"","url":"https://api.github.com/users/ocaml-ppx","html_url":"https://github.com/ocaml-ppx","followers_url":"https://api.github.com/users/ocaml-ppx/followers","following_url":"https://api.github.com/users/ocaml-ppx/following{/other_user}","gists_url":"https://api.github.com/users/ocaml-ppx/gists{/gist_id}","starred_url":"https://api.github.com/users/ocaml-ppx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocaml-ppx/subscriptions","organizations_url":"https://api.github.com/users/ocaml-ppx/orgs","repos_url":"https://api.github.com/users/ocaml-ppx/repos","events_url":"https://api.github.com/users/ocaml-ppx/events{/privacy}","received_events_url":"https://api.github.com/users/ocaml-ppx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocaml-ppx/ocamlformat","description":"Auto-formatter for OCaml code","fork":false,"url":"https://api.github.com/repos/ocaml-ppx/ocamlformat","forks_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/forks","keys_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/teams","hooks_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/hooks","issue_events_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/events{/number}","events_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/events","assignees_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/assignees{/user}","branches_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/branches{/branch}","tags_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/tags","blobs_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/statuses/{sha}","languages_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/languages","stargazers_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/stargazers","contributors_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/contributors","subscribers_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/subscribers","subscription_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/subscription","commits_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/contents/{+path}","compare_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/merges","archive_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/downloads","issues_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues{/number}","pulls_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls{/number}","milestones_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/milestones{/number}","notifications_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/labels{/name}","releases_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/releases{/id}","deployments_url":"https://api.github.com/repos/ocaml-ppx/ocamlformat/deployments","created_at":"2017-10-09T09:34:08Z","updated_at":"2018-08-12T20:36:50Z","pushed_at":"2018-08-14T06:10:19Z","git_url":"git://github.com/ocaml-ppx/ocamlformat.git","ssh_url":"git@github.com:ocaml-ppx/ocamlformat.git","clone_url":"https://github.com/ocaml-ppx/ocamlformat.git","svn_url":"https://github.com/ocaml-ppx/ocamlformat","homepage":"","size":1270,"stargazers_count":158,"watchers_count":158,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":21,"open_issues":42,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287"},"html":{"href":"https://github.com/ocaml-ppx/ocamlformat/pull/287"},"issue":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/287"},"comments":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/issues/287/comments"},"review_comments":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287/comments"},"review_comment":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/pulls/287/commits"},"statuses":{"href":"https://api.github.com/repos/ocaml-ppx/ocamlformat/statuses/f608a615eda9246d99007db60357c371ca79105d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hhugo"}}