fix: allow int type for truncation_limit_lines and truncation_limit_chars in TOML configs#14689
Conversation
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Thank you for working on this. I have a feeling that we can also avoid a bunch of int call and handling both int and string (or "no restriction" being encoded as either 0 or None), downstream later. We still need to take into account the public API that should keep working for string though. I didn't look too much into it, let me know if the scope become too big and necessitate another PR.
|
Also we'd need a changelog for that I think. |
9af050a to
69302f5
Compare
|
I have added a changelog entry as requested. Please review again. |
|
@Pierre-Sassoulas Thank you for the thorough review. I agree the scope here is limited - the fix is intentionally minimal (just adding the changelog entry for the int type support). If a larger refactoring of the truncation config handling is needed, that would indeed be a separate PR. Happy to adjust if you have specific changes in mind. |
|
The actual changes disapeared and there's only the changelog now afaics |
|
Thanks for the review @Pierre-Sassoulas! You're right — we can handle both int and string downstream to avoid repeated int() calls. I'll expand the scope to:
I'll update the PR with the broader fix. Let me know if the scope gets too big and needs splitting. |
|
Let's do this. |
@Pierre-Sassoulas you're most likely not talking to a human there. Unless you insist on spending more time on this, I'd propose nuking the clanker 😉 |
|
Closing in favor of #14692 |


These config options were parsed as strings, causing a TypeError when users specified integer values in pyproject.toml or pytest.toml. Using type='int' allows both string and integer values.
Fixes #14675