upenn-cis1xx / camelot

A fully-modular OCaml style linter
https://opam.ocaml.org/packages/camelot/
Apache License 2.0
44 stars 5 forks source link

Feature: print as json #67

Closed esinx closed 3 years ago

esinx commented 3 years ago

This pull request resolves #66 (I know, I opened the issue and I ended up resolving it 😅)

I've added yojson to lib/report/dune so that the utility function json_of_hint and the new display function json_display under lib/report/display.ml can access the Yojson library.

I've also modified the flag matching in bin/camelot.ml to include "json" in the "-show" option so that Display.json_display can be called accordingly.

Let me know if other edits should be made!