-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscanner.py
More file actions
43 lines (31 loc) · 763 Bytes
/
Copy pathscanner.py
File metadata and controls
43 lines (31 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
SUPPORTED_EXTENSIONS = {
".py",
".html",
".css",
".js",
".cpp",
".c",
".java",
".txt",
".md"
}
def scan_project(folder):
collected = []
for root, dirs, files in os.walk(folder):
dirs[:] = [
d for d in dirs
if d not in {
".git",
"__pycache__",
"venv",
".venv",
"node_modules"
}
]
for file in files:
extension = os.path.splitext(file)[1]
if extension in SUPPORTED_EXTENSIONS:
full_path = os.path.join(root, file)
collected.append(full_path)
return collected