foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(forge lint): disable lints with inline comment

Open 0xrusowsky opened this issue 6 months ago • 1 comments

ref:

  • https://github.com/foundry-rs/foundry/issues/10769#issuecomment-2969023736

Motivation

easily allow disabling lints with inline-config via comments

Implementation

having standardization in mind, i decided to follow the same naming convention as forge-fmt (and borrowed some code from https://github.com/foundry-rs/foundry/blob/dani/fmt-solar/crates/fmt-2/src/inline_config.rs)

because of that, these are the available config options:

  • forgelint: disable-next-item
  • forgelint: disable-line
  • forgelint: disable-next-line
  • forgelint: disable-start
  • forgelint: disable-end

unlike when formatting though, devs can also inform the target lints by wrapping their ids in parentheses:

  • forgelint: disable-next-line(asm-keccak256)
  • forgelint: disable-next-line(asm-keccak256, mixed-case-variable)

if no lint ids are provided (or "all" is used), all lints will be disabled:

  • forgelint: disable-next-line(all)
  • forgelint: disable-next-line

0xrusowsky avatar Jun 13 '25 09:06 0xrusowsky

having standardization in mind, i decided to follow the same naming convention as forge-fmt

Good call 👍

zerosnacks avatar Jun 13 '25 09:06 zerosnacks

having standardization in mind, i decided to follow the same naming convention as forge-fmt

Good call 👍

let's keep the same name style as for forge-fmt, that is forge-lint?

grandizzy avatar Jun 16 '25 09:06 grandizzy