Add the encode-intent-in-vis coding guideline - #3714
Merged
Conversation
tatetian
force-pushed
the
encode-intent-in-vis
branch
from
August 13, 2026 05:12
2466225 to
9eacf47
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends Asterinas’s maintainability coding guidelines by introducing a new Rust guideline, encode-intent-in-vis, clarifying that visibility modifiers should express an item’s maximum intended exposure (not merely its current effective exposure given module nesting).
Changes:
- Add the
encode-intent-in-visguideline to the “Crates & Modules” Rust-specific maintainability guidance, including rationale and an exception for struct/union fields. - Add the new guideline to the maintainability guideline index so it appears in the quick “one-line gist” list.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| book/src/to-contribute/coding-guidelines/for-maintainability/rust-specific/crates-and-modules.md | Adds the new visibility-intent guideline text and supporting explanations/links. |
| book/src/to-contribute/coding-guidelines/for-maintainability/README.md | Adds encode-intent-in-vis to the maintainability guideline index list. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tatetian
force-pushed
the
encode-intent-in-vis
branch
from
August 13, 2026 05:28
1aab4f8 to
f08804e
Compare
Contributor
Author
|
We reached a consensus with this new guideline in #3710. So I am merging this new guideline directly. |
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.
This PR adds a new coding guideline,
encode-intent-in-vis, to the maintainability guidelines: a visibility modifier in Asterinas declares an item's maximum intended exposure, regardless of what its enclosing modules happen to allow. It grew out of the discussion in #3710.This PR includes a secondary change that reorders the guidelines in the "Crates & Modules" pages to make related guidelines close to each other.