Skip to content

Conversation

@martinemde
Copy link
Contributor

@martinemde martinemde commented Mar 21, 2025

Adds on a repo_link_builder argument to the OffenseFormatter in order to supply the formatter with the ability to create a repo link consistently.

This also changes the formatter links to use the HEAD of the branch instead of main, which is not available on every repository.

This is an alternate implementation of #53.

Our goal in the alternate implementation was to avoid passing the entire self to the formatter. We thought that the html_link including anchor tags wasn't great, so we settled on a version that still constructs the url manually, but uses more information and allows for us to extend this in the future.

@martinemde martinemde force-pushed the ie-me-aw/repo-link-builder branch from aa58911 to f2796f5 Compare March 22, 2025 00:28
@martinemde martinemde changed the title Generate links in formatter using head ref. Generate links in formatter using head ref Mar 22, 2025
The change is backwards compatible, but sorbet forces everyone to update
their method signature anyway.
@martinemde martinemde requested a review from tstannard March 25, 2025 17:30
@martinemde martinemde merged commit acaa9fe into main Mar 25, 2025
6 checks passed
@martinemde martinemde deleted the ie-me-aw/repo-link-builder branch March 25, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants