Initial Cross Platform Work
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
import subprocess
|
||||
import glob
|
||||
from pathlib import Path
|
||||
# Format script
|
||||
|
||||
def fmt_file(path):
|
||||
if Path(path).is_dir():
|
||||
return # Skip
|
||||
try:
|
||||
subprocess.run(['clang-format', '-i', path, '--style=Google'], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print('Error for ' + Path(path).stem + ': ' + e)
|
||||
|
||||
def fmt_dir(path):
|
||||
sources = glob.glob(path+'/*')
|
||||
for file in sources:
|
||||
fmt_file(file)
|
||||
|
||||
print('Formatting...')
|
||||
fmt_dir('source/base')
|
||||
fmt_dir('source/drivers')
|
||||
fmt_dir('include')
|
||||
fmt_dir('include/pd/base')
|
||||
fmt_dir('include/pd/app')
|
||||
fmt_dir('include/pd/drivers')
|
||||
fmt_dir('include/pd/gfx')
|
||||
|
||||
import subprocess
|
||||
import glob
|
||||
from pathlib import Path
|
||||
# Format script
|
||||
|
||||
def fmt_file(path):
|
||||
if Path(path).is_dir():
|
||||
return # Skip
|
||||
try:
|
||||
subprocess.run(['clang-format', '-i', path, '--style=Google'], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print('Error for ' + Path(path).stem + ': ' + e)
|
||||
|
||||
def fmt_dir(path):
|
||||
sources = glob.glob(path+'/*')
|
||||
for file in sources:
|
||||
fmt_file(file)
|
||||
|
||||
print('Formatting...')
|
||||
fmt_dir('source/base')
|
||||
fmt_dir('source/drivers')
|
||||
fmt_dir('include')
|
||||
fmt_dir('include/pd/base')
|
||||
fmt_dir('include/pd/app')
|
||||
fmt_dir('include/pd/drivers')
|
||||
fmt_dir('include/pd/gfx')
|
||||
|
||||
print('Done')
|
Reference in New Issue
Block a user