Skip to content

feat: add ignored_error_codes_from config option#13841

Merged
mattsse merged 5 commits intofoundry-rs:masterfrom
ndavd:feat/issue-9516
Apr 24, 2026
Merged

feat: add ignored_error_codes_from config option#13841
mattsse merged 5 commits intofoundry-rs:masterfrom
ndavd:feat/issue-9516

Conversation

@ndavd
Copy link
Copy Markdown
Contributor

@ndavd ndavd commented Mar 18, 2026

Adds ignored_error_codes_from config option that allows ignoring error codes from files matching specific path prefixes.

Solves #9516

Example usage

Add to foundry.toml:

ignored_error_codes_from = [
    ["test", ["code-size"]],
    ["lib", ["code-size", "license"]],
]

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

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.

I think this makes a lot of sense and would be a nice addition

"transfer-deprecated",
"natspec-memory-safe-assembly-deprecated",
]
ignored_error_codes_from = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you please give an example how this would look like in the toml, I assume like [[..],[...]]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Exactly, it would look like this:

ignored_error_codes_from = [
    ["test", ["code-size"]],            # ignore contract size only in test
    ["lib", ["code-size", "license"]],  # ignore size and license in lib
]

Should I add that example somewhere?

zerosnacks pushed a commit to foundry-rs/compilers that referenced this pull request Mar 19, 2026
mattsse
mattsse previously approved these changes Mar 20, 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.

lgtm, pending release

Comment thread crates/verify/src/etherscan/flatten.rs Outdated
Copy link
Copy Markdown
Collaborator

@mablr mablr left a comment

Choose a reason for hiding this comment

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

Comment thread Cargo.toml Outdated
idna_adapter = "=1.1.0"

[patch.crates-io]
foundry-compilers = { git = "https://github.com/ndavd/foundry-compilers", branch = "feat/ignored_error_codes_from" }
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 needs to be removed before merge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was just checking this. I noticed foundry-compilers is still imported from the old repository. Should I change it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created a PR for this #14427

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.

They will be released soon on crates.io

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.

@ndavd fyi foundry-compilers/0.20.0 was released

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. It's now up-to-date with master and I've removed the patch which is no longer needed. Should be good now.

@mattsse mattsse merged commit e16e29d into foundry-rs:master Apr 24, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Apr 24, 2026
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.

4 participants