Sixteen new lints for values that lean on convention instead of a type - #12
Merged
Merged
Conversation
alii
added a commit
to oven-sh/bun
that referenced
this pull request
Aug 15, 2026
#38846) Moves the pinned mordant revision to 4efc663, which adds sixteen lints (duplicated matches and helpers, parallel vecs, bool parameter runs, integer aliases used interchangeably, a Result collapsed to a bool and dropped, the same place narrowed two ways, and a few more; scarletindustries/mordant#12 has the list). mordant-baseline.toml is regenerated against main so the job stays advisory and only reports instances a change adds; the recorded counts are what exists today (largest: 81 same_match_twice, 38 collapsed_error, 20 bool_params). #38841 already removes a good share of the same_match_twice and reimplemented_helper entries and can shrink the file when it lands. Nothing else changes: same nightly, same dylint version, so the workflow's caches key over on the rev alone.
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.
Adds sixteen lints, all built on the shared modules from #11 (plus one new one, hir_clone, for comparing the shape of two bodies). Fifteen are on by default; parallel_params is opt-in like flag_cluster because most of what it names is a judgement call. Each has a ui fixture with positives and must-not-fire cases, a README row, and passes over mordant's own source, which meant hir_shapes::field_chain and self_field now return small structs instead of tuples (unnamed_tuple was right about them).
By theme. Duplication: same_match_twice (the same match on the same enum written in two places), reimplemented_helper (a private fn whose body is another fn's body). State that should be a type: bool_beside_option, dependent_field, parallel_vecs, parallel_params, stringly_state, unnamed_tuple. Values whose kind lives only in a name or a position: bool_params, misbound_arg, crossed_alias (integer type aliases used interchangeably), crossed_index, sentinel_int. Checks that don't always run: collapsed_error (a Result turned into a bare bool/None and then dropped), uneven_narrowing (the same place narrowed checked here and with
asthere), bypassed_conversion (a transmute or pointer cast into a type that has a From/TryFrom for exactly that source).The commit series is one lint per "add" commit followed by the refinements that quietened it; every refinement is structural (what the lint reads), none is a name list or a threshold bump. cargo test, clippy, fmt and the self-lint step are green at every commit I checked and at the head.