Files
MMKV/Script/formatCode.py
T
2019-12-16 21:29:25 +08:00

16 lines
662 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path
path = os.getcwd()
for root, dirs, files in os.walk(path):
if root.endswith("/openssl") or root.endswith("/zlib") or (root.find("/build/generated/") != -1) or (root.find("cmake-build-debug/") != -1) or (root.find("cmake-build-release") != -1) or (root.find("CMakeFiles") != -1):
continue
for name in files:
if (name.endswith(".h") or name.endswith(".m") or name.endswith(".mm") or name.endswith(".hpp") or name.endswith(".cpp") or name.endswith(".java")):
localpath = root + '/' + name
print localpath
os.system("clang-format -i %s -style=File" %(localpath))