Merge lp://staging/~jcsackett/charm-tools/libify-proof into lp://staging/~charmers/charm-tools/trunk
Status: | Superseded |
---|---|
Proposed branch: | lp://staging/~jcsackett/charm-tools/libify-proof |
Merge into: | lp://staging/~charmers/charm-tools/trunk |
Diff against target: |
651 lines (+348/-289) 2 files modified
scripts/lib/proof.py (+339/-0) scripts/proof (+9/-289) |
To merge this branch: | bzr merge lp://staging/~jcsackett/charm-tools/libify-proof |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juan L. Negron (community) | Approve | ||
Mark Mims (community) | Approve | ||
Review via email: mp+143785@code.staging.launchpad.net |
This proposal has been superseded by a proposal from 2013-01-18.
Description of the change
Make charm proof code importable elsewhere
For charmworld we need to be able to run the charm proof code without forking
out to subprocess. To do this, we need a more useable version of the proof
code.
* Added a lib folder within scripts that contains proof.py and __init__.py; in
short, it's a simple module.
* Moved the code in script/proof to script/lib/proof.py
* Broke the code into functions handling CLI argument parsing and actual
linting.
* Updated the set of printed error messages into a globally collect LINT
array. A global is less than ideal in this instance, but doing otherwise would
require further re-architecting of the code, and isn't of high value given
globals are already in play.
* Updated the error methods to simply add to the global LINT var. In places
where crit is called, which expects sys.exit, the run method simply returns,
ending further execution.
* Updated script/proof to import the proof code in lib. It then joins the
returned array and outputs to stdout, per the original script, and exits with
the global EXIT_CODE from lib.proof
Reviewers: mp+143785_ code.launchpad. net,
Message:
Please take a look.
Description:
Make charm proof code importable elsewhere
For charmworld we need to be able to run the charm proof code without
forking
out to subprocess. To do this, we need a more useable version of the
proof
code.
* Added a lib folder within scripts that contains proof.py and
__init__.py; in
short, it's a simple module.
* Moved the code in script/proof to script/lib/proof.py
* Broke the code into functions handling CLI argument parsing and actual
linting.
* Updated the set of printed error messages into a globally collect LINT
array. A global is less than ideal in this instance, but doing otherwise
would
require further re-architecting of the code, and isn't of high value
given
globals are already in play.
* Updated the error methods to simply add to the global LINT var. In
places
where crit is called, which expects sys.exit, the run method simply
returns,
ending further execution.
* Updated script/proof to import the proof code in lib. It then joins
the
returned array and outputs to stdout, per the original script, and exits
with
the global EXIT_CODE from lib.proof
https:/ /code.launchpad .net/~jcsackett /charm- tools/libify- proof/+ merge/143785
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/7133054/
Affected files: lib/__init_ _.py lib/proof. py
A [revision details]
A scripts/
A scripts/
M scripts/proof