-
Notifications
You must be signed in to change notification settings - Fork 24
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
✨ Added warning when pushing sensitive files #73
Conversation
It seems that we differ in fmt settings? cause i see there are many changes on how the imports are done? |
src/lib.rs
Outdated
let path_buf = PathBuf::from(&path); | ||
|
||
// Check for sensitive files or directories | ||
if utils::check_for_sensitive_files_or_directories_recursive(&path_buf) { |
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.
just import this so you can use it check_for_sensitive_files_or_directories_recursive
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 don't get what you mean here
src/lib.rs
Outdated
let _ = remove_dir_all(&test_dir); | ||
|
||
// Restore the original prompt function | ||
// utils::prompt_user_for_confirmation = original_prompt; |
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.
is this needed?
src/utils.rs
Outdated
// Function to check for the presence of sensitive files or directories | ||
pub fn check_for_sensitive_files_or_directories(path: &Path) -> bool { | ||
let env_file_exists = path.join(".env").exists(); | ||
let git_dir_exists = path.join(".git").exists(); |
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.
maybe we can just look for any .file
we have? and just display them all?
And let the user decide if it's safe?
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.
cause it may be more .
files
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.
Makes sense yeah.
Crap, you are totally right, my bad. Will fix and PR again. PS: Also saw the rest of the comments you made. |
src/lib.rs
Outdated
let path_buf = PathBuf::from(&path); | ||
|
||
// Check for sensitive files or directories | ||
if utils::check_for_sensitive_files_or_directories_recursive(&path_buf) { |
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.
if utils::check_for_sensitive_files_or_directories_recursive(&path_buf) { | |
if check_for_sensitive_files_or_directories_recursive(&path_buf) { |
Sorry i just meant like this.
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.
also the name is a bit tbh, can we work on something smaller?
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.
Oh ok I get you now, also, yeah the name is way too descriptive XD
you have to run and Cause the CI fails |
Ok I see, sorry for all the inconveniences this PR is causing first of all. Also wanted to ask, when running warning: this function depends on never type fallback being `()`
--> src/dependency_downloader.rs:18:1
|
18 | / pub async fn download_dependencies(
19 | | dependencies: &[Dependency],
20 | | clean: bool,
21 | | ) -> Result<(), DownloadError> {
| |______________________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: std::iter::FromIterator<()>` will fail
--> src/dependency_downloader.rs:35:16
|
35 | .collect::<Result<_, _>>()?;
| ^^^^^^^^^^^^
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default The rest of the warnings are resolved and also ran the I will push again and await your feedback once more. Again sorry to bother this much with such a minor PR. |
ah no worries at all, thank you for taking the time to get this done. |
Sure, will solve it asap |
actually i m gonna solve them cause it seems there are more now after I did an update. will solve then if everything is ok I m gonna merge this one |
It no longer pops any warnings. |
As discussed in here for issue #67, added a user warning when pushing .env or .git/
PS: Missing tests, looking forward to feedback.