Add support for .coveragerc.toml #1222
Merged
nathanjmcdougall merged 3 commits intomainfrom Dec 23, 2025
Merged
Conversation
…er `pyproject.toml` instead of `.coveragerc`
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for .coveragerc.toml as a configuration file for Coverage.py, positioning it as the fallback preference after pyproject.toml but before .coveragerc. The change enables TOML-based configuration for Coverage.py in projects that don't use pyproject.toml.
Key changes:
- Introduced
CoverageRCTOMLManagerclass to handle.coveragerc.tomlfiles - Updated file preference order:
pyproject.toml→.coveragerc.toml→.coveragerc - Added comprehensive test coverage for the new file format and priority logic
- Bumped Ruff version from v0.14.9 to v0.14.10
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/usethis/_config_file.py |
Adds CoverageRCTOMLManager class and registers it in files_manager() |
src/usethis/_tool/impl/coverage_py.py |
Updates preferred file manager to return CoverageRCTOMLManager as fallback and adds .coveragerc.toml entries to all configuration items |
tests/usethis/_tool/impl/test_coverage_py.py |
Adds three new test cases validating .coveragerc.toml behavior and file priority logic |
src/usethis/_tool/impl/ruff.py |
Bumps Ruff version to v0.14.10 |
I realized this is probably unwise since this won't be available in older versions of `Coverage.py` and so this might be too soon from an ecosystem perspective. I think this is also worth making a separate ticket to discuss in more detail because the design is a bit flimsy here
CodSpeed Performance ReportMerging #1222 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.