We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c77cc9 commit c01de65Copy full SHA for c01de65
1 file changed
code_counting/util.py
@@ -24,14 +24,19 @@ def count_lines_of_code(file):
24
25
def explore_folder(root, files):
26
27
+ # If root is not a folder, add it to the files list
28
+ # Base case
29
if not os.path.isdir(root):
30
logging.debug('\tAdd {} to files list'.format(root))
31
files.append(root)
32
+ return files
33
- if os.path.isdir(root):
34
+ # If root is a folder, explore the folder and call itself (explore_folder function)
35
+ # Recursive case
36
+ elif os.path.isdir(root):
37
logging.debug('\t{} is a dir, expanding:'.format(root))
38
for f in os.listdir(root):
39
logging.debug('\tExploring {}'.format(f))
40
explore_folder(os.path.join(root, f), files)
41
- return files
42
0 commit comments