Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

feat(hooks): add release notes reminder pre-commit hook (#3763)

LearningCircuit27f907371847
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d218b4d93f..c8003d8113 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -295,6 +295,14 @@ repos:
always_run: true
verbose: true
description: "Remind contributors about subsystem fast tests and opt-in live tests"
+ - id: recommend-release-notes
+ name: Release Notes Reminder
+ entry: .pre-commit-hooks/recommend-release-notes.py
+ language: script
+ pass_filenames: false
+ always_run: true
+ verbose: true
+ description: "Remind contributors to update docs/release_notes/ for substantial changes"
- id: require-tests
name: Require Tests for Substantial Changes
entry: .pre-commit-hooks/require-tests.py
diff --git a/.pre-commit-hooks/recommend-release-notes.py b/.pre-commit-hooks/recommend-release-notes.py
new file mode 100755
index 0000000000..401a42ec40
--- /dev/null
+++ b/.pre-commit-hooks/recommend-release-notes.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+"""Remind contributors to update release notes for substantial changes.
+
+Always exits 0 (non-blocking). Prints a suggestion when source changes
+are substantial but no files under docs/release_notes/ are staged.
+"""
+
+import subprocess
+import sys
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from _commit_analysis import analyze_commit
+
+# Minimum added source lines before the reminder fires
+MIN_SOURCE_ADDED = 20
+
+
+def _release_notes_staged():
+ """Return True if any file under docs/release_notes/ is staged."""
+ result = subprocess.run(
+ ["git", "diff", "--cached", "--name-only", "--", "docs/release_notes/"],
+ capture_output=True,
+ text=True,
+ )
+ return bool(result.stdout.strip())
+
+
+def main():
+ analysis = analyze_commit()
+
+ # Silent exit: no source files staged
+ if not analysis.source_files:
+ return 0
+
+ # Silent exit: trivial change (less than MIN_SOURCE_ADDED added lines)
+ if analysis.total_source_added < MIN_SOURCE_ADDED:
+ return 0
+
+ # Silent exit: release notes already updated
+ if _release_notes_staged():
+ return 0
+
+ # Print reminder
+ print()
+ print(" \033[36mRelease Notes Reminder\033[0m")
+ print(" " + "-" * 40)
+ print(
+ f" You're adding {analysis.total_source_added} lines across "
+ f"{len(analysis.source_files)} source file(s)"
+ )
+ print(" but no files under docs/release_notes/ are staged.")
+ print()
+ print(" Changed source files:")
+ for f in analysis.source_files:
+ print(f" - {f.path} (+{f.added})")
+ print()
+ print(" Consider adding an entry to docs/release_notes/ if this")
+ print(" change is user-facing or otherwise notable.")
+ print()
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())