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

refactor: ignore formatter stderr #31

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: ignore formatter stderr
  • Loading branch information
hougesen committed Mar 8, 2024
commit 70fbf7fbb5424be67f33ef2f42520892a9546b3c
7 changes: 6 additions & 1 deletion src/formatters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ pub fn read_snippet(file_path: &std::path::Path) -> std::io::Result<String> {

#[inline]
pub fn execute_command(cmd: &mut Command) -> std::io::Result<bool> {
Ok(cmd.stdout(Stdio::null()).spawn()?.wait()?.success())
Ok(cmd
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()?
.wait()?
.success())
}

#[inline]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod error;
pub mod formatters;
pub mod languages;

#[inline]
pub fn format_file(config: &MdsfConfig, path: &std::path::Path) -> Result<(), MdsfError> {
println!("Formatting {path:#?}");

Expand Down
Loading