Merge lp://staging/~kissiel/checkbox/validation-rework into lp://staging/checkbox
Proposed by
Maciej Kisielewski
Status: | Merged |
---|---|
Approved by: | Sylvain Pineau |
Approved revision: | 4514 |
Merged at revision: | 4511 |
Proposed branch: | lp://staging/~kissiel/checkbox/validation-rework |
Merge into: | lp://staging/checkbox |
Diff against target: |
969 lines (+222/-242) 12 files modified
plainbox/plainbox/impl/unit/category.py (+6/-22) plainbox/plainbox/impl/unit/concrete_validators.py (+57/-0) plainbox/plainbox/impl/unit/exporter.py (+12/-22) plainbox/plainbox/impl/unit/file.py (+2/-7) plainbox/plainbox/impl/unit/job.py (+48/-72) plainbox/plainbox/impl/unit/manifest.py (+11/-14) plainbox/plainbox/impl/unit/packaging.py (+6/-6) plainbox/plainbox/impl/unit/template.py (+8/-8) plainbox/plainbox/impl/unit/testplan.py (+21/-32) plainbox/plainbox/impl/unit/unit.py (+14/-47) plainbox/plainbox/impl/unit/unit_with_id.py (+7/-12) plainbox/plainbox/impl/unit/validators.py (+30/-0) |
To merge this branch: | bzr merge lp://staging/~kissiel/checkbox/validation-rework |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sylvain Pineau (community) | Approve | ||
Review via email: mp+307082@code.staging.launchpad.net |
Description of the change
This MR refactors validation a bit. Three goals achieved here:
1) readability improvements (my opinion)
2) better performance (every plainbox invocation runs validation, the code on this branch runs a few percent faster)
3) less code!
4) more in line with zen of python
Important change here is what field_validators are. Previously this could have been an instance of a validator, a type of a validator or list of any of the above. This branch makes it instance-only.
In terms of testing, there should be no tangible changes in how *boxes work.
To post a comment you must log in.
Great stuff!
Just one question, see below, but applicable to all remaining PresentFieldVal idator( severity= Severity. advice) .