Skip to content

Instantly share code, notes, and snippets.

@Sjors
Last active January 9, 2026 11:57
Show Gist options
  • Select an option

  • Save Sjors/dbe7e7f0159c7fe00f7dc914d1db4242 to your computer and use it in GitHub Desktop.

Select an option

Save Sjors/dbe7e7f0159c7fe00f7dc914d1db4242 to your computer and use it in GitHub Desktop.
Pre-empt Drahtbot LLM linter :-)

Anticipating what Drahtbot is going to complain about saves me a force-push.

I tested the above instructions by opening an existing PR branch, then asking GPT-5.2 Github Copilot in VSCode (Insiders) the following:

Anything left to do here before opening a PR?

We'll see if it actually manages to preempt Drahtbot comments though :-)

  • If the user is about to open a pull request, suggest the following final checks
    • pre-empt Drahtbot LLM linter:
      • Last verified (update when you re-check): 2026-01-09
        • If this date is >7 days old, re-fetch rules, update the snapshot below if needed, then re-scan the diff before opening/updating the PR.
      • Fetch rules (they may change): curl -fsSL https://raw.githubusercontent.com/maflcko/DrahtBot/refs/heads/main/util/src/lib.rs | rg -n "all_llm_checks\(\)|LLM_PROMPT_"
      • Snapshot (as of 2026-01-09): typos/grammar in comments+docs, named args for integral literals (3rd arg and later), and Python functional-test comparison helpers.
      • These are intentionally deterministic git diff | rg heuristics (no model-specific behavior).
      • Sanity check (if this is 0, there’s nothing for Drahtbot to lint on this branch):
        • BASE=$(git merge-base --fork-point master HEAD 2>/dev/null || git merge-base master HEAD); git diff --color=never "$BASE...HEAD" | rg '^\+[^+]' | wc -l
      • Apply the checks only to added lines (those starting with + in the diff):
        • If the scans below print nothing, that’s typically “all good” (Drahtbot’s LLM output would be: “No typos were found” / “No suggestions were found” / “No comparison macro suggestions were found.”).
        • Run the three quick scans (all in one; expected to print nothing when clean):
          • BASE=$(git merge-base --fork-point master HEAD 2>/dev/null || git merge-base master HEAD) && echo '--- comments/docs added-lines (typos/grammar scan input)' && git diff -U0 --color=never "$BASE...HEAD" | rg -n -B 8 -A 2 '^\+\s*(//|/\*|\*/|\*)|^\+\s+#|^\+\s*>\s' || true && echo '--- 3rd+ positional literal args heuristic' && git diff -U0 --color=never "$BASE...HEAD" | rg -n -B 8 -A 2 '^\+.*\([^\)]*,[^\)]*,\s*(true|false|0x[0-9a-fA-F]+|\d+)\b' || true && echo '--- functional-test bare asserts heuristic' && git diff -U0 --color=never "$BASE...HEAD" -- test/functional | rg -n -B 8 -A 2 '^\+\s*assert\s+.+\s*(==|!=|>=|<=|>|<)\s+.+' || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment