From b1c8ac3f736a4b1a05650867d1492beb2b875b6b Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 10 Jul 2026 12:16:21 -0600 Subject: [PATCH 1/2] fix(nix): skip flaky nixpkgs pre-commit test_output_isatty on darwin nixpkgs' pre-commit derivation runs its own upstream pytest suite in checkPhase, and test_output_isatty forks a pty-backed subprocess that is racy under the sandboxed, multi-threaded macOS builders (see the 'use of fork() may lead to deadlocks' DeprecationWarning in the test output). It fails intermittently on macos-latest CI runners even though the built pre-commit binary works fine, and is not caused by any change in this repo: the same nixpkgs-4.5.1 derivation succeeded in other jobs of the same CI run. Override pkgs.pre-commit on darwin to add that one test to disabledTests (matching the pattern nixpkgs itself already uses for other known-broken darwin tests), and pass the override to git-hooks.lib.run via its package option. Linux is left untouched. Safe to drop once upstream disables or fixes the test in pkgs/by-name/pr/pre-commit/package.nix. --- flake.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/flake.nix b/flake.nix index bdeefef..d384a99 100644 --- a/flake.nix +++ b/flake.nix @@ -177,6 +177,26 @@ }, }: let + pkgs = import nixpkgs { inherit system; }; + + # nixpkgs' `pre-commit` derivation runs its own upstream pytest + # suite in `checkPhase`. `test_output_isatty` forks a pty-backed + # subprocess and is racy under the sandboxed, multi-threaded + # Darwin builders (see the "DeprecationWarning: ... use of + # fork() may lead to deadlocks" note in the test output) -- it + # fails intermittently on macOS runners even though the built + # `pre-commit` binary itself works fine. Skip just that test + # rather than the whole suite so a real regression elsewhere + # still fails CI. Safe to drop once upstream nixpkgs disables or + # fixes it: pkgs/by-name/pr/pre-commit/package.nix. + preCommitPackage = + if pkgs.stdenv.hostPlatform.isDarwin then + pkgs.pre-commit.overrideAttrs (old: { + disabledTests = (old.disabledTests or [ ]) ++ [ "test_output_isatty" ]; + }) + else + pkgs.pre-commit; + base = self.lib.mkBaseCheck { inherit system extraExcludes; }; rust = @@ -227,6 +247,7 @@ inherit src; inherit (merged) hooks; inherit (merged) excludes; + package = preCommitPackage; }; in run From bc53889457a8989d181d68d3d0d40fbe5f0d0a50 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Fri, 10 Jul 2026 12:16:31 -0600 Subject: [PATCH 2/2] fix(checks): stop failing CI over markdown table widths MD060 (table-column-style) has no config value that means 'ignore table width' -- even the default 'any' style still requires every table to consistently match one of three fixed padding conventions (aligned/compact/tight) and reports violations against whichever is the closest match. Disable it outright so hand-edited/ragged table widths never fail the build. Disabling MD060 alone isn't enough: prettier defaults to write=true here and always re-pads GFM tables to its own 'aligned' style, with no config knob to leave tables alone (a long-standing open upstream feature request). In a CI-only setup with no local pre-commit hook installed, that rewrite is an invisible diff contributors can only find by digging through the CI build log, so it looks like an opaque failure for something markdownlint no longer cares about. Exclude markdown from the prettier hook entirely; markdownlint is check-only (no --fix) and its default ruleset already flags the same style concerns (emphasis style, bullet markers, blank lines, ...) as a named, actionable rule failure instead of a silent rewrite. --- checks/base.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/checks/base.nix b/checks/base.nix index 86da128..0398e6a 100644 --- a/checks/base.nix +++ b/checks/base.nix @@ -74,6 +74,13 @@ let default: true MD013: false MD033: false + # MD060 ("table-column-style") only recognizes three fixed padding + # conventions (aligned/compact/tight) and *always* enforces one of + # them, even with `style: any` (the default) -- it just reports + # whichever style is the closest match. There is no config value that + # means "don't check table width at all", so the rule must be + # disabled outright to allow ragged/hand-edited table widths. + MD060: false ''; }; @@ -143,7 +150,23 @@ let pass_filenames = true; }; - prettier.enable = true; + prettier = { + enable = true; + # Prettier has no config option to leave table formatting alone (it's + # a long-standing, still-open upstream feature request) -- it always + # re-pads GFM tables to its "aligned" style on `--write`, silently + # rewriting files. In a CI-only setup (no local pre-commit hook) + # contributors don't see that diff except by reading CI logs, so it + # looks like an opaque failure for something markdownlint (MD060, + # disabled above) no longer cares about. + # + # Markdown is excluded here entirely rather than just tables: the + # `markdownlint` hook below is check-only (no `--fix`) and already + # enforces the same style concerns (emphasis style, bullet markers, + # blank lines, ...) via `default: true`, surfacing them as a named, + # actionable rule failure instead of a silent rewrite. + excludes = [ "\\.mdx?$" ]; + }; check-toml.enable = true; check-vcs-permalinks.enable = true;