mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Make working with codegen less annoying
We probably should look into removing `xtask codegen` altogether. The test workflow works perfectly for package.json config. There are two things preventing that: * Lint completions are generated on demand. * Docs are not committed to the repository.
This commit is contained in:
parent
071dde1c1d
commit
0f6f458cc1
3 changed files with 25 additions and 21 deletions
|
@ -89,11 +89,16 @@ fn run_rustfmt(mode: Mode) -> Result<()> {
|
|||
let _dir = pushd(project_root())?;
|
||||
let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
|
||||
ensure_rustfmt()?;
|
||||
let check = match mode {
|
||||
Mode::Overwrite => &[][..],
|
||||
Mode::Verify => &["--", "--check"],
|
||||
match mode {
|
||||
Mode::Overwrite => cmd!("cargo fmt").run()?,
|
||||
Mode::Ensure => {
|
||||
let res = cmd!("cargo fmt -- --check").run();
|
||||
if !res.is_ok() {
|
||||
let _ = cmd!("cargo fmt").run();
|
||||
}
|
||||
res?;
|
||||
}
|
||||
};
|
||||
cmd!("cargo fmt {check...}").run()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue