lint for D

Bruce Adams tortoise_74 at yeah.who.co.uk
Wed Jul 9 17:42:17 PDT 2008


Hi all,
        Alas this is not an announcement. It should be relatively easy to  
knock up a few noddy scripts that can detect some kinds
of potential problem. I occasionally find myself doing this for coding  
standard related things. The unused variable warning thing
would seem to be a good start. How about writing a lint tool that starts  
with that as its only requirement and going forward from
there? Unfortunately I don't have much time to work with D at the moment  
or I'd cobble something together. Maybe if the community
is still waiting in 6 months time.
   My biggest worry for linting D is CTFE and especially mixins. You have  
the same problem here as with macros in C. You cannot spot
potential problems until you have pre-processed the code. This is going to  
make it hard for any lint to get a toehold on D without
having a fully fledged front-end to start with. We already have several of  
these to hand. Even so I'm sure there are things that
could be picked up with a few clever greps and filters just to get the  
ball rolling.
May I further suggest that any potential writers of such tools take a look  
at Gimpel lint for some ideas on how to do lint comments.
In D it might be worth thinking about using custom pragmas instead (or as  
well) as an alternative to polluting the comment namespace
(which will soon get crowded with Doxygen and whatever else you want to  
throw in).
Any thoughts?

Regards,

Bruce.



More information about the Digitalmars-d mailing list