refactor(type): drop redundant lombok accessor attributes - #38
Merged
eastspire merged 3 commits intoSep 27, 2026
Merged
Conversation
lombok_macros::Visibility defaults to Public, so an accessor attribute that omits visibility already generates a pub accessor. All four fields on Task are themselves pub, so the explicit argument was a no-op in every case. #[get(pub)] -> #[get] #[get_mut(pub)] -> #[get_mut] #[set(pub)] -> #[set] Visibility narrowing is untouched: pub(crate) forms are unaffected, since that is the deliberate restriction path.
Every accessor-providing derive already emits its accessors for
each field, so an argument-less attribute only restates that:
#[derive(Data)] -> inner_lombok_data(input, true, true, true)
(lombok-macros/src/generate/fn.rs)
Drop 23 bare attributes across 3 files. Attributes carrying
configuration (type(copy), skip, Into, ...) are untouched, and so
are those whose accessor the derive set does not provide — e.g.
#[set] on a #[derive(Getter)] struct.
Verified by compilation: 491 workspace tests pass, clippy clean,
fmt clean.
eastspire
added a commit
to eastspire/.agents
that referenced
this pull request
Sep 27, 2026
The rule was already written in §1, §2 and §7 — "all English", and the author is the personal account from ~/.gitconfig. Two PRs were then opened with Chinese titles and Chinese bodies while the rule sat in the file. Prose has no enforcement point, so this adds one. verify_english_only.py has three modes: text <file>... CJK / fullwidth scan commit <msgfile> [--repo R] + Conventional Commits + author pr <title> --body <file> + the 4-section body template Detection covers CJK Unified + Ext A + Ext B, compatibility ideographs, Kangxi and CJK radicals, kana, hangul, bopomofo, yi, and fullwidth forms, reported as line/column/character so a violation is actionable rather than a bare "non-English". Latin-1 and accented English (Kierkegaard, e.g., 50% off) pass clean. commit mode also checks subject shape, the 72-char limit, trailing periods, imperative mood and 72-col body wrapping, and resolves the author through `git config user.email` so a stale per-repo override is caught before it reaches history. pr mode reuses the same subject check on the title and requires all four §2.2 sections, so one call covers both the language rule and the shape rule. Two PRs rewritten in English to comply: euv-dev/euv#286 and hyperlane-dev/hyperlane#38. Both already carried the correct author (eastspire <root@ltpp.vip>, attributed to the eastspire GitHub account) and Conventional Commits subjects; only the prose was wrong. The verifier caught both new titles at 76 chars on the first attempt. Pitfalls 17-19 record the three ways this work went wrong on the way: a prose rule that cannot fail, a missing execute bit reported as "Permission denied", and a fixture loop reading `$?` from `basename` instead of the verifier.
eastspire
deleted the
refactor/drop-redundant-accessor-pub-2026-09-27
branch
September 27, 2026 23:32
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
Clean up violations of two
rust-standardslombok accessor rules:pub. TheDefaultoflombok_macros::Visibilityis alreadyPublic(
lombok-macros/src/visibility/enum.rs), so omitting the visibilitygenerates a
pubaccessor and spelling outpubis pure noise.#[get]/#[get_mut]/#[set].#[derive(Data)]isGetter + GetterMut + Setterin one, so the fieldalready has its accessor and an argument-less attribute just restates the
default.
Why both rules must land in one PR
They are two levels of the same construct, not two independent rules:
Applying check 23 alone turns 12
#[get(pub)]into 12 bare#[get], whichcreates exactly the violations check 24 forbids. So this PR walks straight to
the end state: delete the line where the attribute is redundant, keep it only
where it carries information.
This is also why
rust-standards/references/17-lombok-derives.md§17.14.1 wascorrected in the same series — its table listed
#[get]as check 23's answer,which was wrong.
Changes
Three commits:
ef3f8bapubcffb620chore: bump version to 21.9.0361a2a8Files touched:
core/src/route/struct.rs— 4type/src/request/struct.rs— 7type/src/task/struct.rs— 12Verification
cargo check --workspace --all-targetspassescargo clippy --workspace --all-targets— 0 warningsverify_no_redundant_accessor_attr.py→378 files checked, 0 violations#[…(pub)]remains anywhere in the treeNotes
Deliberately left alone:
#[get(pub(crate))]/#[set(pub(crate))]/#[get_mut(pub(crate))]—visibility narrowing required by §17.14
#[get(type(copy))],#[set(Into)],#[get(skip)]and friends — they carryinformation the derive cannot infer
#[new(...)]/#[with(...)]—NewandWithare independent derivesthat
Datadoes not imply, so their attributes are always meaningfulThe repository still has pre-existing violations in unrelated checks (§5.1
explicit type annotations, §2.1 doc comments, §1.3c hardcoded strings,
§13.7 features order) that predate this PR. This PR does not claim a clean
whole-repo audit.