ScopeLift / scopelint

An opinionated formatting and linting tool for foundry projects
78 stars 5 forks source link

refactor: solang #8

Closed mds1 closed 1 year ago

mds1 commented 1 year ago

Replace hacky regex checks with solang, which is a solidity parser. One downside is that we currently lose line number info, but we can get it back in a future update. solang provides location data as start and end offsets in bytes, so we have to manually convert that to line number by mapping it to the input string.

Edit: foundry has the function we need to do that implemented here, so we can use that to report line numbers, h/t/ @rkrasiuk