-
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.
Currently this only provides the feature to auto-update the versions in the `Cargo.toml` files. With the move to Josh, a command to get beta and stable release commits will be added.
- Loading branch information
Showing
7 changed files
with
55 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::fmt::Write; | ||
use std::path::Path; | ||
|
||
use crate::utils::{UpdateMode, clippy_version, replace_region_in_file}; | ||
|
||
const CARGO_TOML_FILES: [&str; 4] = [ | ||
"clippy_config/Cargo.toml", | ||
"clippy_lints/Cargo.toml", | ||
"clippy_utils/Cargo.toml", | ||
"Cargo.toml", | ||
]; | ||
|
||
pub fn bump_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(); | ||
}, | ||
); | ||
} | ||
} |
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