Repository navigation
Fix CI step that silently swallows numpydoc failures - #697
wali-reheman wants to merge 5 commits into
Conversation
| ! numpydoc render numpydoc.tests.test_main._invalid_docstring | ||
| numpydoc validate numpydoc.tests.test_main._capture_stdout | ||
| echo '! numpydoc validate numpydoc.tests.test_main._docstring_with_errors' | bash | ||
| numpydoc validate numpydoc.tests.test_main._docstring_with_errors || true |
There was a problem hiding this comment.
Why || true here instead of the prefixed-! pattern above?
There was a problem hiding this comment.
you're right, ! is the pattern to use — that's what actually verifies the exit code is non-zero. || exit 1 only propagates it, and || true doesn't check it at all. the diff now uses ! (with bash -eo pipefail), so the step does assert the failure. my earlier comment described the diff as || exit 1 — that was wrong, the file uses !.
62b5377 to
664a04d
Compare
Fixes reviewer feedback (larsoner) on PR numpy#697: - Replace || true with || exit 1 so CI step properly fails when numpydoc render/validate unexpectedly succeeds - Restore ! prefix on render checks that was accidentally dropped - Add ! prefix to validate checks for consistency
Fixes reviewer feedback (larsoner) on PR numpy#697: - Replace || true with || exit 1 so CI step properly fails when numpydoc render/validate unexpectedly succeeds - Restore ! prefix on render checks that was accidentally dropped - Add ! prefix to validate checks for consistency
228380b to
1212af8
Compare
Fixes reviewer feedback (larsoner) on PR numpy#697: - Replace || true with || exit 1 so CI step properly fails when numpydoc render/validate unexpectedly succeeds - Restore ! prefix on render checks that was accidentally dropped - Add ! prefix to validate checks for consistency
1212af8 to
619e5fe
Compare
|
the |
The 'echo '! cmd' | bash' pattern was masking real numpydoc crashes because 'echo' always returns 0. Now runs directly with || true to allow expected validation failures while still catching actual crashes.
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Fixes reviewer feedback (larsoner) on PR numpy#697: - Replace || true with || exit 1 so CI step properly fails when numpydoc render/validate unexpectedly succeeds - Restore ! prefix on render checks that was accidentally dropped - Add ! prefix to validate checks for consistency
The ! prefix was causing failing numpydoc commands to return exit 0, which bypassed the || exit 1 guard entirely. Now if numpydoc render/validate fails (non-zero), the step correctly fails CI.
The `echo '! cmd' | bash` pattern always exits 0 (echo's status), so a numpydoc crash was silently ignored. Use the inline `!` form instead: it keeps the same "fail if the command unexpectedly succeeds" check while actually propagating the command's exit status. Also drops the `| bash` subshell, which was the only reason the exit code was being thrown away in the first place. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16d8f98 to
f6c3bd9
Compare
|
you're right — the happy to restructure it so the intent is clearer if you prefer, but the behaviour is the same as your suggestion. |
|
I'm a bit confused by the premise here, as in Bash I see: |
|
you're right — the premise was backwards. |
|
closing in favour of the upstream pattern — the reasoning behind the premise was wrong, as @larsoner pointed out. |
The
echo '! cmd' | bashpattern in the CLI test steps always returns 0 (echo's exit code), even when numpydoc itself crashes. This means real failures get silently swallowed.Fixed by running
! cmd || exit 1to properly fail the step when numpydoc render/validate unexpectedly succeeds.