Development mbed library for MAX32630FTHR
Dependents: blinky_max32630fthr
Diff: tools/git_hooks/find_duplicates.py
- Revision:
- 0:5c4d7b2438d3
diff -r 000000000000 -r 5c4d7b2438d3 tools/git_hooks/find_duplicates.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/git_hooks/find_duplicates.py Fri Nov 11 20:59:50 2016 +0000 @@ -0,0 +1,26 @@ +from os import walk +from os.path import join, abspath, dirname, basename, splitext +import sys + +ROOT = abspath(join(dirname(__file__), "..", "..")) +sys.path.insert(0, ROOT) + +from tools.toolchains.gcc import GCC_ARM +from tools.targets import TARGET_MAP +from argparse import ArgumentParser + +if __name__ == "__main__": + parser = ArgumentParser("Find duplicate file names within a directory structure") + parser.add_argument("dirs", help="Directories to search for duplicate file names" + , nargs="*") + parser.add_argument("--silent", help="Supress printing of filenames, just return number of duplicates", action="store_true") + args = parser.parse_args() + + toolchain = GCC_ARM(TARGET_MAP["K64F"]) + + resources = sum([toolchain.scan_resources(d) for d in args.dirs], None) + + scanned_files = {} + + exit(resources.detect_duplicates(toolchain)) +