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

feat(cli): Implement mun new and mun init #246

Merged
merged 4 commits into from
Jul 21, 2020
Merged

Conversation

eopb
Copy link
Contributor

@eopb eopb commented Jul 18, 2020

closes #237

The cargo implementation was used as a reference.

Note

I did not do anything to fetch information about the project author.

Cargo uses the function https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_new.rs#L773.

I could copy it over almost line for line but that feels a little weird. Maybe I should create a small crate for it. Do you think that would be a good idea?

@eopb eopb closed this Jul 18, 2020
@eopb eopb reopened this Jul 18, 2020
@codecov
Copy link

codecov bot commented Jul 18, 2020

Codecov Report

Merging #246 into master will increase coverage by 0.05%.
The diff coverage is 62.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #246      +/-   ##
==========================================
+ Coverage   78.86%   78.91%   +0.05%     
==========================================
  Files         196      201       +5     
  Lines       12626    12667      +41     
==========================================
+ Hits         9957     9996      +39     
- Misses       2669     2671       +2     
Impacted Files Coverage Δ
crates/mun/src/ops/language_server.rs 0.00% <0.00%> (ø)
crates/mun/src/ops/start.rs 0.00% <0.00%> (ø)
crates/mun/src/ops/new.rs 60.00% <60.00%> (ø)
crates/mun/src/ops/build.rs 73.58% <73.58%> (ø)
crates/mun/src/lib.rs 88.23% <100.00%> (+36.13%) ⬆️
crates/mun/src/ops/init.rs 100.00% <100.00%> (ø)
crates/mun/tests/integration.rs 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13e4464...043a181. Read the comment docs.

@eopb
Copy link
Contributor Author

eopb commented Jul 19, 2020

Note: I decided to not initialize git to keep this PR as simple as possible. I will probably add that feature in a later PR.

Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! The functionality looks good to me! Doing the author detection and source control stuff in another PR also sounds great! creating a crate for author detection is even better! Give back to the community when you can. :)

There are a few changes that I would like to see:

  • The Conventional Commit convention states to add the scope between parenthesis, there is also no need for a . at the end, and the first letter should be lowercased. So feat: mun-new: Add mun new subcommand. should be feat(mun-new): add mun new subcommand. Could you modify your commit messages?

  • Your changes have a coverage of 8%. Could you maybe add a test to validate that after a new or init a project is actually created?

Finally, a suggestion:

  • It might be better to move some of the functionality to a new file.

crates/mun/src/lib.rs Outdated Show resolved Hide resolved
crates/mun/src/lib.rs Outdated Show resolved Hide resolved
crates/mun/src/lib.rs Outdated Show resolved Hide resolved
@eopb
Copy link
Contributor Author

eopb commented Jul 19, 2020

Done.

@Wodann Wodann changed the title feat: mun-new: Implement mun new and mun init feat(cli): Implement mun new and mun init Jul 20, 2020
Copy link
Collaborator

@Wodann Wodann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making improvements so quickly. I found one more typo in your latest changes. Other than that it looks good as far as I am concerned.

I'll also leave this for @baszalmstra to approve as he requested some more changes than me. I would ask you to clean up the commit history. Our contributing guide explains how you can do this, but feel free to directly ping me if you have any questions!

@baszalmstra
Copy link
Collaborator

Yes! Looks good to me as well, if you can clean up your history a little bit, Ill merge this. :)

@eopb
Copy link
Contributor Author

eopb commented Jul 20, 2020

Done

@Wodann
Copy link
Collaborator

Wodann commented Jul 21, 2020

Thanks for rebasing. A much cleaner history now; very pleasing 🙂

@Wodann Wodann merged commit 415bbbf into mun-lang:master Jul 21, 2020
@eopb eopb deleted the mun-new branch July 21, 2020 12:56
@baszalmstra
Copy link
Collaborator

Relates to #203

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement mun new and mun init
3 participants