-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate to Ruff 0.14.3 #1094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to Ruff 0.14.3 #1094
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
…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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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