fix: package --doc corpus for crates.io + CEL doc examples + v3.0.2#16
Merged
Merged
Conversation
The doc corpus (`--doc HK` etc.) is embedded at build time by build.rs walking the repo-root `languages/` tree. That tree lives outside the crate, so it is not in the crates.io tarball — `cargo install code-ranker` from crates.io produced a binary with an EMPTY corpus and `--doc` reported "not embedded". Mirror the existing per-crate README copy: the publish workflow now copies `languages/` into a package-local `crates/code-ranker-cli/languages/` right before `cargo publish` (--allow-dirty tolerates it), and build.rs prefers that package-local copy, falling back to the repo-root tree for workspace/dev builds. No symlinks; the package-local copy is materialized only at publish time. Verified: `cargo package --list` includes all 66 corpus .md files; a build from the package-local copy serves `--doc HK`. Claude-Session: https://claude.ai/code/session_013R7NfedZh9uEkUQrSRGWR7
…mplexity The `wide_hub` example in cel-reference.md was titled "list macros" but used no macro — `deps.size() > 20` is just `fan_out > 20`. Replace it with a real `filter` macro (`wide_ext_hub`, counts external crates) and add a parallel metrics-context macro over a literal list, noting graph lists are checks-only. Add a worked "dense complexity" example: size-normalized metrics (cognitive/cyclomatic per 100 SLOC) plus a check that flags short-but-dense files relative to the repo's own distribution (both densities > p90, sloc < median). All snippets verified against the repo before documenting. Claude-Session: https://claude.ai/code/session_013R7NfedZh9uEkUQrSRGWR7
code-rankerVerdict vs No new violations vs the baseline. 🎉 📦 Full HTML report: see the code-ranker-report artifact on this run. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
=======================================
Coverage 97.68% 97.68%
=======================================
Files 121 121
Lines 13971 13971
=======================================
Hits 13648 13648
Misses 323 323 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace GitHub's default CodeQL setup (which re-analyzed every language on every PR) with an advanced workflow that scans a language only when that language's source actually changed. A `changes` job classifies the diff by file extension via dorny/paths-filter and emits a matrix of just the affected languages: - docs/golden-only PR (*.md, *.json, *.sarif, …) → analyze job skipped entirely - any *.rs change → rust (whole product) + actions - a *.cs fixture change → only csharp Keying on extension (not folder) is deliberate: golden snapshots and a plugin's own Rust files (e.g. languages/csharp/dialect.rs) don't trigger a pointless re-scan of that fixture language, while real code outside the fixtures stays covered (rust spans all *.rs, javascript-typescript includes the viewer assets, python includes .github/scripts). go uses build-mode autobuild (no buildless mode); all others use build-mode none. A weekly schedule forces a full scan. Requires default setup to be turned off (done via the code-scanning/default-setup API) so the two don't conflict. Claude-Session: https://claude.ai/code/session_013R7NfedZh9uEkUQrSRGWR7
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.
Summary
Three logical changes, bundled (release-prep + doc fixes surfaced in one session):
Package the
--doccorpus into the crates.io tarball (build.rs+crates-io.yml)--doc HKetc. is embedded at build time bybuild.rswalking the repo-rootlanguages/tree. That tree lives outside the crate, so it never reached the crates.io tarball —cargo install code-rankerfrom crates.io produced a binary with an empty corpus and--docreportednot embedded.languages/into a package-localcrates/code-ranker-cli/languages/right beforecargo publish(--allow-dirtytolerates it), andbuild.rsprefers that package-local copy, falling back to the repo-root tree for workspace/dev builds. No symlinks; the copy is materialized only at publish time.cargo package --listincludes all 66 corpus.mdfiles; a build from the package-local copy serves--doc HK.CEL reference doc fixes (
docs/customization/cel-reference.md)wide_hubexample was titled "list macros" but used no macro —deps.size() > 20is justfan_out > 20. Replaced with a realfiltermacro (wide_ext_hub) plus a parallel metrics-context macro over a literal list (graph lists are checks-only).> p90,sloc < median). Every snippet verified against the repo before documenting.Release v3.0.2 — version bump across the 5 crates + synced doc version refs.
Validation
make all: PASS — build/test/clippy PASS, lychee 0 errors, markdownlint 0 errors (95 files), self-check clean, coverage 96.18% (> 90% floor).make e2e: PASS — 52 passed, 0 failed.https://claude.ai/code/session_013R7NfedZh9uEkUQrSRGWR7