Skip to content

forge lint fails due to solidity compiler warning in dependencies #13107

@beeb

Description

@beeb

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

1.5.1

What version of Foundryup are you on?

N/A

What command(s) is the bug in?

forge lint

Operating System

Linux

Describe the bug

When compilation is required, forge lint -D notes exits with code 1 even though there are no lints triggered in the codebase. This is because the compilation emits solc warnings in one of my dependencies (installed with soldeer). This is undesirable, as I have no control over the code present in dependencies. solc warnings triggered during compilation inside of dependencies should not cause the lint command to exit with an error, and they probably should be silenced altogether.

Steps to reproduce:

mkdir repro && cd repro
forge init
git add -A
git commit -am "init"
forge soldeer init --clean --config-location foundry
forge soldeer install openzeppelin-foundry-upgrades~0.4.0
forge lint -D notes
echo $? # observe status 1

The output looks like this:

[...]
Warning (2424): Natspec memory-safe-assembly special comment for inline assembly is deprecated and scheduled for removal. Use the memory-safe block annotation instead.
    --> dependencies/openzeppelin-foundry-upgrades-0.4.0/lib/forge-std/src/safeconsole.sol:4347:9:
     |
4347 |         assembly {
     |         ^ (Relevant source part starts here and spans across multiple lines).

Warning (2424): Natspec memory-safe-assembly special comment for inline assembly is deprecated and scheduled for removal. Use the memory-safe block annotation instead.
    --> dependencies/openzeppelin-foundry-upgrades-0.4.0/lib/forge-std/src/safeconsole.sol:4363:9:
     |
4363 |         assembly {
     |         ^ (Relevant source part starts here and spans across multiple lines).

Warning (4591): There are more than 256 warnings. Ignoring the rest.

Note that if I run forge build first (which emits the warnings), and then forge lint -D notes, then the exit code is 0 as expected (because compilation is skipped). But this is not a viable workaround in the long run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions