diff options
author | Aleksey Kladov <[email protected]> | 2021-03-08 13:35:27 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-08 18:45:06 +0000 |
commit | 0f6f458cc1b460076093efda903bf1a1b9062697 (patch) | |
tree | 2e1db2d81bc3ab3f3a954e3ea9ce7ccffca64259 /xtask/src/main.rs | |
parent | 071dde1c1da10e3580bded99dc2d529074356536 (diff) |
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.
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 3c4332f75..25fd32f92 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -89,11 +89,16 @@ fn run_rustfmt(mode: Mode) -> Result<()> { | |||
89 | let _dir = pushd(project_root())?; | 89 | let _dir = pushd(project_root())?; |
90 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); | 90 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); |
91 | ensure_rustfmt()?; | 91 | ensure_rustfmt()?; |
92 | let check = match mode { | 92 | match mode { |
93 | Mode::Overwrite => &[][..], | 93 | Mode::Overwrite => cmd!("cargo fmt").run()?, |
94 | Mode::Verify => &["--", "--check"], | 94 | Mode::Ensure => { |
95 | let res = cmd!("cargo fmt -- --check").run(); | ||
96 | if !res.is_ok() { | ||
97 | let _ = cmd!("cargo fmt").run(); | ||
98 | } | ||
99 | res?; | ||
100 | } | ||
95 | }; | 101 | }; |
96 | cmd!("cargo fmt {check...}").run()?; | ||
97 | Ok(()) | 102 | Ok(()) |
98 | } | 103 | } |
99 | 104 | ||