Hi folks,

I recently noticed that there have been quite a few style issues creeping
into the code base... space at the end of lines, no space after
if/while/for, etc.

As a result I started digging into the style checker script (util/style.py)
to see why that's not catching things.  I found that the style hook wasn't
actually checking for spaces after if/while/for, so I added that feature
(see http://reviews.gem5.org/r/3299).  However, it does check for
whitespace issues (such as space at the end of lines), but that's been
creeping into the codebase anyway.  Does anyone know how that's happening?
Is the style hook not catching these errors, or are people ignoring them?
What else can we do to have the style script run more reliably/regularly?

Note that the patch above also refactors things a little bit so it should
be easier to add more verifiers.  It would be nice to clean this script up
further, but I wanted to gather some input before putting more time into
it.  In that vein, I have a couple of questions:

- There's currently an 'hg m5format' command in addition to the 'hg
m5style' command.  Is there any point in maintaining both of these?
Strangely enough they are independent functions.  Prior to my patch, only
m5format checked spaces after if/for/while.  After my patch, I think the
only thing that m5format checks that m5style doesn't is line length.
Unless there's a reason to keep it, I'd like to get rid of m5format.

-  There's also a bunch of code at the bottom of style.py to allow you to
run it directly as a python script (and not just as a mercurial plug-in).
However, as far I can tell, most if not all of that code is broken.  Is
there really a need to maintain this?  I can see where it would be nice, so
I'd definitely keep it if it worked, but at this point I'd rather just
delete it than have to fix it.

Thanks,

Steve
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to