In src/usethis/_file/toml/io_.py and src/usethis/_file/yaml/io_.py, the remove_from_list method silently returns when it encounters invalid config (e.g., a non-dict parent or non-list value at the target key). The user receives no feedback that their configuration was ignored.
We should call warn_print to inform the user that invalid config was detected and skipped, using the error messages already provided via the err= arguments to validate_or_raise.
Affected files:
src/usethis/_file/toml/io_.py (lines ~429-440)
src/usethis/_file/yaml/io_.py (lines ~457-468)
This is a pre-existing issue that predates the validate_or_raise refactoring — the original code also silently returned on invalid config.
In
src/usethis/_file/toml/io_.pyandsrc/usethis/_file/yaml/io_.py, theremove_from_listmethod silently returns when it encounters invalid config (e.g., a non-dict parent or non-list value at the target key). The user receives no feedback that their configuration was ignored.We should call
warn_printto inform the user that invalid config was detected and skipped, using the error messages already provided via theerr=arguments tovalidate_or_raise.Affected files:
src/usethis/_file/toml/io_.py(lines ~429-440)src/usethis/_file/yaml/io_.py(lines ~457-468)This is a pre-existing issue that predates the validate_or_raise refactoring — the original code also silently returned on invalid config.