Skip to content

Conversation

@nathanjmcdougall
Copy link
Collaborator

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

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
@nathanjmcdougall nathanjmcdougall linked an issue Nov 5, 2025 that may be closed by this pull request
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 5, 2025

CodSpeed Performance Report

Merging #1094 will not alter performance

Comparing 1092-enable-plc-ruff-rules (572cc39) with main (1a413d7)1

Summary

✅ 2 untouched

Footnotes

  1. No successful run was found on main (9a9a663) during the generation of this report, so 1a413d7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review November 5, 2025 12:03
Copy link
Contributor

Copilot AI left a 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 writelines instead 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

@nathanjmcdougall nathanjmcdougall merged commit cd89644 into main Nov 5, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1092-enable-plc-ruff-rules branch November 5, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable PLC Ruff rules

2 participants