|
3 | 3 | #![warn(rust_2018_idioms, unused_lifetimes)]
|
4 | 4 |
|
5 | 5 | use clap::{Args, Parser, Subcommand};
|
6 |
| -use clippy_dev::{dogfood, fmt, lint, new_lint, serve, setup, update_lints, utils}; |
| 6 | +use clippy_dev::{dogfood, fmt, lint, new_lint, serve, setup, sync, update_lints, utils}; |
7 | 7 | use std::convert::Infallible;
|
8 | 8 |
|
9 | 9 | fn main() {
|
@@ -75,6 +75,9 @@ fn main() {
|
75 | 75 | uplift,
|
76 | 76 | } => update_lints::rename(&old_name, new_name.as_ref().unwrap_or(&old_name), uplift),
|
77 | 77 | DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, &reason),
|
| 78 | + DevCommand::Sync(SyncCommand { subcommand }) => match subcommand { |
| 79 | + SyncSubcommand::UpdateNightly => sync::update_nightly(), |
| 80 | + }, |
78 | 81 | }
|
79 | 82 | }
|
80 | 83 |
|
@@ -225,6 +228,8 @@ enum DevCommand {
|
225 | 228 | /// The reason for deprecation
|
226 | 229 | reason: String,
|
227 | 230 | },
|
| 231 | + /// Sync between the rust repo and the Clippy repo |
| 232 | + Sync(SyncCommand), |
228 | 233 | }
|
229 | 234 |
|
230 | 235 | #[derive(Args)]
|
@@ -291,3 +296,16 @@ enum RemoveSubcommand {
|
291 | 296 | /// Remove the tasks added with 'cargo dev setup vscode-tasks'
|
292 | 297 | VscodeTasks,
|
293 | 298 | }
|
| 299 | + |
| 300 | +#[derive(Args)] |
| 301 | +struct SyncCommand { |
| 302 | + #[command(subcommand)] |
| 303 | + subcommand: SyncSubcommand, |
| 304 | +} |
| 305 | + |
| 306 | +#[derive(Subcommand)] |
| 307 | +enum SyncSubcommand { |
| 308 | + #[command(name = "update_nightly")] |
| 309 | + /// Update nightly version in rust-toolchain and `clippy_utils` |
| 310 | + UpdateNightly, |
| 311 | +} |
0 commit comments