mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
2e327bd4fe
Diff: https://github.com/errata-ai/vale/compare/v3.7.1...v3.8.0 Changelog: https://github.com/errata-ai/vale/releases/tag/v3.8.0
66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
makeBinaryWrapper,
|
|
symlinkJoin,
|
|
vale,
|
|
valeStyles,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "vale";
|
|
version = "3.8.0";
|
|
|
|
subPackages = [ "cmd/vale" ];
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "errata-ai";
|
|
repo = "vale";
|
|
rev = "v${version}";
|
|
hash = "sha256-0opa8F0cpC0uh51JDgofxl6e0oecxgkEufnLfxtkaOw=";
|
|
};
|
|
|
|
vendorHash = "sha256-EWAgzb3ruxYqaP+owcyGDzNnkPDYp0ttHwCgNXuuTbk=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-X main.version=${version}"
|
|
];
|
|
|
|
# Tests require network access
|
|
doCheck = false;
|
|
|
|
passthru.withStyles =
|
|
selector:
|
|
symlinkJoin {
|
|
name = "vale-with-styles-${vale.version}";
|
|
paths = [ vale ] ++ selector valeStyles;
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
postBuild = ''
|
|
wrapProgram "$out/bin/vale" \
|
|
--set VALE_STYLES_PATH "$out/share/vale/styles/"
|
|
'';
|
|
meta = {
|
|
inherit (vale.meta) mainProgram;
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
description = "Syntax-aware linter for prose built with speed and extensibility in mind";
|
|
longDescription = ''
|
|
Vale in Nixpkgs offers the helper `.withStyles` allow you to install it
|
|
predefined styles:
|
|
|
|
```nix
|
|
vale.withStyles (s: [ s.alex s.google ])
|
|
```
|
|
'';
|
|
homepage = "https://vale.sh/";
|
|
changelog = "https://github.com/errata-ai/vale/releases/tag/v${version}";
|
|
mainProgram = "vale";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ pbsds ];
|
|
};
|
|
}
|