Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .repowise/bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Smoke-test config for the Repowise bot health gate (throwaway PR).
bot:
comment_mode: always
health_gate:
mode: blocking
repo_drop_block: 0.3
min_new_file_score: 7.0
block_on_introduced: true
block_ai_regression: true
71 changes: 71 additions & 0 deletions scratch/health_gate_smoke/messy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""Smoke-test fixture: a deliberately unhealthy module (AI-authored side).

Part of a throwaway PR to exercise the Repowise bot health gate. This function
is intentionally gnarly (high cyclomatic complexity, deep nesting, long body,
compound conditionals) so it scores poorly and trips several biomarkers. Safe
to delete; not imported anywhere.
"""

from __future__ import annotations


def process(mode, a, b, c, d, e, flags): # noqa: C901 - intentionally complex
total = 0
for i in range(a):
if mode == "x" and flags and (a > b or c < d):
for j in range(b):
if j % 2 == 0 and c > 0:
if d > e or (a + b) > (c + d):
if e > 0 and flags:
if a > 1 and b > 1 and c > 1:
total += i * j
elif a < 0 or b < 0 or c < 0:
total -= i
else:
total += 1
else:
total += 2
elif d < e:
total -= j
else:
total += 3
elif j % 3 == 0:
total += j
else:
total -= 1
elif mode == "y":
if a == 1:
total += 10
elif a == 2:
total += 20
elif a == 3:
total += 30
elif a == 4:
total += 40
elif a == 5:
total += 50
elif a == 6:
total += 60
else:
total += 70
elif mode == "z" and (b > c or d > e):
if c == 0:
total += 100
elif c == 1:
total += 200
elif c == 2:
total += 300
else:
total += 400
elif mode == "w":
total += a + b + c + d + e
else:
if flags and a:
total += 1
elif b and c:
total += 2
elif d and e:
total += 3
else:
total -= 5
return total
17 changes: 17 additions & 0 deletions scratch/health_gate_smoke/tidy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Smoke-test fixture: a clean, healthy module (human-authored side).

Part of a throwaway PR to exercise the Repowise bot health gate. Safe to
delete; not imported anywhere.
"""

from __future__ import annotations


def add(a: int, b: int) -> int:
"""Return the sum of two integers."""
return a + b


def greet(name: str) -> str:
"""Return a friendly greeting."""
return f"Hello, {name}!"
Loading