Skip to content

usethis tool coverage breaks existing config in some cases #558

@nathanjmcdougall

Description

@nathanjmcdougall

Motivation
Reproducer:

uv init --lib
uv add --dev usethis
usethis tool codespell
usethis tool coverage

This will give the following config toward the bottom of the file:

[dependency-groups]
dev = ["codespell>=2.4.1", "usethis>=0.9.1"]
test = [
    "coverage[toml]>=7.8.0",
]

coverage.run.source = ["src"]
coverage.report.exclude_also = ["if TYPE_CHECKING:", "raise AssertionError", "raise NotImplementedError", "assert_never(.*)", "class .*\\bProtocol\\):", "@(abc\\.)?abstractmethod"]
coverage.report.omit = ["*/pytest-of-*/*"]
[tool.codespell]
ignore-regex = ["[A-Za-z0-9+/]{100,}"]

[tool.uv]
default-groups = ["test", "dev"]

Summary of desired enhancement
Test and fix the bug

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions