Add comprehensive Python warning types and exclude-warning option to warning-checker#202
Add comprehensive Python warning types and exclude-warning option to warning-checker#202
Conversation
- Updated default warnings to include all Python warning types - Added UserWarning, PendingDeprecationWarning, RuntimeWarning, ImportWarning, UnicodeWarning, BytesWarning, ResourceWarning, EncodingWarning - Updated documentation and examples to reflect new comprehensive defaults - Added test case for new warning types detection - Maintains backward compatibility with existing configurations Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
UserWarning to warning-checker default config
|
|
@jstac all warnings will be checked once this is merged :-) |
|
Perfect, thanks @mmcky |
|
@copilot thanks for these changes. It would be nice to have an option |
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
I've implemented the New Capabilities:
Usage Examples: # Exclude problematic upstream warnings temporarily
- uses: QuantEcon/meta/.github/actions/check-warnings@main
with:
exclude-warning: 'UserWarning,RuntimeWarning'
fail-on-warning: 'true'The feature maintains full backward compatibility and includes comprehensive test coverage. Documentation has been updated in README.md and examples.md with practical usage scenarios. Commit: c731460 |
This comment was marked as outdated.
This comment was marked as outdated.
|
@copilot the test sets are failing for |
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Fixed the failing tests! The issue was in the test HTML file structure causing duplicate warning detections. Problem: Tests were expecting 1 instance per warning type but finding 2, causing all exclude-warning tests to fail. Solution: Simplified Changes in commit 2c1ddde:
The warning-checker CI tests should pass on the next run. |
|
|
Tested against https://github.com/QuantEcon/lecture-python.myst/pull/529/files This is doing a great job of checking against ALL python warnings by |
This PR expands the warning-checker action's default configuration to include all standard Python warning types and adds a new
exclude-warningparameter for granular control over warning detection.Problem
The current default configuration only checked for 3 warning types:
This missed important warnings like
UserWarning, which was specifically causing issues in documentation builds:Additionally, there was no way to temporarily exclude specific warning types when dealing with upstream issues that take time to fix.
Solution
1. Comprehensive Warning Coverage
Updated the default configuration to include all Python warning types:
2. New
exclude-warningParameterAdded flexible exclusion capability for temporary workarounds:
Key Features
exclude-warningparameter for excluding specific warningsUse Cases
The
exclude-warningfeature is particularly useful for:Changes Made
action.ymlImpact
Fixes #201.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.