chore(3p/nix): Enable clang-format check in derivation build

This is the easiest way to get the checks up and running for now, but
we will probably want to separate out things like this into a separate
build step in the future.

Change-Id: I8e1a1095aef09b1eee97abad5b6240bc64d14b8c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1287
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2020-07-19 17:46:42 +01:00 committed by tazjin
parent 61a7b97c39
commit 02066a4bab
3 changed files with 7 additions and 2 deletions

View file

@ -65,6 +65,7 @@ let
diffutils diffutils
dockerTools dockerTools
execline execline
fd
fetchFromGitHub fetchFromGitHub
fetchgit fetchgit
fetchurl fetchurl

View file

@ -37,9 +37,9 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
bison bison
clang-tools clang-tools
cmake cmake
pkgconfig
libxml2 libxml2
libxslt libxslt
pkgconfig
(import ./clangd.nix pkgs) (import ./clangd.nix pkgs)
]; ];
@ -67,6 +67,7 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
doInstallCheck = true; doInstallCheck = true;
installCheckInputs = with pkgs; [ installCheckInputs = with pkgs; [
fd
gtest gtest
rapidcheck rapidcheck
]; ];
@ -91,6 +92,10 @@ in pkgs.llvmPackages.libcxxStdenv.mkDerivation {
export NIX_DATA_DIR=$out/share export NIX_DATA_DIR=$out/share
export NIX_TEST_VAR=foo # this is required by a language test export NIX_TEST_VAR=foo # this is required by a language test
make test make test
# Ensure formatting is coherent, but do this after the rest of the
# tests run so that developers get all the useful feedback
fd . $src -e hh -e cc | xargs clang-format --dry-run --Werror
''; '';
preBuild = '' preBuild = ''

View file

@ -8,7 +8,6 @@
#include "libexpr/value-to-xml.hh" #include "libexpr/value-to-xml.hh"
#include "libexpr/value.hh" #include "libexpr/value.hh"
#include "libstore/store-api.hh" #include "libstore/store-api.hh"
#include "tests/dummy-store.hh" #include "tests/dummy-store.hh"
class ValueTest : public ::testing::Test { class ValueTest : public ::testing::Test {