summaryrefslogtreecommitdiff
path: root/tools/check_format.py
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2026-04-29 09:57:07 +0200
committerGitHub <noreply@github.com>2026-04-29 09:57:07 +0200
commitbaf7ca83b1194ec78a2b9eb86970811f685067cd (patch)
tree096d2f23b9a76f5a105a89ddf39ff44d51aa67c7 /tools/check_format.py
parent55cdfccdd90f96538274bb8fe6854d1d33fa87e9 (diff)
Migrate CI to Github Actions (#2742)
* Migrate CI to Github Actions (#2740) Changes the CI system from Jenkins to Github Actions (GHA) as discussed on discord. I tried to adapt the original jenkinsfile as I could. One major difference from the old system is each version will now be built in parallel instead of sequentially. Also, the mapfiles will be uploaded as an GHA artifact to the Action workflow. I think having them easily available would be nice. This specific approach to handle GHA for decomp projects was adapted from the one used by the GC/Wii community. It is documented here https://github.com/encounter/dtk-template/blob/main/docs/github_actions.md There's a writeup about this adaptation for N64 projects [here](https://github.com/AngheloAlf/drmario64/pull/19). * Rename generate_patch_from_gha -> gha_fix_bss_and_generate_patch * Make check formatting always on the full repo * ruin z_fishing bss for CI testing purposes * fix not passing VERSION to tools/gha_fix_bss_and_generate_patch.sh * debugging gha_fix_bss_and_generate_patch.sh * fix the debugging... * git config safe.directory * rm debugging stuff from gha_fix_bss_and_generate_patch.sh * fix_bss gha-side machinery, attempt 1 * fix1 * fix2 * debug1 * checkout repo in merge_bss_fixes job * fix3 * fix4 * fix5 * some prettify * apply_fix_bss_patches.py complete * fix6 * generate_patch.sh is back * apply fix bss changes from gha! it works! * generate_patch.sh suggestion * ruin bss again for testing * unruin bss * Update .github/workflows/format.yml Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * update matrix version list * finalize apply_fix_bss_patches.py --------- Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Diffstat (limited to 'tools/check_format.py')
-rw-r--r--tools/check_format.py37
1 files changed, 2 insertions, 35 deletions
diff --git a/tools/check_format.py b/tools/check_format.py
index 18692cb6d..7d4c27b99 100644
--- a/tools/check_format.py
+++ b/tools/check_format.py
@@ -2,11 +2,9 @@
# SPDX-License-Identifier: CC0-1.0
import subprocess
-import argparse
import difflib
import multiprocessing
-import glob
-import os.path
+import os
import sys
sys.path.insert(0, os.curdir)
@@ -19,39 +17,8 @@ def get_git_status():
return subprocess.check_output("git status --porcelain".split(), text=True)
-def get_modified_files_to_format(compare_to):
- modified_files_str = subprocess.check_output(
- ["git", "diff", "--name-only", compare_to], text=True
- )
- modified_files = set(modified_files_str.splitlines())
-
- all_src_files, all_extra_files = format.list_files_to_format()
- # Split modified_files between source files and extra files (see format.py)
- # This also filters out deleted files that no longer exist
- modified_src_files_existing = list(modified_files.intersection(all_src_files))
- modified_extra_files_existing = list(modified_files.intersection(all_extra_files))
-
- return modified_src_files_existing, modified_extra_files_existing
-
-
def main():
- parser = argparse.ArgumentParser()
- parser.add_argument("--verbose", action="store_true")
- parser.add_argument("--compare-to", dest="compare_to")
- args = parser.parse_args()
-
- if args.compare_to:
- src_files, extra_files = get_modified_files_to_format(args.compare_to)
- if args.verbose:
- print("Formatting specific files:")
- print(len(src_files), src_files)
- print(len(extra_files), extra_files)
- if not src_files and not extra_files:
- if args.verbose:
- print("Nothing to format")
- exit(0)
- else:
- src_files, extra_files = format.list_files_to_format()
+ src_files, extra_files = format.list_files_to_format()
nb_jobs = multiprocessing.cpu_count()