Skip to content
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

contract / core-eval builder filename convention #10490

Open
dckc opened this issue Nov 15, 2024 · 0 comments
Open

contract / core-eval builder filename convention #10490

dckc opened this issue Nov 15, 2024 · 0 comments
Labels
code-style defensive correctness patterns; readability thru consistency enhancement New feature or request needs-design technical-debt

Comments

@dckc
Copy link
Member

dckc commented Nov 15, 2024

What is the Problem Being Solved?

We have dozens of builder scripts that use writeCoreEval and get invoked as agoric run SCRIPT.
They're pretty formulaic... we might even be able to apply helpful lint rules like we have for *.flows.js.
A filename convention for that would help.

The closest thing we have to a convention currently is init-*.js, but they do more building than initializing.

inventory of builder script filename prefixes
$ cd agoric-sdk/packages/builders/scripts
$ grep -rl writeCore . | xargs -I {} basename {} | sed -E 's/^([a-z]+).*$/\1/' | sort | uniq -c
      5 add
      1 append
      3 build
      1 fix
     12 init
      1 invite
      1 price
      1 probe
      5 replace
      5 restart
      1 revive
      5 start
      2 test
      1 tweak
      6 update
      7 upgrade
      1 write

Description of the Design

*.contract.js is an emerging trend. *.start.js for core-eval has some appeal.

Perhaps *.build.js for this?

Security / Scaling / Upgrade Considerations

not much. Might help a bit with upgrade code consistency.

Test Plan

Existing tests should suffice, though there's a risk of filename references that aren't tested and aren't detected by static analysis.

@dckc dckc added enhancement New feature or request needs-design code-style defensive correctness patterns; readability thru consistency labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-style defensive correctness patterns; readability thru consistency enhancement New feature or request needs-design technical-debt
Projects
None yet
Development

No branches or pull requests

2 participants