Skip to content

maintenance: run the lint step under bash so failures are not discarded on Windows - #893

Merged
adbar merged 1 commit into
adbar:masterfrom
igorsaevets:ci/lint-step-shell-bash
Jul 29, 2026
Merged

maintenance: run the lint step under bash so failures are not discarded on Windows#893
adbar merged 1 commit into
adbar:masterfrom
igorsaevets:ci/lint-step-shell-bash

Conversation

@igorsaevets

Copy link
Copy Markdown
Contributor

On windows-latest the Lint and format check step reports success even when ruff check fails.

The step runs two commands in one run: block. With no shell: key GitHub uses pwsh on Windows, and the step's exit status is taken from $LASTEXITCODE of the last command only. ruff format --check passes, so a preceding ruff check failure is discarded. On Linux and macOS the same block runs under bash -e and stops at the first failure.

This has already happened here. Run 30165454624 (2026-07-25, before #892): every ubuntu and macos job failed at that step, while build (windows-latest, 3.11) reported success. Its log reads

Found 103 errors.
41 files already formatted

A/B check on a fork of this repo. Same deliberate F401 in trafilatura/utils.py in both arms; the only difference is the workflow.

build (windows-latest, 3.11) the other 8 jobs
workflow unchanged pass, 3m09s — run 30405779646 fail
with shell: bash fail, 31s — run 30405781648 fail

The 3m09s is the Windows job discarding the lint failure and going on to run the full test suite. The 31s is it stopping at the lint step, like every other runner.

bash ships on GitHub's Windows images, so nothing else needs to change. If you would rather not depend on that, splitting the step into two run: steps fixes it just as well and gives each command its own entry in the UI. Happy to redo it that way, or to close this if you would rather handle it differently.

This is latent today: with #892 merged, ruff check . passes on master. It matters the next time lint actually fails.

…ed on Windows

The 'Lint and format check' step runs two commands in one run: block. With no
shell: key GitHub uses pwsh on Windows, where the step's exit status comes from
$LASTEXITCODE of the last command only. 'ruff format --check' passes, so a
preceding 'ruff check' failure is discarded and the job reports success. On
Linux and macOS the same block runs under 'bash -e' and aborts on the first
failure.

Observed in run 30165454624 (2026-07-25, before adbar#892): every ubuntu and macos
job failed at this step, while build (windows-latest, 3.11) reported success.
Its log contains 'Found 103 errors.' immediately followed by '41 files already
formatted'.

Setting shell: bash gives all three runners the same behaviour.
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (467fdb3) to head (f326e1d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #893   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files          21       21           
  Lines        4099     4099           
=======================================
  Hits         4086     4086           
  Misses         13       13           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adbar

adbar commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Good catch, thanks.

@adbar
adbar merged commit f9ae913 into adbar:master Jul 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants