feat[tool]: add -Werror and -Wnone options#4447
feat[tool]: add -Werror and -Wnone options#4447charles-cooper merged 24 commits intovyperlang:masterfrom
-Werror and -Wnone options#4447Conversation
which promote warnings to errors and ignore them, respectively. also some small refactoring for warning handling to simplify the implementation (allow us to use `warnings.simplefilter`).
-Werror and -Wnone options
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4447 +/- ##
==========================================
- Coverage 92.12% 92.06% -0.06%
==========================================
Files 119 120 +1
Lines 16962 17329 +367
Branches 2872 2932 +60
==========================================
+ Hits 15626 15954 +328
- Misses 919 957 +38
- Partials 417 418 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
let's also update the docs please |
| assert warnings_control is None # sanity | ||
| warnings_filter = "default" | ||
|
|
||
| if warnings_control is not None: |
There was a problem hiding this comment.
why not reset also for None?
There was a problem hiding this comment.
None indicates to not touch warnings settings, but resetwarnings() modifies the global filter
There was a problem hiding this comment.
what's the point of allowing None if should be nop? also, is it possible to use the compiler as a library, once providing a warnings flag, once not, and thus (incorrectly) reusing the settings from the previous run?
There was a problem hiding this comment.
what's the point of allowing None if should be nop?
the point is allowing None is it makes the signature generic, you don't need to check it in the caller
There was a problem hiding this comment.
also, is it possible to use the compiler as a library, once providing a warnings flag, once not, and thus (incorrectly) reusing the settings from the previous run?
yea -- i refactored so it restores the original warnings filter, see 4d64b86
|
as per our offline discussion we might want to propage the flags to the |
|
also there aren't any tests for exactly these scenarios - let's please add tests to cover the extensions of the |
| settings: Optional[Settings] = None, | ||
| storage_layout_paths: list[str] = None, | ||
| no_bytecode_metadata: bool = False, | ||
| warnings_control: Optional[str] = None, |
There was a problem hiding this comment.
it's used by the decorator!
There was a problem hiding this comment.
nvm, posted this before reading context
What I did
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture