mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 15:04:31 +00:00
Check format: only check modified files, v2 (#1680)
* Check format: only check modified files, v2 * cheeky z_play edit * format * rename z_play.c -> z_play_.c * Revert "rename z_play.c -> z_play_.c" This reverts commit9da9e76309
. * rm z_moji.c * Revert "rm z_moji.c" This reverts commitbd2d5acb5a
.
This commit is contained in:
parent
5c926fea0f
commit
d65fb6ed28
4 changed files with 81 additions and 72 deletions
22
format.py
22
format.py
|
@ -9,7 +9,6 @@ import shutil
|
|||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from functools import partial
|
||||
from typing import List
|
||||
|
||||
|
@ -151,15 +150,6 @@ def main():
|
|||
action="store_true",
|
||||
help="Print the paths to the clang-* binaries used",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--files-list",
|
||||
dest="files_list",
|
||||
help="A file listing the files to format",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
)
|
||||
parser.add_argument("files", metavar="file", nargs="*")
|
||||
parser.add_argument(
|
||||
"-j",
|
||||
|
@ -185,18 +175,10 @@ def main():
|
|||
f"Error: neither clang-apply-replacements nor clang-apply-replacements-{CLANG_VER} found (required to use -j)"
|
||||
)
|
||||
|
||||
if args.files or args.files_list:
|
||||
files = []
|
||||
files.extend(args.files)
|
||||
if args.files_list:
|
||||
files.extend(Path(args.files_list).read_text().split())
|
||||
files = list(files)
|
||||
if args.files:
|
||||
files = args.files
|
||||
extra_files = []
|
||||
if args.verbose:
|
||||
print("Formatting specific files:", len(files), files)
|
||||
else:
|
||||
if args.verbose:
|
||||
print("Formatting all files")
|
||||
files = glob.glob("src/**/*.c", recursive=True)
|
||||
extra_files = glob.glob("assets/**/*.xml", recursive=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue