Skip to content

feat(lint): add event-fields lint#14751

Open
stevencartavia wants to merge 3 commits into
masterfrom
steven/event-fields-lint
Open

feat(lint): add event-fields lint#14751
stevencartavia wants to merge 3 commits into
masterfrom
steven/event-fields-lint

Conversation

@stevencartavia
Copy link
Copy Markdown
Collaborator

Adds event-fields, info lint that flags unindexed address, address payable, and id-like uint256/bytes32 event parameters.

mattsse
mattsse previously approved these changes May 14, 2026
Copy link
Copy Markdown
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

Code changes look good to me. The failing docs-link check appears flaky/external to this patch.

@mablr
Copy link
Copy Markdown
Collaborator

mablr commented May 14, 2026

The failing docs-link check appears flaky/external to this patch

@mattsse merging foundry-rs/book#1842 will resolve the error.

fn is_filterable_field(param: &VariableDefinition<'_>) -> bool {
let TypeKind::Elementary(elem) = &param.ty.kind else { return false };
match elem {
ElementaryType::Address(_) => true,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this kind of name-based heuristic tends to annoy users

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the match is suffix-based and case-sensitive. Do you have a concrete false-positive in mind?

Comment thread crates/lint/testdata/EventFields.stderr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants