Skip to content

Validate that '@param' comments on enumerators match a real field of that enumerator. - #822

Open
InsertCreativityHere wants to merge 2 commits into
icerpc:mainfrom
InsertCreativityHere:validate-enumerator-param-tags
Open

Validate that '@param' comments on enumerators match a real field of that enumerator.#822
InsertCreativityHere wants to merge 2 commits into
icerpc:mainfrom
InsertCreativityHere:validate-enumerator-param-tags

Conversation

@InsertCreativityHere

@InsertCreativityHere InsertCreativityHere commented Sep 10, 2026

Copy link
Copy Markdown
Member

Currently slicec doesn't validate that @param tags on enumerators are for real fields. For example, this produces no lints:

enum Foo {
    /// @param fakename: this field doesn't exist.
    A(hello: int32)
}

This PR directly fixes #820, and is also the last piece of validation we were missing to consider #684 fully implemented.


What's Changed:

  • slicec: slicec now validates that @param tags on enumerators reference an existent field of the enumerator, like it already did for operation parameters.

@InsertCreativityHere
InsertCreativityHere requested a balanced review from Copilot September 10, 2026 15:48
@InsertCreativityHere InsertCreativityHere added this to the 0.4.1 milestone Sep 10, 2026
@InsertCreativityHere InsertCreativityHere added the slicec Related to the 'slicec' crate label Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is correct and well-tested; only a minor test-name typo remains.

Pull request overview

Adds validation ensuring enumerator @param tags reference actual fields.

Changes:

  • Validates enumerator parameter documentation.
  • Adds valid and invalid comment tests.
File summaries
File Description
slicec/src/validators/enums.rs Implements enumerator tag validation.
slicec/tests/comment_tests.rs Covers accepted and rejected tags.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread slicec/tests/comment_tests.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

slicec Related to the 'slicec' crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enumerator @param tags are never validated against the enumerator's fields

2 participants