mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
some fix
This commit is contained in:
parent
7d3bb3480a
commit
f3148ac206
4
.clang-format
Normal file
4
.clang-format
Normal file
@ -0,0 +1,4 @@
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 4
|
||||
UseTab: Never
|
21
scripts/format.py
Normal file
21
scripts/format.py
Normal file
@ -0,0 +1,21 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def get_all_files(root: str):
|
||||
for path, _, files in os.walk(root):
|
||||
for file in files:
|
||||
fullpath = os.path.join(path, file)
|
||||
# ignore some files
|
||||
if fullpath.startswith('include/pybind11'):
|
||||
continue
|
||||
if file.startswith('_'):
|
||||
continue
|
||||
if not file.endswith('.cpp') and not file.endswith('.h') and not file.endswith('.hpp'):
|
||||
continue
|
||||
yield fullpath
|
||||
|
||||
if __name__ == '__main__':
|
||||
files = list(get_all_files('src'))
|
||||
files.extend(get_all_files('src2'))
|
||||
files.extend(get_all_files('include'))
|
||||
subprocess.run(['clang-format-15', '-i'] + files, check=True)
|
Loading…
x
Reference in New Issue
Block a user