Skip to content

Commit

Permalink
Provision lint warning for having plugins named opam-* on 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Oct 19, 2015
1 parent 3f2cbba commit f7ad158
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/format/opamFile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,16 @@ module X = struct
(OpamVersion.compare t.opam_version (OpamVersion.of_string "1.3") >= 0 &&
List.exists (function Atom _ -> false | _ -> true) @@
OpamFormula.(ors_to_list (to_atom_formula t.conflicts)));
cond 44 `Warning
"The 'plugin' package flag is set but the package name doesn't \
begin with 'opam-'"
(OpamVersion.compare t.opam_version (OpamVersion.of_string "1.3") >= 0 &&
List.mem Pkgflag_Plugin t.flags &&
match t.name with
| None -> false
| Some name ->
OpamStd.String.starts_with ~prefix:"opam-"
(OpamPackage.Name.to_string name));
]
in
OpamStd.List.filter_map (fun x -> x) warnings
Expand Down

0 comments on commit f7ad158

Please sign in to comment.