> So how is this supposed to work? Seems like there's a lot of cruft that > should either be fixed or deleted. I'm not sure what's deprecated vs. just > broken though. Nate?
Stuff that doesn't work is probably broken. All of it followed the style guide and initially, it was simply a standalone thing, but then I added support for mercurial hooks though the mechanism for hooks changed over time, so there was breakage in some versions which may not have been fixed. In particular, the interaction with mercurial queues has changed over time. The hardes part about the hook was that I tried to only complain about lines that were actually changed or added so that you don't get blamed for stuff someone else did. I think it could still be useful, but it does need work if it is to work on a wider range of versions of hg. > # pushing a patch with bad whitespace among other things (see bottom)... > the style hook catches one of the errors > % hg qpush > applying style-test > invalid whitespace in /home/stever/hg/amd/hsa/gem5/src/mem/packet.cc:58 > (a)bort, (i)gnore, or (f)ix? i > now at: style-test > % hg m5style packet.cc > # nada... like everything's OK when it's not > % hg m5format packet.cc > hg m5format: invalid arguments > hg m5format [FILE]... m5style is what is actually run on a commit (or it used to be). m5format was a place where I could test more significant style checks, but wasn't comfortable getting them to run at commit. > % python ../../util/style.py help > ../../util/style.py fixwhite [-t <tabsize> ] <path> [...] > ../../util/style.py chkwhite <path> [...] > ../../util/style.py chkformat <path> [...] This is what I used to use before I hooked all of the commands into mercurial. This should be easy to fix. It's basically just a different entry mechanism into the code path. > # but only the whitespace problem is found by the style hook That is currently the only thing that I think is enabled. There is support for a little bit more, but it's not in the hook. I definitely don't have time to work on it, so if you want to get rid of it, I won't stand in your way. A better mechanism might be to try to enable google's c++ lint instead (though you'll have to do a lot of work to tell it not to emit certain errors and to change it's notion of style. We picked the google style guide here specifically so we could easily run lint (and so there'd be no arguments). Nate _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
