util: clean up and extend style checker
Review Request #3299 - Created Jan. 26, 2016 and submitted
Information | |
---|---|
Steve Reinhardt | |
gem5 | |
default | |
Reviewers | |
Default | |
Changeset 11311:8d2efdba4dae --------------------------- util: clean up and extend style checker Added a new Verifier object to check for and fix spacing between if/while/for and following paren. Restructured Verifier class to make it easier to add new subclasses, particularly by using a global list of verifiers to auto-generate command line options and simplify the invocation loop.
Looks good to me. A couple of minor issues below.
-
util/style.py (Diff revision 1) -
IIRC, the Python style guide (PEP-0008) prescribes that opening and closing brackets for multi-line lists should be on their own lines.
-
util/style.py (Diff revision 1) -
-f probably shouldn't be short for --ign-all.
Also, could you rename these to --ignore-XX instead of --ign-XX? It's slightly longer, but would be closer to the naming convention for other (HG) options.
Review request changed
Updated (Jan. 29, 2016, 11:27 a.m.)
Change Summary:
- Addressed Andreas's issues
- Added -skip-<check> options to skip specific checks entirely
- Made check-specific options have precedence over -all options
- Added comments/docstrings
Diff: |
Revision 2 (+153 -45) |
---|
Ship It!
Ship It!