coreth icon indicating copy to clipboard operation
coreth copied to clipboard

Convert import script to a go test

Open JonathanOppenheimer opened this issue 3 months ago • 1 comments

Why this should be merged

This closes #813:

The shell script ./scripts/lint_allowed_eth_imports.sh is getting rather complex and hard to understand, we should migrate it to use Go as a test, especially now that we have getDependencies code which can easily be adapted for this use case.

I was unable to adapt the getDependencies() function to work properly with ignoring _ imports and imports that start with eth, but I did massively improve the test, and this now catches some imports that the shell script did not.

I will remove getDependencies() in the next PR anyway.

Sample:

Screenshot 2025-10-20 at 11 58 32 AM

How this works

How this was tested

The new TestLibevmImportsAreAllowed test

Need to be documented?

No

Need to update RELEASES.md?

No

JonathanOppenheimer avatar Oct 17 '25 18:10 JonathanOppenheimer

This is blocked by #1349 and #1350

JonathanOppenheimer avatar Oct 17 '25 20:10 JonathanOppenheimer

Thanks for the review @alarso16 !

JonathanOppenheimer avatar Nov 07 '25 18:11 JonathanOppenheimer

@maru-ava Talked to Cey about this - he wanted to get your opinion on this. Also wanted to clarify whether this is or is not a hard requirement for the coreth monorepo.

JonathanOppenheimer avatar Nov 12 '25 15:11 JonathanOppenheimer

@maru-ava Talked to Cey about this - he wanted to get your opinion on this. Also wanted to clarify whether this is or is not a hard requirement for the coreth monorepo.

Not a hard requirement, but it can't hurt.

maru-ava avatar Nov 18 '25 16:11 maru-ava