do not allow stage > 0 on x fmt
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
3ef8e64ce9
commit
34c42c8f31
1 changed files with 6 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ use std::sync::mpsc::SyncSender;
|
|||
use build_helper::git::get_git_modified_files;
|
||||
use ignore::WalkBuilder;
|
||||
|
||||
use crate::core::builder::Builder;
|
||||
use crate::core::builder::{Builder, Kind};
|
||||
use crate::utils::build_stamp::BuildStamp;
|
||||
use crate::utils::exec::command;
|
||||
use crate::utils::helpers::{self, t};
|
||||
|
|
@ -122,6 +122,11 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) {
|
|||
}
|
||||
|
||||
pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
|
||||
if build.kind == Kind::Format && build.top_stage != 0 {
|
||||
eprintln!("ERROR: `x fmt` only supports stage 0.");
|
||||
crate::exit!(1);
|
||||
}
|
||||
|
||||
if !paths.is_empty() {
|
||||
eprintln!(
|
||||
"fmt error: path arguments are no longer accepted; use `--all` to format everything"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue