style: Add options to select checkers and apply fixes
Review Request #3648 - Created Oct. 7, 2016 and submitted
| Information | |
|---|---|
| Andreas Sandberg | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11669:258c76f88f24 --------------------------- style: Add options to select checkers and apply fixes Add an option, --checker/-c, to style.py that selects individual style checkers to apply. When this option isn't specified, the script defaults to all available style checkers. The option may be specified multiple times to run multiple style checkers. The option, --fix/-f, can be specified to automatically fix style violations. Change-Id: Id7597fba6b65cecfa17a88b1c87c8a4c8315af59 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Minor thing below, but other than that it looks good.
-
util/style.py (Diff revision 1) -
I'm going to be picky here... Can you change this to the below so you don't have the awkward newline when printing the help text.
help="Style checkers to run. Can be specified " "multiple times."
Do you think it's worthwhile to adopt a more detailed organization for headers?
Currently, we have this:
1) primary header (foo.hh for foo.cc)
2) mix of C/C++ headers alphabetically ordered
3) project headers alphabetically orderedShould we move to something like the Google Style Guide's ruleset? https://google.github.io/styleguide/cppguide.html
It looks like this:
1) dir2/foo2.h.
2) C system files.
3) C++ system files.
4) Other libraries' .h files.
5) Your project's .h files.Having the primary header on top is useful, but I do not know what the other ordering provides or that it protects us against anything. It does provide more organization so that it's easier to identify an include if you happen to glance up at the header sections, but that seems minor and probably isn't their justification. Does anyone else have thoughts on the topic?
