From fc5b09277950835add09452120a6df29e3253216 Mon Sep 17 00:00:00 2001 From: Artem Pianykh Date: Wed, 11 Mar 2020 05:57:05 -0700 Subject: [PATCH] [lint] Update checkCopyright to handle sexp dune files Summary: With plain/sexp dune files we need to support lisp style comments in checkCopyright Reviewed By: jvillard Differential Revision: D20366314 fbshipit-source-id: 04db9e3c1 --- infer/src/scripts/checkCopyright.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/infer/src/scripts/checkCopyright.ml b/infer/src/scripts/checkCopyright.ml index e692b7eca44..689e8ff765a 100644 --- a/infer/src/scripts/checkCopyright.ml +++ b/infer/src/scripts/checkCopyright.ml @@ -41,9 +41,12 @@ let comment_style_python = Line ("#", false) let comment_style_shell = Line ("#", true) +let comment_style_lisp = Line (";", false) + let comment_styles_lang = [ (comment_style_al, "AL") ; (comment_style_c, "C") + ; (comment_style_lisp, "Lisp") ; (comment_style_llvm, "LLVM") ; (comment_style_m4, "M4") ; (comment_style_make, "Makefile") @@ -241,10 +244,15 @@ let com_style_of_lang = ; (".re", comment_style_c) ; (".rei", comment_style_c) ; (".sh", comment_style_shell) + ; ("dune", comment_style_lisp) ; ("dune.in", comment_style_ocaml) + ; ("dune.common", comment_style_lisp) ; ("dune.common.in", comment_style_ocaml) + ; ("dune-common", comment_style_lisp) ; ("dune-common.in", comment_style_ocaml) - ; ("dune-workspace.in", comment_style_llvm) + ; ("dune-project", comment_style_lisp) + ; ("dune-workspace", comment_style_lisp) + ; ("dune-workspace.in", comment_style_lisp) ; ("Makefile", comment_style_make) ]