From 81a8702fd9021d2887d3a04a6d81db9fafc606f2 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 26 Jul 2024 17:43:38 +0900 Subject: [PATCH] textlint-rule-prh: init at 6.0.0 --- pkgs/by-name/te/textlint-rule-prh/package.nix | 63 +++++++++++++++++++ pkgs/by-name/te/textlint-rule-prh/test.md | 1 + pkgs/by-name/te/textlint-rule-prh/textlintrc | 7 +++ pkgs/by-name/te/textlint/package.nix | 2 + 4 files changed, 73 insertions(+) create mode 100644 pkgs/by-name/te/textlint-rule-prh/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-prh/test.md create mode 100644 pkgs/by-name/te/textlint-rule-prh/textlintrc diff --git a/pkgs/by-name/te/textlint-rule-prh/package.nix b/pkgs/by-name/te/textlint-rule-prh/package.nix new file mode 100644 index 000000000000..349946cbcc84 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-prh/package.nix @@ -0,0 +1,63 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + fetchYarnDeps, + nodejs, + npmHooks, + yarnBuildHook, + yarnConfigHook, + runCommand, + textlint, + textlint-rule-prh, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "textlint-rule-prh"; + version = "6.0.0"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-prh"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-K2WkHh7sLnhObM2ThvdXVbZymLInjSB6XTshxALotKU="; + }; + + postPatch = '' + substituteInPlace package.json \ + --replace-fail "git config --local core.hooksPath .githooks" "" + ''; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-tZMMadWue85L+5c7swKgFqUsLSARjS4EK0Cwi1FjX88="; + }; + + nativeBuildInputs = [ + nodejs + npmHooks.npmInstallHook + yarnBuildHook + yarnConfigHook + ]; + + passthru.tests = { + "textlint-rule-prh-test" = + runCommand "textlint-rule-prh-test" + { nativeBuildInputs = [ (textlint.withPackages [ textlint-rule-prh ]) ]; } + '' + substitute ${./textlintrc} .textlintrc \ + --subst-var-by textlint_rule_prh "${textlint-rule-prh}" + + grep prh <(textlint ${./test.md}) > $out + ''; + }; + + meta = { + description = "Textlint rule for prh"; + homepage = "https://github.com/textlint-rule/textlint-rule-prh"; + changelog = "https://github.com/textlint-rule/textlint-rule-prh/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + platforms = textlint.meta.platforms; + }; +}) diff --git a/pkgs/by-name/te/textlint-rule-prh/test.md b/pkgs/by-name/te/textlint-rule-prh/test.md new file mode 100644 index 000000000000..84d3c98dfd12 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-prh/test.md @@ -0,0 +1 @@ +オープンソースソフトウェア diff --git a/pkgs/by-name/te/textlint-rule-prh/textlintrc b/pkgs/by-name/te/textlint-rule-prh/textlintrc new file mode 100644 index 000000000000..4f9b96404e0e --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-prh/textlintrc @@ -0,0 +1,7 @@ +{ + "rules": { + "prh": { + "rulePaths": [ "@textlint_rule_prh@/lib/node_modules/textlint-rule-prh/node_modules/prh/prh-rules/media/WEB+DB_PRESS.yml" ] + } + } +} diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 4a4eb75c5055..ce22941b3115 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -17,6 +17,7 @@ textlint-rule-no-start-duplicated-conjunction, textlint-rule-period-in-list-item, textlint-rule-preset-ja-technical-writing, + textlint-rule-prh, textlint-rule-stop-words, textlint-rule-terminology, textlint-rule-unexpanded-acronym, @@ -117,6 +118,7 @@ buildNpmPackage rec { textlint-rule-no-start-duplicated-conjunction textlint-rule-period-in-list-item textlint-rule-preset-ja-technical-writing + textlint-rule-prh textlint-rule-stop-words textlint-rule-terminology textlint-rule-unexpanded-acronym