Repository: pddg/uroboros

Issue:
Use `return` not `raise` in Option.validate
If the validate function is not overwritten, it rases following exception.
```sh
Traceback (most recent call last):
  File "examples/main.py", line 310, in <module>
    exit_code = root_cmd.execute()
  File "/home/pudding/.local/share/virtualenvs/hoger-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 67, in execute
    exceptions = self._validate_all(args, commands)
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 281, in _validate_all
    exceptions.extend(cmd.validate(args))
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 292, in validate
    exceptions.extend(opt.validate(args))
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/option.py", line 30, in validate
    raise []
TypeError: exceptions must derive from BaseException
```

Discussion:

Patch:
diff --git a/uroboros/option.py b/uroboros/option.py
index 03975ff..65bf35f 100644
--- a/uroboros/option.py
+++ b/uroboros/option.py
@@ -27,7 +27,7 @@ class Option(metaclass=abc.ABCMeta):
         return unsafe_args
 
     def validate(self, args: 'argparse.Namespace') -> 'List[Exception]':
-        raise []
+        return []
 
     def after_validate(self,
                        safe_args: 'argparse.Namespace'


Test patch:
diff --git a/tests/test_option.py b/tests/test_option.py
index 67b0751..00e2a24 100644
--- a/tests/test_option.py
+++ b/tests/test_option.py
@@ -57,6 +57,13 @@ class NoHookOption(uroboros.Option):
 
 class TestOption(object):
 
+    def test_validate(self):
+        args = argparse.Namespace()
+        nohook = NoHookOption()
+        actual = nohook.validate(args)
+        assert type(actual) == list
+        assert len(actual) == 0
+
     def test_no_before_validate(self):
         args = argparse.Namespace()
         nohook = NoHookOption()