Unverified Commit f7beabd9 authored by Paul Meyer's avatar Paul Meyer Committed by GitHub
Browse files

gofumpt: use finalAttrs, versionCheckHook (#397908)

parents 6a6acafe d8e9ce04
Loading
Loading
Loading
Loading
+14 −18
Original line number Diff line number Diff line
@@ -3,18 +3,17 @@
  buildGoModule,
  fetchFromGitHub,
  nix-update-script,
  testers,
  gofumpt,
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "gofumpt";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "mvdan";
    repo = pname;
    rev = "v${version}";
    repo = "gofumpt";
    rev = "v${finalAttrs.version}";
    hash = "sha256-37wYYB0k8mhQq30y1oo77qW3bIqqN/K/NG1RgxK6dyI=";
  };

@@ -24,7 +23,7 @@ buildGoModule rec {

  ldflags = [
    "-s"
    "-X main.version=v${version}"
    "-X main.version=v${finalAttrs.version}"
  ];

  checkFlags = [
@@ -32,23 +31,20 @@ buildGoModule rec {
    "-skip=^TestScript/diagnose$"
  ];

  passthru = {
    updateScript = nix-update-script { };
    tests.version = testers.testVersion {
      package = gofumpt;
      version = "v${version}";
    };
  };
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
  meta = {
    description = "Stricter gofmt";
    homepage = "https://github.com/mvdan/gofumpt";
    changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${version}";
    license = licenses.bsd3;
    maintainers = with maintainers; [
    changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      rvolosatovs
      katexochen
    ];
    mainProgram = "gofumpt";
  };
}
})