diff options
Diffstat (limited to 'numpydoc/__main__.py')
-rw-r--r-- | numpydoc/__main__.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/numpydoc/__main__.py b/numpydoc/__main__.py index f342cc3..4a50da9 100644 --- a/numpydoc/__main__.py +++ b/numpydoc/__main__.py @@ -12,8 +12,7 @@ from .validate import validate, Validator def render_object(import_path, config=None): """Test numpydoc docstring generation for a given object""" # TODO: Move Validator._load_obj to a better place than validate - print(get_doc_object(Validator._load_obj(import_path), - config=dict(config or []))) + print(get_doc_object(Validator._load_obj(import_path), config=dict(config or []))) return 0 @@ -22,25 +21,30 @@ def validate_object(import_path): results = validate(import_path) for err_code, err_desc in results["errors"]: exit_status += 1 - print(':'.join([import_path, err_code, err_desc])) + print(":".join([import_path, err_code, err_desc])) return exit_status -if __name__ == '__main__': +if __name__ == "__main__": ap = argparse.ArgumentParser(description=__doc__) - ap.add_argument('import_path', help='e.g. numpy.ndarray') + ap.add_argument("import_path", help="e.g. numpy.ndarray") def _parse_config(s): - key, _, value = s.partition('=') + key, _, value = s.partition("=") value = ast.literal_eval(value) return key, value - ap.add_argument('-c', '--config', type=_parse_config, - action='append', - help='key=val where val will be parsed by literal_eval, ' - 'e.g. -c use_plots=True. Multiple -c can be used.') - ap.add_argument('--validate', action='store_true', - help='validate the object and report errors') + ap.add_argument( + "-c", + "--config", + type=_parse_config, + action="append", + help="key=val where val will be parsed by literal_eval, " + "e.g. -c use_plots=True. Multiple -c can be used.", + ) + ap.add_argument( + "--validate", action="store_true", help="validate the object and report errors" + ) args = ap.parse_args() if args.validate: |