Skip to content

ci: treat warnings as errors to prevent accumulation#2926

Merged
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:ci_warnings_as_errors
Dec 23, 2025
Merged

ci: treat warnings as errors to prevent accumulation#2926
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:ci_warnings_as_errors

Conversation

@EwoutH
Copy link
Copy Markdown
Member

@EwoutH EwoutH commented Dec 4, 2025

Summary

Configure CI to treat all warnings as errors (except PendingDeprecationWarning) to prevent warning accumulation and enforce immediate fixes.

Motive

Mesa recently had 1,514 warnings across 366 tests, creating technical debt and degrading developer experience. While significant cleanup has reduced this to ~22 warnings, we need to prevent regression.

Without enforcement, warnings slowly accumulate as contributors add code that triggers new warnings. By the time someone notices, hundreds of warnings have built up, making cleanup overwhelming. Treating warnings as errors catches issues immediately at PR time when they're easiest to fix.

Implementation

Added -Werror -Wdefault::PendingDeprecationWarning flags to pytest in both CI jobs:

  • -Werror: Converts all warnings to errors, failing the build
  • -Wdefault::PendingDeprecationWarning: Exempts PendingDeprecationWarning, as listed in our deprecation policy.

This means DeprecationWarning, FutureWarning, UserWarning, and RuntimeWarning will now fail CI, forcing contributors to fix them before merging.

Simplified the examples job configuration to match the main build job for consistency.

@EwoutH EwoutH requested a review from quaquel December 4, 2025 20:47
@EwoutH EwoutH added the ci Release notes label label Dec 4, 2025
@EwoutH
Copy link
Copy Markdown
Member Author

EwoutH commented Dec 18, 2025

Tomorrow I might be committing to this.

@EwoutH EwoutH force-pushed the ci_warnings_as_errors branch from 9e91d5e to dc9080b Compare December 23, 2025 17:39
Configure pytest to fail CI on any warnings except PendingDeprecationWarning.
This prevents the codebase from accumulating warnings like the 1500+ we
recently had to clean up.

- Add -Werror flag to pytest in both build and examples jobs
- Add -Wdefault::PendingDeprecationWarning to keep these as warnings
- Simplify examples job warning configuration for consistency
@EwoutH EwoutH force-pushed the ci_warnings_as_errors branch from dc9080b to 77c031f Compare December 23, 2025 18:18
@EwoutH EwoutH merged commit 605e3ff into mesa:main Dec 23, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant