Skip to content

fix: support no-default-features builds - #158

Merged
vyncint merged 2 commits into
vyncint:mainfrom
DefiAudit0x:fix/no-default-features-143
Aug 23, 2026
Merged

fix: support no-default-features builds#158
vyncint merged 2 commits into
vyncint:mainfrom
DefiAudit0x:fix/no-default-features-143

Conversation

@DefiAudit0x

Copy link
Copy Markdown
Contributor

What & why

Closes #143.

The crate-level snapshot doctests referenced insta-gated APIs unconditionally, so cargo test --workspace --no-default-features failed even though insta is documented as optional. The CI workflow also did not exercise that supported configuration.

This change keeps the doctest entry points valid without insta by placing the snapshot calls behind #[cfg(feature = "insta")] blocks. It also adds a dedicated no-default-features CI job and makes required-green wait for it, preventing this configuration from regressing unnoticed.

Checklist

  • Linked an issue (Closes #143)

  • Tests added/updated for the change (the affected doctest now exercises both feature configurations)

  • cargo fmt --all and cargo clippy --workspace --all-targets --all-features are clean

  • cargo test --workspace --no-default-features passes

  • cargo test --workspace --all-features passes

  • cargo doc --no-deps --all-features passes with RUSTDOCFLAGS=-D warnings

  • cargo check --workspace --locked passes

  • All commits are signed off (git commit -s)

  • No AI attribution trailers are present

  • CHANGELOG.md not updated; this is a developer-facing CI and doctest correctness fix

  • No snapshot changes

Notes

The baseline failure was reproduced before the fix: cargo test --workspace --no-default-features reported 20 passing tests and 1 failing doctest. The final verification passed after the fix. The branch contains one signed-off commit and changes only crates/termlens/src/lib.rs and .github/workflows/ci.yml.

Signed-off-by: DefiAudit0x <1.17640355e+08+DefiAudit0x@users.noreply.github.com>
@DefiAudit0x
DefiAudit0x requested a review from vyncint as a code owner August 23, 2026 15:34
Signed-off-by: DefiAudit0x <1.17640355e+08+DefiAudit0x@users.noreply.github.com>
@vyncint
vyncint merged commit 471df02 into vyncint:main Aug 23, 2026
11 checks passed
vyncint added a commit that referenced this pull request Aug 24, 2026
#158 turned main red on a pull request in which every commit was signed
off. Its branch carried a merge commit ("sync branch with upstream main"),
and GitHub composes the squash message from the commits it squashes --
except that a merge commit among them makes it emit an empty body. The
trailers went with it, so 471df02 landed carrying no Signed-off-by, and
check-dco.sh failed the push.

That failure is unfixable after the fact: main is linear history,
non-fast-forward, and protect-main has no bypass actors. The commit is
immutable and the run stays red over a policy that was met.

Checked against every merged PR here: the three other multi-commit PRs
(#153, #142, #137) all had non-merge commits only and all kept their
trailers; #158 is the only branch containing a merge commit and the only
empty body. Enabling web_commit_signoff_required is not an answer -- a
probe on a scratch branch showed GitHub neither appends a sign-off nor
refuses the commit for API-created commits.

So name the one commit that GitHub composed -- the tip of a push to main,
passed as github.event.after -- and exempt only that, and only when it
looks like a squash merge (web-flow committer, subject ending "(#123)",
no sign-off at all). It reports a ::notice::, not silence. Everything
else keeps the strict sign-off==author check, pull_request runs exempt
nothing, and a contributor cannot reach the exemption: being the tip of a
push to main means having gone through a pull request that already
passed.

Verified against 471df02 itself (fails unnamed, passes named, still fails
when a different or bogus sha is named), against the squash merges that
were already fine, and against synthetic web-flow commits with and
without a PR number.

CONTRIBUTING now says to rebase rather than merge when updating a branch,
which is what main's linear history wants anyway and avoids the trigger.

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
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.

The crate does not compile with --no-default-features, and no CI job would have noticed

2 participants