Skip to content

✨ do not fail silently - fail build #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025
Merged
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
10 changes: 5 additions & 5 deletions docs/split_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def clean_trailing_links(content):


def process_readme(readme_path, output_dir):
readme = Path(readme_path).read_text()
readme = Path(readme_path).read_text(encoding="utf-8")

# Extract links from README
links = extract_links_from_readme(readme)
Expand All @@ -104,11 +104,11 @@ def process_readme(readme_path, output_dir):
(output_dir / filename).write_text(myst_content)
print(f"Generated {filename}")
else:
print(f"Warning: Section '{section_title}' not found in README")
raise ValueError(f"Section '{section_title}' not found in README")

# Include CONTRIBUTING.md with its own link references
contrib_path = readme_path.parent / "CONTRIBUTING.md"
if contrib_path.exists():
try:
raw_contrib = contrib_path.read_text()
contrib_links = extract_links_from_readme(raw_contrib)

Expand All @@ -121,8 +121,8 @@ def process_readme(readme_path, output_dir):
# Write output
(output_dir / "contributing.md").write_text(contrib_converted)
print("Generated contributing.md")
else:
print("Warning: CONTRIBUTING.md not found")
except FileNotFoundError as e:
raise FileNotFoundError(f"CONTRIBUTING.md not found at {contrib_path}") from e


if __name__ == "__main__":
Expand Down