Skip to content

chore: pay down nesting-too-deep baseline for head_metadata.rs - #482

Merged
Goldziher merged 8 commits into
xberg-io:mainfrom
jabrailkhalil:chore/465-pay-down-head-metadata-nesting
Sep 11, 2026
Merged

Goldziher merged 8 commits into
xberg-io:mainfrom
jabrailkhalil:chore/465-pay-down-head-metadata-nesting

Conversation

@jabrailkhalil

Copy link
Copy Markdown
Contributor

Summary

One unit of the quality-debt baseline tracked in gh-465: removes the nesting-too-deep finding for crates/html-to-markdown/src/converter/head_metadata.rs.

Refactor (behavior-preserving):

  • extract_metadata_from_dom: replaced the nested if let/match chain with let-else unwraps plus a new extract_metadata_from_child helper that dispatches to the existing per-tag extractors. Depth drops from 6 to 2.
  • find_head_node: early returns instead of nested if let, and find_map for the recursive descent.

No arithmetic, ordering, dispatch, or output changes; the extractor contract (extract_frontmatter byte-equivalence with the Tier-2 path) is untouched.

Baseline bookkeeping (generated files stay in sync with alef.toml):

Testing

  • poly lint .: No issues found (baseline entry removed, no new findings).
  • poly fmt --check on the changed file: clean.
  • cargo fmt --check on the changed file: clean.
  • Local cargo test could not link on this Windows host (repo's .cargo/config.toml pins rust-lld for the MSVC target and no VS Build Tools are installed), so crate compilation and the full Rust test suite are verified by CI (ci-rust.yaml runs cargo test for the workspace).

Flatten extract_metadata_from_dom with let-else chains and move the
per-child dispatch into a small helper, and rewrite find_head_node with
early returns. Behavior is unchanged; the file no longer needs the
nesting-too-deep baseline entry, so it is removed from alef.toml (and the
generated poly.toml plus merge provenance).
Copilot AI lite review requested due to automatic review settings September 10, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

CI clippy (cargo clippy -D warnings) rejects the let-else with an early
return in an Option-returning function; use the ? operator instead.
Copilot AI review requested due to automatic review settings September 10, 2026 19:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Regenerated with alef 0.85.11 in a Linux container (the generated
bindings themselves are unchanged; only the crate input hash in
.alef-generation.toml and poly.toml's alef:hash header moved).
Copilot AI review requested due to automatic review settings September 10, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

alef e2e generate resolves @types/node to ^26.4.0; the committed ^26.5.1
made the e2e/snippet freshness gates drift on every PR touching crates/.
No generated e2e fixture content changed for this refactor.
Copilot AI review requested due to automatic review settings September 10, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The generator sorts devDependencies keys and pins @types/node to
^26.4.0; the committed order/pin drifted on the freshness gates.
Copilot AI review requested due to automatic review settings September 10, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 10, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 11, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 11, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Goldziher
Goldziher merged commit a76c66e into xberg-io:main Sep 11, 2026
17 of 18 checks passed
Goldziher added a commit that referenced this pull request Sep 11, 2026
The generation fingerprint covers Rust sources plus alef.toml, both of which
moved when these commits were rebased onto #482's head_metadata.rs lint
paydown; that paydown also retires a nesting-too-deep per-file ignore.
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.

3 participants