Skip to content

Commit 7fcdda5

Browse files
authored
docs(lint): explain solar workflow for new rules (#11938)
1 parent 8625e9f commit 7fcdda5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/dev/lintrules.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ The `forge-lint` system operates by analyzing Solidity source code through a dua
2828

2929
## Developing a new lint rule
3030

31+
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.
32+
33+
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/<file.sol>`. If your lint is late, you can use `solar -Zdump=hir crates/lint/testdata/<file.sol>`.
34+
3135
1. Specify an issue that is being addressed in the PR description.
3236
2. In your PR:
3337

0 commit comments

Comments
 (0)