forked from extendr/extendr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xtask: added
extendrtests
to the check-fmt
.
Added a `cargo extendr fmt` that formats `extendr`-crates and `extendrtests`.
- Loading branch information
Showing
5 changed files
with
29 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use xshell::{cmd, Error, Shell}; | ||
|
||
pub(crate) fn run(shell: &Shell) -> Result<(), Error> { | ||
// extendr-api, extendr-macros, extendr-engine, xtask | ||
cmd!(shell, "cargo fmt --all").run()?; | ||
// extendrtests | ||
cmd!( | ||
shell, | ||
"cargo fmt --all --manifest-path tests/extendrtests/src/rust/Cargo.toml" | ||
) | ||
.run()?; | ||
|
||
Ok(()) | ||
} |
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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
use xshell::{cmd, Error, Shell}; | ||
|
||
pub(crate) fn run(shell: &Shell) -> Result<(), Error> { | ||
let check_result = cmd!(shell, "cargo fmt -- --check").run(); | ||
if check_result.is_err() { | ||
println!("Please run `cargo fmt --all`"); | ||
let check_extendr = cmd!(shell, "cargo fmt --all -- --check").run(); | ||
|
||
let check_extendrtests = cmd!( | ||
shell, | ||
"cargo fmt --all --manifest-path tests/extendrtests/src/rust/Cargo.toml -- --check" | ||
) | ||
.run(); | ||
|
||
if check_extendr.is_err() || check_extendrtests.is_err() { | ||
println!("Please run `cargo extendr fmt`"); | ||
} else { | ||
println!("Success!"); | ||
} | ||
|
||
check_result | ||
check_extendr | ||
} |
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