Add Hibernate 7 batches 2-6, batch 7, and batch 8: mapping styles, JPA annotations, natural IDs, @Immutable, stored procedures, in-memory test databases, JNDI mocking, proxies, associations, temporal mapping, named queries, HQL, Criteria API, EntityManager bootstrapping, Ehcache 3 L2 cache configuration, HikariCP connection pooling, Hibernate Validator CDI integration, aggregate functions, sorting, pagination, interceptors, and Hibernate Search 8 (Hibernate 7.4.5.Final + Spring Boot 4.1.1 + JDK 25)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import re, sys, os
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
DOCS = os.path.join(ROOT, "docs")
|
||||
|
||||
link_re = re.compile(r'\[[^\]]*\]\(([^)]+)\)')
|
||||
|
||||
errors = []
|
||||
checked = 0
|
||||
|
||||
for dirpath, _, filenames in os.walk(DOCS):
|
||||
for fn in filenames:
|
||||
if not fn.endswith(".md"):
|
||||
continue
|
||||
path = os.path.join(dirpath, fn)
|
||||
with open(path, encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
for m in link_re.finditer(content):
|
||||
target = m.group(1).strip()
|
||||
if target.startswith(("http://", "https://", "mailto:")):
|
||||
continue
|
||||
# strip fragment
|
||||
target_path = target.split("#", 1)[0]
|
||||
if not target_path:
|
||||
continue
|
||||
resolved = os.path.normpath(os.path.join(dirpath, target_path))
|
||||
checked += 1
|
||||
if not os.path.exists(resolved):
|
||||
errors.append(f"{os.path.relpath(path, ROOT)}: broken link -> {target} (resolved: {os.path.relpath(resolved, ROOT)})")
|
||||
|
||||
print(f"Checked {checked} relative links across docs/*.md")
|
||||
if errors:
|
||||
print(f"\n{len(errors)} BROKEN LINK(S):")
|
||||
for e in errors:
|
||||
print(" " + e)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("All relative links resolve to existing files.")
|
||||
Reference in New Issue
Block a user