feat(cli): exit codes - #52
Conversation
|
I think what's cool about passing data into So something like Self::PathNotFound { path } => {
println!("Path {} does not exist.", path.to_string_lossy());
ExitCode::from(1)
}
Self::LintStats {
run_duration,
number_of_diagnostics,
} => {
if number_of_files == 0 {
println!("No files found.");
ExitCode::from(0)
} else {
...Because once we get multiple commands such as |
Let me guess it wants you to do |
I think this sounds good, or you can print them in the |
That makes sense, let me try to refactor that
TIL, will fix
Yep, makes sense |
|
This kind of Rust takes a while, but I think you are getting the hang of it, I hope you are having fun! |
cb25dbe to
0ff8140
Compare
For sure, this is great practice 🙂 I think I covered all the review feedback, could you take another look and let me know what you think? Thanks! |
0ff8140 to
4d05e08
Compare
|
Do you mind squash and rebase your commits? It's almost ready to go! |
db654ae to
1324019
Compare
|
When you get a "[Merge branch 'main' into feat/exit-codes]" commit, it means you haven't pulled the main branch yet so git start merging your branch. Can you try: |
1324019 to
12aeea4
Compare
|
Sorry, I had to update my fork, should be rebased correctly now |
12aeea4 to
6a825fe
Compare
chore: remove foo.js chore: review comments chore: shut clippy up chore: ran cargo fmt chore: unnecessary return
6a825fe to
220204d
Compare
|
You may want to setup auto format, it's better than what we have in js ;-) |
|
Thank you! |
|
Thanks for bearing with me! 🙂 Would love to hack on something else if you have any other good first issues popping up! |
Checkout all the issues I created :-) |
Alright, I took a stab at implementing #50
Some things of interest:
lintandlint_pathmethods a little bit to access the diagnostics inmain.rsprintln!()inmain.rs, but I dont know how to make it happy 🙃lib.rs, I get a compiler warning that thepathanddiagnosticsnever get used, even though I assign them in line 35 inCli, I'm guessing thats because thediagnosticalready gets printed inlint_path, maybe I should move the printing of the diagnostics over tomain.rsas well? What do you think?