Ver Fonte

CI: non-zero exit if cargo-derivefmt-* targets fail

A previous commit made a change to show an error message and a diff if
cargo-derivefmt check failed, but did not exit with a non-zero code,
thus allowing the failed check to pass.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Manos Pitsidianakis há 7 meses atrás
pai
commit
ece6bfc2ce
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      .gitea/Makefile.lint

+ 3 - 3
.gitea/Makefile.lint

@@ -42,7 +42,7 @@ cargo-derivefmt-melib:
 	@printf "Checking that derives are sorted alphabetically...\n"
 	cargo derivefmt --manifest-path ./melib/Cargo.toml
 	@$(GIT) checkout --quiet meli/src/conf/overrides.rs
-	@($(GIT) diff --quiet ./melib && $(GIT) diff --cached --quiet ./melib && printf "All ./melib derives are sorted alphabetically.\n") || (printf "Some derives in the ./melib crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD)
+	@($(GIT) diff --quiet ./melib && $(GIT) diff --cached --quiet ./melib && printf "All ./melib derives are sorted alphabetically.\n") || (printf "Some derives in the ./melib crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD; exit 1)
 
 .PHONY: cargo-derivefmt-meli
 cargo-derivefmt-meli:
@@ -50,7 +50,7 @@ cargo-derivefmt-meli:
 	@printf "Checking that derives are sorted alphabetically...\n"
 	cargo derivefmt --manifest-path ./meli/Cargo.toml
 	@$(GIT) checkout --quiet meli/src/conf/overrides.rs
-	@($(GIT) diff --quiet ./meli && $(GIT) diff --cached --quiet ./meli && printf "All ./meli derives are sorted alphabetically.\n") || (printf "Some derives in the ./meli crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD)
+	@($(GIT) diff --quiet ./meli && $(GIT) diff --cached --quiet ./meli && printf "All ./meli derives are sorted alphabetically.\n") || (printf "Some derives in the ./meli crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD; exit 1)
 
 .PHONY: cargo-derivefmt-tools
 cargo-derivefmt-tools:
@@ -58,4 +58,4 @@ cargo-derivefmt-tools:
 	@printf "Checking that derives are sorted alphabetically...\n"
 	cargo derivefmt --manifest-path ./tools/Cargo.toml
 	@$(GIT) checkout --quiet meli/src/conf/overrides.rs
-	@($(GIT) diff --quiet ./tools && $(GIT) diff --cached --quiet ./tools && printf "All ./tools derives are sorted alphabetically.\n") || (printf "Some derives in the ./tools crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD)
+	@($(GIT) diff --quiet ./tools && $(GIT) diff --cached --quiet ./tools && printf "All ./tools derives are sorted alphabetically.\n") || (printf "Some derives in the ./tools crate are not sorted alphabetically, see diff:\n"; $(GIT) diff HEAD; exit 1)