Repository navigation
Provide a new build-lints crate to hold future custom linters, and run it in CI - #195
Open
drauschenbach wants to merge 3 commits into
Open
drauschenbach wants to merge 3 commits into
drauschenbach wants to merge 3 commits into
Conversation
…e, which happens to be a good lint)
drauschenbach
force-pushed
the
david/new-runvil-lints-crate
branch
from
November 4, 2026 18:54
7b5f63d to
fbe8f00
Compare
drauschenbach
marked this pull request as ready for review
November 4, 2026 22:13
awheeler294
added a commit
to awheeler294/dylints
that referenced
this pull request
Nov 7, 2026
Moved from lints/build-lints in cppalliance/runvil#195 so the lints can be shared across the runvil project's repositories. A repository names this library in its root [workspace.metadata.dylint] as a git source pinned by rev. Adds a README, AGENTS.md, and CI running fmt, clippy, and the UI tests on the pinned nightly. Co-authored-by: David Rauschenbach <david@cppalliance.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Adds a new
lints/build-lintscrate, which is a dylint based library for custom workspace rules.Its first lint, io_try_without_context, rejects a
?that converts astd::io::Errorinto another error type without adding context. A bare I/O error says "No such file or directory (os error 2)" and nothing about which file or what was being done.The first lint
io_try_without_context is the dylint project's sample lint. It also happens to be a good one, so it is included here to seed the pattern of where new lints go. It is a hard error by default. It flags
x?when:Result<_, std::io::Error>, and?converts the errorthrough From.
It doesn't flag
?from onestd::io::Resultinto another. No conversion happens there, and the caller that converts away fromstd::io::Erroris where the context goes. This also keepsstd::io::ReadandWriteimplementations easy to write.Any conversion before the ? satisfies the lint:
.map_err(...)into Error withError::with_cause, anyhow's.context(...), or a crate's own conversion.The crate
nightly with rustc_private, while the workspace is pinned to stable 1.99. The build-xtask structural
checks apply to every crate under crates/, and this crate couldn't satisfy them.
change together (cargo dylint upgrade).
runs it from the repo root.
is its own module with a UI test under ui/.
CI and docs
nightly from lints/build-lints/rust-toolchain.toml, so the date lives only in that file. Because cargo
dylint compiles the desktop app, it uses check-workshop-linux's setup: ubuntu-22.04, the Tauri packages,
npm ci and the stub sidecar. It then runs the lint's UI tests and cargo dylint --all -- --locked
--workspace --all-targets --all-features, and checks the tree is clean.
a new lint.
Testing
spelled-out Result, Box, a closure) and four allowed ones (map_err first, io to io, a non-io
Result, Option).
the docs-claims scan: all clean.
realtime_relay::overload::stalled_browser_cleanup_is_bounded_after_gateway_disconnect fails on every
run, including with this PR's crate changes stashed, so it was already failing before this PR.