https://github.com/ashcrow/package-verify
Package verification tool
https://github.com/ashcrow/package-verify
Last synced: 2 months ago
JSON representation
Package verification tool
- Host: GitHub
- URL: https://github.com/ashcrow/package-verify
- Owner: ashcrow
- License: gpl-3.0
- Created: 2014-01-20T19:34:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-23T18:50:08.000Z (over 11 years ago)
- Last Synced: 2025-02-13T18:34:55.242Z (4 months ago)
- Language: Python
- Size: 168 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
package-verify
==============Package verification tool which will be renamed at some point.
Usage
-----
```
usage: package-verify [-h] [-q] [-V {devspec}] manifestpositional arguments:
manifest The manifest file to validate.optional arguments:
-h, --help show this help message and exit
-q, --quiet Goes silent. Success/failure is only noted in the
return code.
-V {devspec}, --validator {devspec}
Select a specific validator to use.
```Example Output
--------------
*Pass Examples*
```
$ package-verify pass.json
$ echo $?
0
$
``````
$ package-verify -q pass.json
$ echo $?
0
$
```*Failure Examples*
```
$ package-verify fail.json
E: name is missing
E: files is missing
$ echo $?
1
$
``````
$ package-verify -q fail.json
$ echo $?
1
$
```Making a Validator
------------------
To make a validator follow these rules:* subclass package\_verify.validator.\_Validator
* name the subclass *Validator*
* implement the validate method
* place the file in package\_verify.validator.validators so it can be found for listing and loading```python
# filename: testvalidator.pyfrom package_verify.validator import error, _Validator
class Validator(_Validator):
def validate(self, data):
"""
Validates input data.:param str data: String of info to validate.
:raises WrongFormatError: if the format is not useable
:rtype: tuple
:returns: Warnings and errors
"""
# Do stuff here
return (warnings_list, errors_list)
```