-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
392 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
use clap::ValueEnum; | ||
|
||
use crate::new_lint::clippy_version; | ||
use crate::update_lints::{replace_region_in_file, UpdateMode}; | ||
|
||
use std::fmt::{Display, Write}; | ||
use std::path::Path; | ||
|
||
const CARGO_TOML_FILES: [&str; 5] = [ | ||
"clippy_config/Cargo.toml", | ||
"clippy_lints/Cargo.toml", | ||
"clippy_utils/Cargo.toml", | ||
"declare_clippy_lint/Cargo.toml", | ||
"Cargo.toml", | ||
]; | ||
|
||
pub fn update_version() { | ||
let (minor, mut patch) = clippy_version(); | ||
patch += 1; | ||
for file in &CARGO_TOML_FILES { | ||
replace_region_in_file( | ||
UpdateMode::Change, | ||
Path::new(file), | ||
"# begin autogenerated version\n", | ||
"# end autogenerated version", | ||
|res| { | ||
writeln!(res, "version = \"0.{minor}.{patch}\"").unwrap(); | ||
}, | ||
); | ||
} | ||
} | ||
|
||
#[derive(ValueEnum, Copy, Clone)] | ||
pub enum Branch { | ||
Stable, | ||
Beta, | ||
Master, | ||
} | ||
|
||
impl Display for Branch { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match self { | ||
Branch::Stable => write!(f, "stable"), | ||
Branch::Beta => write!(f, "beta"), | ||
Branch::Master => write!(f, "master"), | ||
} | ||
} | ||
} | ||
|
||
pub fn rustc_clippy_commit(toolchain: Branch) { | ||
todo!("{toolchain}"); | ||
} |
Oops, something went wrong.