ocaml-opam / Camelus

Bot posting reports on opam-repository pull-request using a web hook
Other
18 stars 9 forks source link

Warn on unbound variable reference #8

Open dsheets opened 8 years ago

dsheets commented 8 years ago

If a typo is made to a built-in variable name like writing or instead of os, Camelus does not warn about it. It should be possible to declare the set of bound-or-potentially-bound variables and have warnings emitted if variables from outside that set are used.

AltGr commented 8 years ago

Packages can actually define variables at install time, so this is difficult, at least for package-qualified variables %{pkg:var}%.

On the next branch of opam, compilers (which are packages), can export variables to the global namespaces (e.g. ocaml-version, which is largely used in packages) ;

However, the repository should define a set of variables that are required to be defined by any compiler. This once again shows the need for having both the built-in, repository-independent opam lint rules and repository-specific rules. Camelus should, obviously, be configurable to enforce the repository rules.