diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 0d63e35d5..7780893d7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -99,19 +99,6 @@ jobs: fi 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: name: prose lint (vale) if: vars.PUBLIC_FORGE != 'true' diff --git a/docs/4-implementation/scheduler/ci.md b/docs/4-implementation/scheduler/ci.md index 43299d379..dcc943203 100644 --- a/docs/4-implementation/scheduler/ci.md +++ b/docs/4-implementation/scheduler/ci.md @@ -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 domain, store paths) arrive as `FULL_SETUP_*` environment variables, set in `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)` -job checks and format-checks `nix/vm-tests/*.py`; `nix/vm-tests/ruff.toml` names -the globals the test driver provides. +set one there and read it with `os.environ` in the script. `nix fmt` formats and lints the Python (treefmt's +`ruff-format` and `ruff-check`, which fixes what it can), and the `formatting` +flake check fails on a file `nix fmt` would change. `nix/vm-tests/ruff.toml` +names the globals the test driver provides. ## Configuration reference diff --git a/docs/5-project/process/conventions.md b/docs/5-project/process/conventions.md index e961a4ba7..50678737f 100644 --- a/docs/5-project/process/conventions.md +++ b/docs/5-project/process/conventions.md @@ -458,7 +458,7 @@ nix fmt # treefmt — authoritative, NOT 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 -fmt` before pushing. +fmt` before pushing. It also formats and lints Python with ruff. **Clippy discipline — never add `#[allow(clippy::…)]`.** All lints are CI-fatal at `-D warnings` (pedantic included); every warning that fires diff --git a/nix/devshell.nix b/nix/devshell.nix index 215b27366..019bd02b2 100644 --- a/nix/devshell.nix +++ b/nix/devshell.nix @@ -20,6 +20,7 @@ cargo cargo-llvm-cov clippy + ruff rust-analyzer rustc rustfmt diff --git a/nix/treefmt.nix b/nix/treefmt.nix index 1924f0c13..9e3d90c03 100644 --- a/nix/treefmt.nix +++ b/nix/treefmt.nix @@ -6,6 +6,8 @@ keep-sorted.enable = true; nixfmt.enable = true; prettier.enable = true; + ruff-check.enable = true; + ruff-format.enable = true; rustfmt.enable = true; taplo.enable = true; };