mirror of https://github.com/astral-sh/ruff
Disable panic hook about reporting issues for debug builds
In order to avoid confusing new developers. When a debug build panics chances are that the panic is caused by local changes and should in fact not be reported on GitHub.
This commit is contained in:
parent
cd3d82213a
commit
39d98d3488
|
|
@ -58,6 +58,8 @@ fn inner_main() -> Result<ExitCode> {
|
|||
log_level_args,
|
||||
} = Args::parse_from(args);
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
let default_panic_hook = std::panic::take_hook();
|
||||
std::panic::set_hook(Box::new(move |info| {
|
||||
eprintln!(
|
||||
|
|
@ -72,6 +74,7 @@ quoting the executed command, along with the relevant file contents and `pyproje
|
|||
);
|
||||
default_panic_hook(info);
|
||||
}));
|
||||
}
|
||||
|
||||
let log_level: LogLevel = (&log_level_args).into();
|
||||
set_up_logging(&log_level)?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue