diff --git a/docs/dev/lintrules.md b/docs/dev/lintrules.md index b500ece9fceef..6f5dbbd850784 100644 --- a/docs/dev/lintrules.md +++ b/docs/dev/lintrules.md @@ -28,6 +28,10 @@ The `forge-lint` system operates by analyzing Solidity source code through a dua ## Developing a new lint rule +We recommend you start by writing out some Solidity code that you want to trigger a lint in [`crates/lint/testdata`](https://github.com/foundry-rs/foundry/tree/master/crates/lint/testdata). Name the file after your lint rule. + +Next, choose whether you want an [early or late lint pass](#choosing-between-early-and-late-passes). If your lint is early, you can use use [Solar](https://github.com/paradigmxyz/solar) to dump the AST and find the patterns you need to match on in your lint code using `solar -Zdump=ast crates/lint/testdata/`. If your lint is late, you can use `solar -Zdump=hir crates/lint/testdata/`. + 1. Specify an issue that is being addressed in the PR description. 2. In your PR: