Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
We welcome contributions! We all benefit when new ideas, skills, and reviewer
perspectives are shared across the open-source community.

## Which track is my change?

Pick a track before you open an issue or PR. The full rules for each track are
in [Contribution Tracks & Workflow](#contribution-tracks--workflow); this
section points to them.

* **Small fix within the Track 1 limits:** open a PR with the
[PR template](.github/PULL_REQUEST_TEMPLATE.md).
* **New feature, architectural change, or anything over the Track 1
limits:** open a
[feature proposal issue](https://github.com/google/elephant-goldfish-model/issues/new?template=feature_proposal.md)
and follow the Track 2 steps. Existing design docs are listed in
[docs/designs/README.md](docs/designs/README.md).

## Design Principles

These general principles guide development of the EGM framework:
Expand Down
14 changes: 11 additions & 3 deletions tests/unit/test_link_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ def extract_headers(content: str) -> Set[str]:
slugs = set()
for match in HEADER_PATTERN.finditer(content):
title = match.group(2).strip().lower()
# Normalize slug: remove punctuation, replace spaces with hyphens
slug = re.sub(r"[^a-z0-9\s-]", "", title)
slug = re.sub(r"\s+", "-", slug)
# Turn each space into its own hyphen, as GitHub does, so removed
# punctuation leaves "--": "Tracks & Workflow" -> "tracks--workflow".
slug = re.sub(r"[^a-z0-9 -]", "", title)
slug = slug.replace(" ", "-")
slugs.add(slug)
return slugs


def test_heading_slug_keeps_one_hyphen_per_space() -> None:
"""Verifies removed punctuation leaves a double hyphen, as on GitHub."""
assert extract_headers("## Contribution Tracks & Workflow\n") == {
"contribution-tracks--workflow"
}
Comment thread
atrearyanuf marked this conversation as resolved.
Resolved


def test_relative_markdown_links_resolve_on_disk(
repo_root: pathlib.Path,
) -> None:
Expand Down
Loading