Skip to content

Several `pyproject.toml settings are sensitive to trailing comma #18623

Description

@sobolevn

See #18621 (comment)

Basically, all settings that use try_split are affected:

"packages": try_split,
"modules": try_split,
}
# Reuse the ini_config_types and overwrite the diff
toml_config_types: Final[dict[str, _INI_PARSER_CALLABLE]] =ini_config_types.copy()
toml_config_types.update(
{
"python_version": parse_version,
"mypy_path": lambdas: [expand_path(p) forpintry_split(s, "[,:]")],
"files": lambdas: split_and_match_files_list(try_split(s)),
"junit_format": lambdas: check_junit_format(str(s)),
"follow_imports": lambdas: check_follow_imports(str(s)),
"plugins": try_split,
"always_true": try_split,
"always_false": try_split,
"untyped_calls_exclude": lambdas: validate_package_allow_list(try_split(s)),
"enable_incomplete_feature": try_split,
"disable_error_code": lambdas: validate_codes(try_split(s)),
"enable_error_code": lambdas: validate_codes(try_split(s)),
"package_root": try_split,
"exclude": str_or_array_as_list,
"packages": try_split,
"modules": try_split,
}
)

I am working on a fix.

Metadata

Metadata

Assignees

Labels

bugmypy got something wrongtopic-configurationConfiguration files and flags

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions