From 3e9aa7722d87d1e6fee2f88267f10b0c4903ab12 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 19 Jan 2022 21:23:36 +0300 Subject: [PATCH] refactor(depotfmt): Move formatting check into an extra step Change-Id: I7e4cf6bb2351bd11a5396f1663c0d4cc97c0d94e Reviewed-on: https://cl.tvl.fyi/c/depot/+/5009 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: grfn Reviewed-by: ezemtsov --- ops/pipelines/depot.nix | 9 +-------- tools/depotfmt.nix | 6 +++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ops/pipelines/depot.nix b/ops/pipelines/depot.nix index 232d229b9..036ddada0 100644 --- a/ops/pipelines/depot.nix +++ b/ops/pipelines/depot.nix @@ -11,17 +11,10 @@ let label = ":water_buffalo:"; }; - # Formatting check which validates that all supported auto-formatted - # files are formatted correctly. See //tools/depotfmt for details. - depotfmtCheck = { - command = "${depot.tools.depotfmt.check}"; - label = ":evergreen_tree: (tools/depotfmt)"; - }; - pipeline = depot.nix.buildkite.mkPipeline { headBranch = "refs/heads/canon"; drvTargets = depot.ci.targets; - additionalSteps = [ depotfmtCheck protoCheck ]; + additionalSteps = [ protoCheck ]; parentTargetMap = if (externalArgs ? parentTargetMap) then builtins.fromJSON (builtins.readFile externalArgs.parentTargetMap) diff --git a/tools/depotfmt.nix b/tools/depotfmt.nix index 312ef3f8d..8c8e99c08 100644 --- a/tools/depotfmt.nix +++ b/tools/depotfmt.nix @@ -35,5 +35,9 @@ let --tree-root . ''; in depotfmt.overrideAttrs(_: { - passthru.check = check; + passthru.meta.ci.extraSteps.check = { + label = "depot formatting check"; + command = check; + alwaysRun = true; + }; })