You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a second look, I think target is always a directory here, so scratch that last part of my comment.
Unrelated to this PR, but I think the check here may be a bit off, wouldn't it make more sense to look for the foundry/etc project in the path of the file rather than in cwd? e.g. if the file is /a/b/c/d/contracts/foo.sol, I'd check to see if any of [/a/b/c/d/contracts, /a/b/c/d, /a/b/c, /a/b, /a, /] is a project. Most users are probably going to be running the tool with cwd=the project folder, so it may work as-is now, but it doesn't feel completely correct.
config_root = self._working_dir
while os.path.realpath(config_root) != os.path.realpath("/"):
platform_wd = next(
(
p(target)
for p in get_platforms()
if p.is_supported(str(config_root), **kwargs)
),
None,
)
if platform_wd:
break
config_root = os.path.dirname(config_root)
We should search for the config file before falling back to best-effort, standard json compilation here:
Unrelated to this PR, but I think the check here may be a bit off, wouldn't it make more sense to look for the foundry/etc project in the path of the file rather than in cwd? e.g. if the file is /a/b/c/d/contracts/foo.sol, I'd check to see if any of [/a/b/c/d/contracts, /a/b/c/d, /a/b/c, /a/b, /a, /] is a project. Most users are probably going to be running the tool with cwd=the project folder, so it may work as-is now, but it doesn't feel completely correct.
Originally posted by @elopez in #515 (comment)
Something like this:
We should search for the config file before falling back to best-effort, standard json compilation here:
crytic-compile/crytic_compile/crytic_compile.py
Line 719 in 3a4b0de
The text was updated successfully, but these errors were encountered: