Commit graph

8 commits

Author SHA1 Message Date
Andreas Sandberg 2580fcd9d7 style: Refactor the style checker as a Python package
Refactor the style checker into a Python module that can be reused by
command line tools that integrate with git. In particular:

  * Create a style package in util
  * Move style validators from style.py to the style/validators.py.
  * Move style verifiers from style.py to the style/verifiers.py.
  * Move utility functions (sort_includes, region handling,
    file_types) into the style package
  * Move generic code from style.py to style/style.py.

Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>

--HG--
rename : util/style.py => util/hgstyle.py
rename : util/sort_includes.py => util/style/sort_includes.py
extra : rebase_source : ad6cf9b9a18c48350dfc7b7c77bea6c5344fb53c
2016-03-30 15:30:32 +01:00
Nathan Binkert 155470900a copyright: add copyright missing from files I created 2016-03-28 21:42:46 -07:00
Brad Beckmann 9560893f0d util: added .cl OpenCL extension to file_type.py 2015-07-20 09:15:18 -05:00
Brad Beckmann d87fe7b3f4 util: added .mk makefile extension to file_types.py 2015-07-20 09:15:18 -05:00
Nathan Binkert a2889ef16d file_types: Make code work in Python 2.4 2011-04-17 13:57:03 -07:00
Nathan Binkert e5ecfde222 util: python implementation of a routine that will sort includes
I didn't realize that the perl version existed when I started this,
this version has a lot more features than the previous one since it will
sort and separate python, system, and m5 headers in separate groups, it
will remove duplicates, it will also convert c headers to stl headers
2011-04-15 10:43:06 -07:00
Nathan Binkert 326adda5f3 util: fix the language type function 2011-04-13 09:32:17 -07:00
Nathan Binkert fe6574ecc0 style: make style hook work with pre-qrefresh and update to use new code
clean up the code a little bit while we're at it.

I recommend that everyone adds the pre-qrefresh hook below since it
will make qref run the style hook and not just commit/qpush

[extensions]
style = <m5 path>/util/style.py

[hooks]
pretxncommit.style = python:style.check_whitespace
pre-qrefresh.style = python:style.check_whitespace
2010-12-30 12:53:56 -05:00