Skip to content

Commit

Permalink
Soft-deprecate update_check
Browse files Browse the repository at this point in the history
Setting update_check will only warn that it will be fully removed in a future version; a hard deprecation right now could cause havoc with people whose configuration sets it to true.

Refs astral-sh#2515
  • Loading branch information
akx committed Feb 3, 2023
1 parent 0f8f250 commit f732266
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 116 deletions.
25 changes: 0 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions ruff_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ serde = { version = "1.0.147", features = ["derive"] }
serde_json = { version = "1.0.87" }
similar = { version = "2.2.1" }
textwrap = { version = "0.16.0" }
update-informer = { version = "0.6.0", default-features = false, features = ["pypi"], optional = true }
walkdir = { version = "2.3.2" }
strum = "0.24.1"

Expand All @@ -60,10 +59,6 @@ assert_cmd = { version = "2.0.4" }
strum = { version = "0.24.1" }
ureq = { version = "2.5.0", features = [] }

[features]
default = ["update-informer"]
update-informer = ["dep:update-informer"]

[package.metadata.maturin]
name = "ruff"
# Setting the name here is necessary for maturin to include the package in its builds.
2 changes: 1 addition & 1 deletion ruff_cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub struct CheckArgs {
/// Exit with status code "0", even upon detecting lint violations.
#[arg(short, long, help_heading = "Miscellaneous")]
pub exit_zero: bool,
/// Enable or disable automatic update checks.
/// (Deprecated, does nothing.) Enable or disable automatic update checks.
#[arg(
long,
overrides_with("no_update_check"),
Expand Down
14 changes: 4 additions & 10 deletions ruff_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ mod diagnostics;
mod iterators;
mod printer;
mod resolve;
#[cfg(all(feature = "update-informer"))]
pub mod updates;

fn inner_main() -> Result<ExitCode> {
let mut args: Vec<_> = std::env::args_os().collect();
Expand Down Expand Up @@ -258,14 +256,10 @@ fn check(args: CheckArgs, log_level: LogLevel) -> Result<ExitCode> {
}
}

// Check for updates if we're in a non-silent log level.
#[cfg(feature = "update-informer")]
if update_check
&& !is_stdin
&& log_level >= LogLevel::Default
&& atty::is(atty::Stream::Stdout)
{
drop(updates::check_for_updates());
if update_check {
warn_user_once!(
"update-check has been removed; setting it will be an error in a future version."
);
}

if !cli.exit_zero {
Expand Down
75 changes: 0 additions & 75 deletions ruff_cli/src/updates.rs

This file was deleted.

0 comments on commit f732266

Please sign in to comment.