Watch
0
0
Fork
You've already forked hyperhive
0

treefmt covers python with ruff-format and ruff-check, ruff in the dev shell

This commit is contained in:
atlas 2026-11-11 21:49:21 +01:00 • committed by mara
commit f2e735a98f
5 changed files with 8 additions and 17 deletions

View file

@ -99,19 +99,6 @@ jobs:
fi fi
echo "$files" | xargs nix develop -c shellcheck -S warning echo "$files" | xargs nix develop -c shellcheck -S warning
ruff-vm-tests:
name: ruff (vm-tests)
if: vars.PUBLIC_FORGE != 'true'
runs-on: ${{ vars.PUBLIC_FORGE == 'true' && 'nixos' || 'hive-ci' }}
steps:
- uses: actions/checkout@v3
- name: lint
# ruff from this flake's nixpkgs pin, as the jq job does. The config in
# nix/vm-tests/ruff.toml names the globals the test driver provides.
run: |
nix shell --inputs-from . nixpkgs#ruff --command sh -c \
'ruff check nix/vm-tests && ruff format --check nix/vm-tests'
prose-lint: prose-lint:
name: prose lint (vale) name: prose lint (vale)
if: vars.PUBLIC_FORGE != 'true' if: vars.PUBLIC_FORGE != 'true'

View file

@ -129,9 +129,10 @@ Nix interpolation. Commands the script runs in the VM find their binaries on the
node's `environment.systemPackages`. Build-time values (socket path, forge node's `environment.systemPackages`. Build-time values (socket path, forge
domain, store paths) arrive as `FULL_SETUP_*` environment variables, set in domain, store paths) arrive as `FULL_SETUP_*` environment variables, set in
`nix/vm-tests/full-setup.nix` through `overrideTestDerivation`. To add a value, `nix/vm-tests/full-setup.nix` through `overrideTestDerivation`. To add a value,
set one there and read it with `os.environ` in the script. The `ruff (vm-tests)` set one there and read it with `os.environ` in the script. `nix fmt` formats and lints the Python (treefmt's
job checks and format-checks `nix/vm-tests/*.py`; `nix/vm-tests/ruff.toml` names `ruff-format` and `ruff-check`, which fixes what it can), and the `formatting`
the globals the test driver provides. flake check fails on a file `nix fmt` would change. `nix/vm-tests/ruff.toml`
names the globals the test driver provides.
## Configuration reference ## Configuration reference

View file

@ -458,7 +458,7 @@ nix fmt # treefmt — authoritative, NOT bare cargo fmt
`nix fmt` (treefmt) is the formatter CI gates on; bare `cargo fmt` `nix fmt` (treefmt) is the formatter CI gates on; bare `cargo fmt`
misses the non-rust files treefmt also covers, so always run `nix misses the non-rust files treefmt also covers, so always run `nix
fmt` before pushing. fmt` before pushing. It also formats and lints Python with ruff.
**Clippy discipline — never add `#[allow(clippy::…)]`.** All lints are **Clippy discipline — never add `#[allow(clippy::…)]`.** All lints are
CI-fatal at `-D warnings` (pedantic included); every warning that fires CI-fatal at `-D warnings` (pedantic included); every warning that fires

View file

@ -20,6 +20,7 @@
cargo cargo
cargo-llvm-cov cargo-llvm-cov
clippy clippy
ruff
rust-analyzer rust-analyzer
rustc rustc
rustfmt rustfmt

View file

@ -6,6 +6,8 @@
keep-sorted.enable = true; keep-sorted.enable = true;
nixfmt.enable = true; nixfmt.enable = true;
prettier.enable = true; prettier.enable = true;
ruff-check.enable = true;
ruff-format.enable = true;
rustfmt.enable = true; rustfmt.enable = true;
taplo.enable = true; taplo.enable = true;
}; };