Scope editor CI audit to its branch and use UTF-8 tests on MSVC (by Codex)

This commit is contained in:
Codex committed 2026-10-22 21:43:28 +02:00
1 parent bde8b10762
commit b199f67eec
3 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Check public sources
run: python3 tools/public_release/check_public_tree.py --root . --history
run: python3 tools/public_release/check_public_tree.py --root . --history --revision HEAD
- name: Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libgl1-mesa-dev xvfb xauth xdotool
+3
View File
@@ -78,4 +78,7 @@ install(TARGETS openbmh_editor RUNTIME DESTINATION . COMPONENT Editor)
install(DIRECTORY "${editor_assets}/" DESTINATION assets/editor COMPONENT Editor)
add_executable(editor_core_tests ../../tests/editor_core_tests.cpp)
target_link_libraries(editor_core_tests PRIVATE bmh_editor_core)
if(MSVC)
target_compile_options(editor_core_tests PRIVATE /utf-8)
endif()
add_test(NAME editor_core_tests COMMAND editor_core_tests)
+7 -3
View File
@@ -250,11 +250,12 @@ def scan_tree(root: Path):
return findings, len(names)
def scan_history(root: Path):
def scan_history(root: Path, revision=None):
findings = []
references = subprocess.check_output(["git", "-C", str(root), "for-each-ref", "--format=%(refname)"])
findings.extend(scan_blob("ref-names", references))
refs = subprocess.check_output(["git", "-C", str(root), "rev-list", "--all"], text=True).splitlines()
selection = [revision] if revision else ["--all"]
refs = subprocess.check_output(["git", "-C", str(root), "rev-list", *selection], text=True).splitlines()
seen = set()
checked = 0
for revision in refs:
@@ -286,15 +287,18 @@ def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--root", type=Path, default=Path.cwd())
parser.add_argument("--history", action="store_true", help="also check all reachable commits and their blobs")
parser.add_argument("--revision", help="with --history, inspect this revision's ancestry instead of unrelated refs")
parser.add_argument("--json", type=Path, help="write a report containing rule names and locations only")
args = parser.parse_args(argv)
if args.revision and (not args.history or args.revision.startswith('-')):
parser.error("--revision requires --history and a revision, not an option")
if args.history and shutil.which("git") is None:
parser.error("Git is required for history checks")
root = args.root.resolve(strict=True)
findings, files = scan_tree(root)
commits = blobs = 0
if args.history:
extra, commits, blobs = scan_history(root)
extra, commits, blobs = scan_history(root, args.revision)
findings.extend(extra)
findings = sorted(set(findings))
def display_path(name):