Compare commits
7 changed files with 22 additions and 86 deletions
|
|
@ -68,7 +68,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
# jq isn't a project dependency elsewhere in this repo — same
|
# jq isn't a project dependency elsewhere in this repo — same
|
||||||
# nix-shell-for-one-tool shape.
|
# nix-shell-for-one-tool shape the vale jobs below use.
|
||||||
run: nix shell --inputs-from . nixpkgs#jq --command sh scripts/check-dashboard-descriptions.sh
|
run: nix shell --inputs-from . nixpkgs#jq --command sh scripts/check-dashboard-descriptions.sh
|
||||||
|
|
||||||
dashboard-service-names:
|
dashboard-service-names:
|
||||||
|
|
@ -88,7 +88,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
# `nix develop` enters the whole devshell for this one tool, which pins
|
# `nix develop` enters the whole devshell for this one tool, which pins
|
||||||
# shellcheck to flake.lock, as the jq job does with `--inputs-from .`.
|
# shellcheck to flake.lock, as the vale and jq jobs do with `--inputs-from .`.
|
||||||
#
|
#
|
||||||
# By shebang, not a `*.sh` glob — scripts/pre-push has no suffix.
|
# By shebang, not a `*.sh` glob — scripts/pre-push has no suffix.
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -106,11 +106,11 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
# The vale binary is this flake's `.#vale`, the same one the devshell has.
|
# The vale binary comes from flake.lock (`--inputs-from .`), like the devshell's.
|
||||||
# The package carries the pinned styles (nix/packages/vale.nix).
|
# Styles are fetched fresh from Vale Package Hub each run (not vendored).
|
||||||
# Not wired into branch protection — see prose-lint-errors below for the
|
# Not wired into branch protection — see prose-lint-errors below for the
|
||||||
# error-only slice that is.
|
# error-only slice that is.
|
||||||
run: nix run --inputs-from . .#vale -- docs
|
run: XDG_DATA_HOME="$PWD/.vale-data" nix shell --inputs-from . nixpkgs#vale --command sh -c 'vale sync && vale docs'
|
||||||
|
|
||||||
prose-lint-errors:
|
prose-lint-errors:
|
||||||
name: prose lint (vale, errors)
|
name: prose lint (vale, errors)
|
||||||
|
|
@ -121,4 +121,4 @@ jobs:
|
||||||
- name: lint
|
- name: lint
|
||||||
# Error-level-only slice. Split out so this job alone can be a required
|
# Error-level-only slice. Split out so this job alone can be a required
|
||||||
# check without blocking merges on the warning/suggestion backlog.
|
# check without blocking merges on the warning/suggestion backlog.
|
||||||
run: nix run --inputs-from . .#vale -- --minAlertLevel=error docs
|
run: XDG_DATA_HOME="$PWD/.vale-data" nix shell --inputs-from . nixpkgs#vale --command sh -c 'vale sync && vale --minAlertLevel=error docs'
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -4,3 +4,5 @@
|
||||||
/.tmp
|
/.tmp
|
||||||
/.claude/settings.local.json
|
/.claude/settings.local.json
|
||||||
*.rlib
|
*.rlib
|
||||||
|
# `vale sync` fetches these fresh into place; not vendored (see .vale.ini).
|
||||||
|
/.vale-data
|
||||||
|
|
|
||||||
12
.vale.ini
12
.vale.ini
|
|
@ -1,7 +1,13 @@
|
||||||
# `StylesPath` is not set here: the `vale` package in nix/packages/vale.nix
|
# `vale sync`'s destination isn't actually governed by this path -- it
|
||||||
# prepends it, pointing at the pinned styles in nix/packages/vale-styles.nix.
|
# always writes under `$XDG_DATA_HOME/vale/styles` (undocumented, confirmed
|
||||||
# A style enabled below must also be listed there.
|
# by testing: neither this file's discovery nor `--config` affects it). Set
|
||||||
|
# `XDG_DATA_HOME=$PWD/.vale-data` before running `vale sync`/`vale docs` so
|
||||||
|
# both commands agree on the same repo-local, gitignored location.
|
||||||
|
StylesPath = .vale-data/vale/styles
|
||||||
MinAlertLevel = warning
|
MinAlertLevel = warning
|
||||||
|
# `vale sync` reads this to know what to fetch from the Hub at CI time --
|
||||||
|
# styles are fetched fresh each run, not vendored into the repo.
|
||||||
|
Packages = Microsoft, alex, write-good
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
BasedOnStyles = Microsoft, alex, write-good
|
BasedOnStyles = Microsoft, alex, write-good
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@
|
||||||
rustc
|
rustc
|
||||||
rustfmt
|
rustfmt
|
||||||
shellcheck
|
shellcheck
|
||||||
# The pinned-styles `vale` the two "prose lint (vale)" CI jobs run
|
# The two "prose lint (vale)" CI jobs run vale over docs/. `vale
|
||||||
# (nix/packages/vale.nix), with the pinned styles built in.
|
# sync` must run once before `vale docs` and writes styles to
|
||||||
(pkgs.callPackage ./packages/vale.nix { })
|
# $XDG_DATA_HOME, so point that at the repo like CI does:
|
||||||
|
# `XDG_DATA_HOME=$PWD/.vale-data nix develop -c sh -c 'vale sync && vale docs'`.
|
||||||
|
vale
|
||||||
]);
|
]);
|
||||||
|
|
||||||
# `cargo llvm-cov` shells out to `llvm-profdata` and `llvm-cov`,
|
# `cargo llvm-cov` shells out to `llvm-profdata` and `llvm-cov`,
|
||||||
|
|
|
||||||
|
|
@ -276,10 +276,6 @@ in
|
||||||
# is exposed too since it's independently useful/inspectable.
|
# is exposed too since it's independently useful/inspectable.
|
||||||
inherit swagger-ui-dist swagger-ui-theme;
|
inherit swagger-ui-dist swagger-ui-theme;
|
||||||
|
|
||||||
# `vale` preconfigured with .vale.ini and the pinned style packages
|
|
||||||
# (./vale.nix, ./vale-styles.nix); the prose-lint CI jobs and the devshell run it.
|
|
||||||
vale = pkgs.callPackage ./vale.nix { };
|
|
||||||
|
|
||||||
# REA and the Ghidra it needs; consumed by nix/agent-modules/rea.nix.
|
# REA and the Ghidra it needs; consumed by nix/agent-modules/rea.nix.
|
||||||
rea = pkgs.callPackage ./rea.nix { };
|
rea = pkgs.callPackage ./rea.nix { };
|
||||||
ghidra-12-1 = pkgs.callPackage ./ghidra-12-1.nix { };
|
ghidra-12-1 = pkgs.callPackage ./ghidra-12-1.nix { };
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
fetchzip,
|
|
||||||
runCommand,
|
|
||||||
}:
|
|
||||||
|
|
||||||
# The Vale style packages named in `.vale.ini`, fetched at build time and
|
|
||||||
# laid out as Vale expects a `StylesPath`: `<out>/<Package>/<rule>.yml`.
|
|
||||||
# Each is the release asset `vale sync` would download, pinned to a tag and
|
|
||||||
# hash so a lint run makes no network request and every caller sees the
|
|
||||||
# same rules. Bumping a style means changing its `tag` and `hash` here.
|
|
||||||
let
|
|
||||||
styles = {
|
|
||||||
Microsoft = {
|
|
||||||
tag = "v0.15.1";
|
|
||||||
hash = "sha256-NqH69LL8aKMqyoo5qWi/hFAkYA4WL7OCfTpPwR907vU=";
|
|
||||||
};
|
|
||||||
alex = {
|
|
||||||
tag = "v0.2.3";
|
|
||||||
hash = "sha256-YvNfhjCg437wDMxnOqu9xTKq82KZfQt9HvCpoDfwsL4=";
|
|
||||||
};
|
|
||||||
write-good = {
|
|
||||||
tag = "v0.4.1";
|
|
||||||
hash = "sha256-XhvZtirGg9Vl/i73HMyZpK2iSoQoXv8OS7ckryveIdU=";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch =
|
|
||||||
name:
|
|
||||||
{ tag, hash }:
|
|
||||||
fetchzip {
|
|
||||||
url = "https://github.com/vale-cli/${name}/releases/download/${tag}/${name}.zip";
|
|
||||||
inherit hash;
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
runCommand "vale-styles" { } ''
|
|
||||||
mkdir -p $out
|
|
||||||
${lib.concatStrings (lib.mapAttrsToList (name: s: "ln -s ${fetch name s} $out/${name}\n") styles)}
|
|
||||||
''
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
vale,
|
|
||||||
runCommand,
|
|
||||||
makeWrapper,
|
|
||||||
callPackage,
|
|
||||||
}:
|
|
||||||
|
|
||||||
# `vale` with the repo's `.vale.ini` and the pinned styles from
|
|
||||||
# ./vale-styles.nix baked in, so `vale docs` works from the repo root without
|
|
||||||
# any setup step. CI, the devshell and local runs all
|
|
||||||
# take this one binary. `.vale.ini` carries no `StylesPath`; the wrapper's
|
|
||||||
# generated config prepends the store path to the file's contents.
|
|
||||||
let
|
|
||||||
styles = callPackage ./vale-styles.nix { };
|
|
||||||
config = runCommand "vale.ini" { } ''
|
|
||||||
{ echo "StylesPath = ${styles}"; cat ${../../.vale.ini}; } > $out
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
runCommand "vale-${vale.version}-hyperhive"
|
|
||||||
{
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
meta = {
|
|
||||||
description = "vale preconfigured with the repo's .vale.ini and pinned style packages";
|
|
||||||
mainProgram = "vale";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
''
|
|
||||||
makeWrapper ${lib.getExe vale} $out/bin/vale --add-flags "--config ${config}"
|
|
||||||
''
|
|
||||||
Loading…
Reference in a new issue