Conversation
Remove 5 unreachable functions: - ExtractFrontmatterString (frontmatter_content.go) - ExtractYamlChunk (frontmatter_content.go) - ComputeFrontmatterHash (frontmatter_hash.go) - buildCanonicalFrontmatter (frontmatter_hash.go) - ComputeFrontmatterHashWithExpressions (frontmatter_hash.go) Also remove their exclusive tests from frontmatter_hash_test.go, frontmatter_extraction_test.go, and frontmatter_hash_stability_test.go.
Contributor
There was a problem hiding this comment.
Pull request overview
Removes dead/unreachable frontmatter parsing and hashing helpers as part of the ongoing dead code cleanup (phase 6), and updates tests accordingly.
Changes:
- Removed
ExtractFrontmatterStringandExtractYamlChunkfrom frontmatter content extraction. - Removed
ComputeFrontmatterHashandComputeFrontmatterHashWithExpressionsfrom frontmatter hashing. - Deleted/trimmed unit tests that exercised the removed functions and cleaned up now-unused imports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/frontmatter_hash_test.go | Removes tests that directly targeted deleted hash APIs/helpers. |
| pkg/parser/frontmatter_hash_stability_test.go | Removes canonical-JSON verification that depended on deleted helpers; cleans up imports. |
| pkg/parser/frontmatter_hash.go | Deletes dead exported hash entrypoints; leaves remaining hash-from-file implementation in place. |
| pkg/parser/frontmatter_extraction_test.go | Removes tests for deleted YAML/frontmatter string extraction helpers; cleans up imports. |
| pkg/parser/frontmatter_content.go | Deletes dead frontmatter/YAML string extraction helpers. |
Comments suppressed due to low confidence (1)
pkg/parser/frontmatter_hash.go:44
buildCanonicalFrontmatteris still present, but after removingComputeFrontmatterHash*there are no remaining references to it in the repo (only its definition remains). This contradicts the PR description (“remove … buildCanonicalFrontmatter”) and leaves dead code behind; either remove this helper entirely or reintroduce a caller that still needs it.
// buildCanonicalFrontmatter builds a canonical representation of frontmatter
// including all fields that should be included in the hash computation.
func buildCanonicalFrontmatter(frontmatter map[string]any, result *ImportsResult) map[string]any {
canonical := make(map[string]any)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove 5 unreachable functions:
Part of dead code cleanup — see DEADCODE.md