#
13540:da30e62884ee |
|
10-Jan-2019 |
Andrea Mondelli <andrea.mondelli@ucf.edu> |
misc: updated shabang for python script
The default python on MacOS doesn’t have an alias to python2. The official python version supported in gem5 is Python2.7.
This patch updates the shabang according to the version required in gem5.
Change-Id: I9533c0f7858b5b3cab0ef101be1ee5cd718105b0 Reviewed-on: https://gem5-review.googlesource.com/c/15375 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
|
#
11828:36b064696175 |
|
10-Feb-2017 |
Jason Lowe-Power <jason@lowepower.com> |
misc: Update #!env calls for python to explicit version
In some newer Linux distributions, env python default to Python 3.0. This patch explicitly uses "python2" instead of just "python" for all scripts that use #!
Reported-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
|
#
11410:e51095583654 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Change maximum line length to 79 characters
The old style guide used to mandate 78 characters as the maximum line length to accommodate traditional diffs on 80-column terminals. This is an uncommon use case and it has therefore been decided (see email thread on gem5-dev [1]) that a maximum length of 79-characters makes more sense.
[1] http://comments.gmane.org/gmane.comp.emulators.m5.devel/29789
Signed-off-by: Andreas Sandberg <aandreas.sandberg@arm.com> Reviewed-by: Brandon Potter <brandon.potter@amd.com>
|
#
11409:72f80dd8b194 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Add a style checker that doesn't depend on Mercurial
The current style checker script, hgstyle.py, assumes that it is being run from Mercurial. This means that it depends on the Mercurial Python libraries, which aren't necessarily present if using git. This changeset adds a new style checker script, style.py, that has been designed to be run from the command line.
The script has support for detecting which revision control system is used and is able to query both git and Mercurial for changes. This enables the script to operate on modified regions and/or all of the modified files in the repository.
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>
|
#
11408:cb18b6551499 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
scons: Automatically install the git style hook
Add a check in the main SConscript that installs the git pre-commit hook in util/ if git is used.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> [andreas.sandberg@arm.com: Cleanups suggested by Steve] Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>
|
#
11407:e6cc41b0a03c |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Add a git pre-commit hook
Add a git pre-commit hook that verifies that files that are about to be committed. Since git stages changes into an index and the index contains the changes that will be committed, the style checker only looks at the state of files in the index.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>
|
#
11406:dd204e5baba7 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Add repository helper functions
Add an AbstractRepo class and implementations for git and Mercurial that provide a common interface to query repository status for style checkers. The class defines the interfaces to list modified files that are about to be committed and methods to identify changed regions.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>
|
#
11405:bcec568e403c |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Remove style validators
Style validators provide a subset of the style verifier functionality and are only exposed through the "hg m5format" command. This functionality seems to be both redundant and unused.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
|
#
11404:72b399971cbc |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Add a control character checker
Add a style checker that verifies that source code doesn't contain non-printable (control) characters. The only allowed control characters are:
* 0x0a / \n: New line * 0x09 / \t: Tab (the whitespace checker enforces no-tabs for C/C++ files)
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Brandon Potter <brandon.potter@amd.com>
|
#
11403:e8949ea6961f |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
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>
|
#
11402:ac9e1a3bed79 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
style: Change include sorter to yield one line at a time
The include sorter class normally yields one string per line and relies on the caller to merge lines into a block of text separated by newlines. However, there are cases when this isn't true. This makes diffing using Python's difflib hard. This changeset updates the include sorter to never do this and always yield one line at a time.
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>
|
#
11401:55f9a21e34b4 |
|
30-Mar-2016 |
Andreas Sandberg <andreas.sandberg@arm.com> |
scons, style: Rename style.py to hgstyle.py
The Mercurial style checker extensions are currently stored in style.py. This is not ideal since they won't work with other version control systems. This changeset renames style.py to hgstyle.py and adds upgrade code to scons that automatically updates the hooks in hgrc.
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-by: Nathanael Premillieu <nathananel.premillieu@arm.com> Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>
|