Merged
Conversation
Tweak newline writing logic in `use_requirements_txt` per FURB122 Make some lazy-loading expectations in the UI layer explicit via a `ruff.toml` extending config from `pyproject.toml`. Exclude this via hatch config from builds. Comply with RUF 043 via raw-strings in pytest `match=` arguments Migrate to new recommended `ruff-check` hook name in `ruff-pre-commit` instead of just `ruff` simpliciter
Closed
…le level in the UI layer
CodSpeed Performance ReportMerging #1094 will not alter performanceComparing Summary
Footnotes |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the project from Ruff 0.11.5 to 0.14.3, applying several code quality improvements triggered by new linter rules in the updated version. The changes address raw string usage in regex patterns, import organization to satisfy lazy-loading requirements, and file iteration optimizations.
- Migrated Ruff version from 0.11.5 to 0.14.3
- Added raw string prefixes to regex patterns in pytest
match=parameters per RUF043 - Refactored lazy imports to module-level imports with explicit configuration per PLC0415
- Optimized file writing logic using
writelinesinstead of loop per FURB122
Reviewed Changes
Copilot reviewed 30 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Updated Ruff dependency to 0.14.3, enabled PLC0415 rule, added PT rule ignore for non-test files, configured hatch to exclude ruff.toml from builds |
.pre-commit-config.yaml |
Updated Ruff pre-commit hook version and migrated from ruff to ruff-check hook name |
src/usethis/_ui/ruff.toml |
New Ruff configuration extending main config with banned module-level imports for UI layer |
src/usethis/_ui/interface/*.py |
Moved usethis._config imports from lazy to module-level across all interface files |
src/usethis/_tool/impl/pytest.py |
Added PLC0415 noqa comment for circular import avoidance |
src/usethis/_tool/impl/coverage_py.py |
Added PLC0415 noqa comments for circular import avoidance |
src/usethis/_core/tool.py |
Replaced loop-based file writing with writelines for requirements.txt generation |
tests/usethis/test_deps.py |
Added raw string prefix to regex pattern in pytest.raises match parameter |
tests/usethis/_integrations/pre_commit/test_pre_commit_io_.py |
Added raw string prefix to regex pattern in pytest.raises match parameter |
tests/usethis/_integrations/file/yaml/test_yaml_io_.py |
Added raw string prefixes to regex patterns in pytest.raises match parameters |
tests/usethis/_integrations/file/toml/test_toml_io_.py |
Added raw string prefixes to regex patterns in pytest.raises match parameters |
tests/usethis/_integrations/file/ini/test_ini_io_.py |
Added raw string prefix to regex pattern in pytest.raises match parameter |
tests/usethis/_integrations/ci/bitbucket/test_steps.py |
Renamed unused err variable to _err |
tests/usethis/_core/test_core_tool.py |
Renamed unused err variable to _err |
tests/usethis/_core/test_author.py |
Added raw string prefixes to regex patterns in pytest.raises match parameters |
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.
Tweak newline writing logic in
use_requirements_txtper FURB122Make some lazy-loading expectations in the UI layer explicit via a
ruff.tomlextending config frompyproject.toml. Exclude this via hatch config from builds.Comply with RUF 043 via raw-strings in pytest
match=argumentsMigrate to new recommended
ruff-checkhook name inruff-pre-commitinstead of justruffsimpliciter