@@ -11,6 +11,12 @@ class Missing:
1111 RE_TEST_PY = re .compile (r'test.*?\.py' )
1212
1313 def __init__ (self , exclude ):
14+ if not (isinstance (exclude , list ) or isinstance (exclude , tuple )):
15+ raise TypeError ('exclude should be list or tuple' )
16+
17+ # append .git to exclude folder
18+ exclude = set (['.git' , * exclude ])
19+
1420 # normalize a pathname by collapsing redundant separators
1521 self ._exclude = [os .path .normpath (path ) for path in exclude ]
1622
@@ -73,7 +79,7 @@ def _find_for_unittest(self, basedir: Optional[str] = None) -> bool:
7379
7480def main () -> int :
7581 parser = argparse .ArgumentParser (description = 'Find the missing but necessary files' )
76- parser .add_argument ('-e' , '--exclude' , type = list , default = [ '.git' ] , help = 'exclude the file or folder' )
82+ parser .add_argument ('-e' , '--exclude' , nargs = '*' , help = 'exclude the file or folder' )
7783 parser .add_argument ('-q' , '--quite' , action = 'store_true' , default = False , help = 'disable all log' )
7884 args = parser .parse_args ()
7985
@@ -85,7 +91,7 @@ def main() -> int:
8591 handler = logging .StreamHandler ()
8692 logger .addHandler (handler )
8793
88- missing = Missing (args .exclude )
94+ missing = Missing (args .exclude or [] )
8995 return missing .run ()
9096
9197if __name__ == '__main__' :
0 commit comments