-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add pre-commit hook definition + test #1877
Conversation
description: Analyze EVM bytecode with Mythril | ||
entry: myth | ||
args: | ||
- analyze |
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.
isn't this fairly restrictive to just one argument? Mythril has multiple commands
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.
Adding disassemble
and read-storage
might be worth it.
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.
yeah... didn't want to add a hook for each possible command ... all subcommands can be selected via setting (=overwriting) args
on user side... maybe worth to add to the README
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.
added to the README
Co-authored-by: Nikhil Parasaram <tommycjniko@gmail.com>
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.
Thanks for the contribution!
This adds a
.pre-commit-hooks.yaml
(+ doc + test), which allows other projects to run Mythril via pre-commit.pre-commit became pretty popular as framework to combine linters / code-formatters via hooks across different languages. It can be enabled as actual git hook or just used by running
pre-commit run -a
. pre-commit does its own dependency management (+cashing) and installs each hook into its own isolated folder/env.pre-commit installs a hook by cloning the
repo
, checking out the specified gitrev
(=tag, branch, commit hash), parsing the .pre-commit-hooks.yaml and installing the hook (install method depending on the hook type).Tested also via my Mythril fork, see dbast/sol-press#17
Requires a new tagged release after the PR merge to be able to reference a tag that contains the hook definition.