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 --config-dir support to shellclear cli #40
add --config-dir support to shellclear cli #40
Conversation
Signed-off-by: bshuster <bshuster@quotient.com>
shellclear/src/config.rs
Outdated
@@ -28,6 +28,17 @@ impl Default for Config { | |||
} | |||
} | |||
|
|||
impl From<Option<&str>> for Config { | |||
fn from(config_dir_path_option: Option<&str>) -> Self { |
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.
Naming: you can just use config_dir
as the parameter name
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.
@jondot thanks for your review.
I updated the variable name and fixed the linting issue by running cargo fmt
as you suggested.
I wonder if I can auto-format rust code in vscode
(I installed rust-analyzer
plugin).
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.
Yes, add the following
Format all languages on save:
"editor.formatOnSave": true,
For rust, use the rust-analyzer
formatter:
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
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 also briefly updated the README file.
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.
Thanks, rust code is now auto-formatted on vscode
😆
@boaz-quotient I've approved running CI, you can take a look at the linting results for example, which might hint your editor isn't using |
Signed-off-by: bshuster <bshuster@quotient.com>
Codecov Report
@@ Coverage Diff @@
## main #40 +/- ##
==========================================
- Coverage 65.74% 65.24% -0.51%
==========================================
Files 17 17
Lines 1559 1571 +12
==========================================
Hits 1025 1025
- Misses 534 546 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: bshuster <bshuster@quotient.com>
Sorry for these chaotic updates. I changed the unit tests to use snapshot + added one more unit test (hopefully this will make the coverage happy) |
No worries, everything looks good to me 👍 |
@jondot "ein bha-ya". No worries it's alright. I personally enjoyed practicing Rust on this project. Thanks for the opportunity. |
Thanks, @boaz-quotientm bumped a new version 0.4.1/ Thanks @jondot for the backup :) |
I am not sure if this exists or is unnecessary but I couldn't figure out how to set the configuration files directory through the CLI and I want to save it in a different location than
homedir
.So I decided to add this to the code, let me know if that works out for you.
Thanks.