Unverified Commit 9e828616 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #331346 from yurrriq/fix-revive

revive: ensure go on PATH, re-enable tests
parents e700287f bec48839
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
{ buildGoModule, fetchFromGitHub, lib }:
{ buildGoModule, fetchFromGitHub, go, lib, makeWrapper }:

buildGoModule rec {
  pname = "revive";
@@ -33,16 +33,14 @@ buildGoModule rec {
    ldflags+=" -X 'github.com/mgechev/revive/cli.date=$(cat DATE)'"
  '';

  # The following tests fail when built by nix:
  #
  # $ nix log /nix/store/build-revive.1.3.9.drv | grep FAIL
  #
  # --- FAIL: TestAll (0.01s)
  # --- FAIL: TestTimeEqual (0.00s)
  # --- FAIL: TestTimeNaming (0.00s)
  # --- FAIL: TestUnhandledError (0.00s)
  # --- FAIL: TestUnhandledErrorWithBlacklist (0.00s)
  doCheck = false;
  allowGoReference = true;

  nativeBuildInputs = [ makeWrapper ];

  postFixup = ''
    wrapProgram $out/bin/revive \
      --prefix PATH : ${lib.makeBinPath [ go ]}
  '';

  meta = with lib; {
    description = "Fast, configurable, extensible, flexible, and beautiful linter for Go";