Skip to content

Commit 0abd519

Browse files
committed
Treat c, cpp, and assembly as if they are also object files
1 parent 9b187dc commit 0abd519

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/git_hooks/find_duplicates.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from os import walk
2-
from os.path import join, abspath, dirname, basename
2+
from os.path import join, abspath, dirname, basename, splitext
33
import sys
44

55
ROOT = abspath(join(dirname(__file__), "..", ".."))
@@ -26,6 +26,12 @@
2626
for file in r.c_sources + r.s_sources + r.cpp_sources + r.objects + r.libraries + r.hex_files + r.bin_files:
2727
scanned_files.setdefault(basename(file), [])
2828
scanned_files[basename(file)].append(file)
29+
filenameparts = splitext(file)
30+
if filenameparts[-1] in ["c", "cpp", "s", "S"]:
31+
filenameparts[-1] = "o"
32+
file = ".".join(filenamparts)
33+
scanned_files.setdefault(basename(file), [])
34+
scanned_files[basename(file)].append(file)
2935

3036
count_dupe = 0
3137
for key, value in scanned_files.iteritems():

0 commit comments

Comments
 (0)