D-Programming-Language/druntime — pull request #729 by adamdruppe (2014-02-26 01:24:50+00:00)
Title: extendable hook for custom checks

This is something I've been talking about for a while and now want to see about getting merged. Pretty minor change in here, the idea is just to provide an easy hook for projects to build upon. See the comment in rtinfo.d for the idea.

I'm not sure if this is mergeable right now, I couldn't quite tell how the .di files are generated or the html for that matter, we'd want to link this in to the website somehow too. But since the new module is empty it doesn't actually have to be compiled. It just needs to be found so the import just works when the user doesn't want to use the new hook.

On the newsgroup, a potential problem was brought up with getting this to work with rdmd. We might want to patch it too so we can easily override the core.* namespace there too. But I consider that a rdmd enhancement request/bug which is separate from this.

With this we can do static assert to do custom lint style checks on code or static this() to do custom runtime reflection without needing to modify the user modules. Just write your custom set in your rtinfo.d file and add it to your project's build dependencies.