Skip to content

Simplify lint deprecation #13180

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

Merged
merged 3 commits into from
Aug 5, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5830,6 +5830,7 @@ Released 2018-09-13
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
[`reverse_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#reverse_range_loop
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
Expand Down
4 changes: 2 additions & 2 deletions clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn main() {
new_name,
uplift,
} => update_lints::rename(&old_name, new_name.as_ref().unwrap_or(&old_name), uplift),
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, reason.as_deref()),
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, &reason),
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ enum DevCommand {
name: String,
#[arg(long, short)]
/// The reason for deprecation
reason: Option<String>,
reason: String,
},
}

Expand Down
8 changes: 7 additions & 1 deletion clippy_dev/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use std::process::Command;
use std::time::{Duration, SystemTime};
use std::{env, thread};

#[cfg(windows)]
const PYTHON: &str = "python";

#[cfg(not(windows))]
const PYTHON: &str = "python3";

/// # Panics
///
/// Panics if the python commands could not be spawned
Expand All @@ -23,7 +29,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
}
if let Some(url) = url.take() {
thread::spawn(move || {
Command::new("python3")
Command::new(PYTHON)
.arg("-m")
.arg("http.server")
.arg(port.to_string())
Expand Down
Loading
Loading