-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Add type annotation to main in new project template #4326
base: main
Are you sure you want to change the base?
Conversation
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. Could you update the changelog also please 🙏
compiler-cli/src/new/tests.rs
Outdated
} | ||
}); | ||
|
||
insta::glob!(&path, "my_project/**/*.gleam", |file_path| { |
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.
Sorry, what has this file been changed for?
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.
The existing snapshot tests only test the files at the top-level of the generated project. That means neither src/<my_project>.gleam
nor test/<my_project>.gleam
had a test around their content. Given that I was updating one of those files, I figured having a snapshot test would be valuable. Let me know if you'd prefer I remove this change.
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.
I see! Could you change the pattern please rather than copying the code twice with 2 different patterns 🙏
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.
Done. Note that I'm excluding hidden directories so that we don't look at contents within .git
.
d9ec3ec
to
9a35396
Compare
Done. |
95a8f4c
to
72944dd
Compare
import gleeunit/should | ||
|
||
pub fn main() { | ||
gleeunit.main() |
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.
Return annotation on the test main function too please 🙏
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.
Done.
72944dd
to
c89844f
Compare
This PR adds an annotation of
-> Nil
to themain
function created by thegleam new
command. It also adds the same annotation to themain
function inthe generated
README.md
file.I've added new snapshot tests for all
*.gleam
files created in both the erlangand javascript templates.
Fixes #4313