-
-
Notifications
You must be signed in to change notification settings - Fork 869
feat: add empty module validation #4794
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
base: main
Are you sure you want to change the base?
feat: add empty module validation #4794
Conversation
I'm not sure about this test-wasm CI error, but checking for passed PRs like #4791 I think it may be something related to my changes so I will check it |
BTW, a good thing would be to add some files like CHANGELOG.md to not trigger all CI checks. All CI tasks are running again because I changed the CHANGELOG.md |
By checking this PR, I think I should add my changes to Unreleased? |
41e93ec
to
45590fc
Compare
Yeah! |
Hey @giacomocavalieri |
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.
Very nice! I've left some small comments inline
...ge-compiler/src/snapshots/test_package_compiler__generated_tests__erlang_app_generation.snap
Outdated
Show resolved
Hide resolved
test-package-compiler/cases/empty_module_publish_validation/gleam.toml
Outdated
Show resolved
Hide resolved
I've just updated the code @lpil |
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.
This looks almost ready! I've left one comment, and you'll need to rebase on main
to fix merge conflicts.
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.
Thank you, couple small notes inline! 🙏
Thank you guys by reviewing it again. I will back on it between today and tomorrow |
Prevent publishing packages with empty modules and emit warnings during compilation when modules contain no public definitions.
Moved from AST checking to module interface, similar to what I did on publish.rs. Also, previously the code counted public definitions from the AST and checked if the definitions list was empty. Now it directly checks if both the values and types HashMaps in the module interface are empty, as suggested by @GearsDatapacks
4d6d163
to
db68575
Compare
Fix #4093
Prevent publishing packages with empty modules and emit warnings during compilation when modules contain no public definitions.