Removes basic hook and rule check files.
Fixes Pr checks bug. Adds documentations.
This commit is contained in:
1 parent
95044caecd
commit
e3d6cd21be
5 files changed
+68
-53
No files matched your search
+22
-5
@@ -34,7 +34,10 @@ def git_ref_exists(ref: str) -> bool:
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
|
||||
def resolve_target_ref() -> str:
|
||||
def is_pull_request_build() -> bool:
|
||||
return bool(os.environ.get("CHANGE_ID"))
|
||||
|
||||
def resolve_target_ref() -> str | None:
|
||||
raw = os.environ.get("CHANGE_TARGET", "").strip()
|
||||
|
||||
candidates = []
|
||||
@@ -52,13 +55,27 @@ def resolve_target_ref() -> str:
|
||||
if git_ref_exists(ref):
|
||||
return ref
|
||||
|
||||
print("ERROR: Kein gültiger Ziel-Branch-Ref gefunden. Geprüft:", ", ".join(candidates))
|
||||
sys.exit(1)
|
||||
return None
|
||||
|
||||
def changed_files():
|
||||
target = resolve_target_ref()
|
||||
print(f"Vergleiche gegen Ziel-Ref: {target}")
|
||||
out = run(f"git diff --name-only {target}...HEAD")
|
||||
|
||||
if target:
|
||||
print(f"Vergleiche gegen Ziel-Ref: {target}")
|
||||
out = run(f"git diff --name-only {target}...HEAD")
|
||||
return [line.strip() for line in out.splitlines() if line.strip()]
|
||||
|
||||
if is_pull_request_build():
|
||||
print("ERROR: Kein gültiger Ziel-Branch-Ref für PR-Build gefunden.")
|
||||
sys.exit(1)
|
||||
|
||||
if git_ref_exists("HEAD~1"):
|
||||
print("Kein Ziel-Branch-Ref gefunden, verwende HEAD~1 für Branch-Build.")
|
||||
out = run("git diff --name-only HEAD~1..HEAD")
|
||||
return [line.strip() for line in out.splitlines() if line.strip()]
|
||||
|
||||
print("Keine Vergleichsbasis gefunden, behandle alle versionierten Dateien als geändert.")
|
||||
out = run("git ls-files")
|
||||
return [line.strip() for line in out.splitlines() if line.strip()]
|
||||
|
||||
def is_cpp_file(path: Path) -> bool:
|
||||
|
||||
Reference in new issue
Block a user