Allow int for max_warnings in TOML - #14954
Conversation
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Looks reasonable thank you.
|
Thanks. I tested the current head,
I have three questions:
|
|
Addressed in f4d3a6c.
|
|
Thanks. I reran This resolves the discrepancies identified in the comparison above. |
|
Addressed in f4d3a6c. Amine confirmed base behavior is preserved and native TOML int 0 still works. Ready for another look. |
0b7c71f to
de7bf7f
Compare
bluetech
left a comment
There was a problem hiding this comment.
Thanks. I made some tweaks.
(@Pierre-Sassoulas I kept a test otherwise we won't have coverage for the branch.)
The max_warnings option was registered without a type (defaulting to 'string'), so integer values in native TOML config raised a TypeError. It is now registered with type=int | str, accepting both int and string values in TOML while keeping the string form working for backward compatibility. An explicit integer 0 is distinguished from the unset default. Co-authored-by: Cursor Grok 4.6 <cursoragent@cursor.com>
de7bf7f to
ee08c00
Compare
Closes #14953
max_warningswas registered without a type, so native TOML integers (max_warnings = 0) were rejected even though the docs show an unquoted int.Register it as
int | strthe same way astruncation_limit_*._get_max_warnings()treatsNoneas unset so an explicit0is not the empty default.Checklist
closes #14953in the PR description and the commit.changelog/14953.bugfix.rst.AUTHORSin alphabetical order.Co-authored-bytrailer.