Skip to content

Conversation

0xrusowsky
Copy link
Contributor

ref: #11080

@0xrusowsky 0xrusowsky linked an issue Jul 28, 2025 that may be closed by this pull request
2 tasks
@DaniPopes
Copy link
Member

doesn't this happen because we create 2 "Imports" passes? it looks like passes with more than 1 lint will appear multiple times in the create function

@0xrusowsky
Copy link
Contributor Author

@DaniPopes i think that the issue emerged because a pass with several lints would emit all lints, and my commit fixes it.

However, what you point out is true... i totally overlooked that when flattening the vec in the macro i'd be creating duplicated passes.

should i change the fn sigs and the macro so that they return:

pub fn create_early_lint_passes<'ast>() -> Vec<(Box<dyn EarlyLintPass<'ast>>, Vec<SolLint>)>
pub fn create_late_lint_passes<'hir>() -> Vec<(Box<dyn LateLintPass<'hir>>, Vec<SolLint>)>

alternatively, i could force each pass to be limited to one lint.

imo, despite creating an unnecessary heap allocation for each 1pass:1lint, the performance benefits of running multiple lints in one pass could still be worth it. what do u recommend doing though?

@DaniPopes
Copy link
Member

Passes should have multiple lints, if their logic is very similar just slightly different conditions and messages then you can batch most of the work

You can return (_, &'static [SolLint]) I believe

@0xrusowsky 0xrusowsky moved this to Ready For Review in Foundry Jul 31, 2025
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

lgtm, tests should be fixed when #11174 approved and merged

@0xrusowsky 0xrusowsky merged commit 79d4ab2 into master Aug 1, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry Aug 1, 2025
@0xrusowsky 0xrusowsky deleted the rusowsky/fix-only-lint branch August 1, 2025 09:56
grandizzy pushed a commit to grandizzy/foundry that referenced this pull request Aug 5, 2025
@grandizzy grandizzy mentioned this pull request Aug 5, 2025
3 tasks
grandizzy added a commit that referenced this pull request Aug 5, 2025
* fix(cast): use all providers if local artifacts used (#11090)

* fix(cast): use all providers if local artifacts used

* Fix

* fix(cast): improve handling of `mktx --raw-unsigned` with runtime validation (#11111)

* fix(mktx): improve handling of `--raw-unsigned` with runtime validation

- Updated the logic for handling the `--from` argument in the `run` function.
- Added validation for required `nonce` parameter when `--from` is not provided, ensuring necessary transaction details are specified.
- Used `Address::ZERO` as a placeholder when there is no need to query provider
- unit tests

* fix: fmt

* fix(`anvil`): unwrap panic in `eth/backend/mem/mod.rs` (#11141)

make typed request casting not panic and return useful error to user

* fix(forge): consistent handling unresolved imports (#11164)

* fix(forge): consistent handling unresolved imports

* Add test

* fix(lint): exclude disabled ids in multi-lint passes (#11122)

* fix: use empty 7702 auths (#11182)

* fix(forge): bump compilers to fix remapping sol file (#11184)

* Bump compilers 0.18.2

* Add test

* fix(coverage): disambiguate duplicate function names (#11188)

* fix(forge): set state changes journal in active fork (#11196)

* chore(ci): fix `typos` CI job failing (#11198)

fix typos

* Bump version 1.3.1 (#11199)

* fix(forge): improve error messages for etherscan verification failures (#11194)

* fix(forge): improve error messages for etherscan verification failures

* fix: cargo clippy

* tests(forge): add tests for unknown chain id

* fix: err formating for EtherscanConfigError

---------

Co-authored-by: zerosnacks <[email protected]>

* chore(tests): bump forge-std version (#11174)

* chore: bump forge-std version used for tests

* Fixes

---------

Co-authored-by: DaniPopes <[email protected]>
Co-authored-by: grandizzy <[email protected]>

---------

Co-authored-by: Mablr <[email protected]>
Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: 0xrusowsky <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
Co-authored-by: Shiyas Mohammed <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DaniPopes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

bug(forge-lint): improper --only-lint filtering
3 participants