crytic-compile
crytic-compile copied to clipboard
Justify + Nixify
Introduces 2 new files: justfile
and flake.nix
in the project root. These provide a few new commands that are helpful for developers:
-
just build
: build an executable which will be available via a symlink at./result/bin/crytic-compile
-
just install
: after building, install the built result (aka add it toPATH
) so that it's available by just typingcrytic-compile
-
just dev
: pre-packaged, hermetically sealed dev environment, no virtualenvwrapper needed. This command will open a new shell that exposes a temporary and hot-reloadablecrytic-compile
, this executable will update when the source code changes for a quick and easy tweak/check cycle. (TODO: this works nicely withnix-shell shell.nix
but is not hot-reloadable via flake.nix, I should fix this) -
just lint
: runsblack
,darglint
,mypy
, andpylint
code formatters/linters-
just black
: runs only theblack
code formatter (ditto for the other lint commands)
-
-
just test
: runs all available tests (onlyhardhat
andmonorepo
tests for now, more coming soon)-
just test-hardhat
: runs only the hardhat tests locally (also works withmonorepo
)
-
Keep in mind:
- The above commands require
nix
andjust
to be installed. Ifnix
is already installed, you can installjust
withnix-env -iA nixpkgs.just
or add it to yourconfiguration.nix
file if you're using NixOS/nix-darwin. - The above commands utilize isolated dependencies so they will not interfere with any other python tools that you've already installed via homebrew, apt, pip, virtualenvwrapper, etc.
- The prev point is nice but it has a downside: on the first run, all dependencies need to be downloaded so it will take some time and plenty of bandwidth. The second run of
just lint
should take on the order of 20 seconds and negligible bandwidth. Luckily, if some other project requires the same dependencies, they'll be cached & won't need to be downloaded again. The dependencies required to run thebuild
,dev
, andlint
commands overlap but are not identical so each one will take a while to run the first time. - The above is accomplished without modifying any of the existing configuration files. If you dislike
just
and/ornix
, ignore these few new files & continue developing as you always have, nothing else should be impacted.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
bohendo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.