-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(forge): forge lint #10405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(forge): forge lint #10405
Conversation
feat(forge): Forge Lint
Unblocked by #10454 |
will merge with master later today, thanks for the heads up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, good to be sent from my side! @DaniPopes can you pls recheck before merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, pls address comment, merge master and merge
Amazing work @0xrusowsky & @0xKitsune! |
this PR builds on top of the work that @0xKitsune did on #9590.
Closes #1970.
the proposed changes maintain most of the initial traits and structs + uses
trait EarlyLintPass
to adopt the clippy-like architecture that @DaniPopes requested.relevant changes:
Visit
trait is implemented by the helper structEarlyLintVisitor
rather than the individual lints.considerations:
i was unable to find any methods on the solar
Session
to get the warning/note counts (just errors), so for tests, i manually counted the occurrences from the buffer.since i wanted to minimize code duplication, i added an unnecessary boolean to the
SolidityLinter
which allows it write to the local buffer rather than stderr:imo it should be fine, as the runtime overhead should be minimal and it would probably be optimized by the compiler:
however, if this feels unacceptable, i could leave a clean
SolidityLinter
and implement aTestSolidityLinter
with duplicate the logicif the changes are validated i can add more lints and tests (so far i only added a minimal logic for
incorrect-shift
)