Skip to content

Update print_how_to_use for all tools to use new `get_install_metho…#814

Merged
nathanjmcdougall merged 4 commits intomainfrom
802-print_how_to_use-could-give-misleading-message-regarding-pre-commit
Jun 28, 2025
Merged

Update print_how_to_use for all tools to use new `get_install_metho…#814
nathanjmcdougall merged 4 commits intomainfrom
802-print_how_to_use-could-give-misleading-message-regarding-pre-commit

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

…d` method for determining the approach to recommend for using the tool

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jun 28, 2025

CodSpeed WallTime Performance Report

Merging #814 will not alter performance

Comparing 802-print_how_to_use-could-give-misleading-message-regarding-pre-commit (262721b) with main (ca3e8e7)

Summary

✅ 2 untouched benchmarks

…o_use` (i.e. prefer using directly rather than via pre-commit; less verbose and more consistent behaviour viz. other tools)
@nathanjmcdougall nathanjmcdougall requested a review from Copilot June 28, 2025 03:00
Copy link
Copy Markdown
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 updates the print_how_to_use methods across multiple tools to use the new get_install_method approach for determining the recommended usage. In addition, the tests have been updated to use more explicit pre-commit config content rather than merely touching files.

  • Updated test files with explicit pre-commit YAML configurations.
  • Updated tool implementation files (Ruff, RequirementsTxt, PyprojectFmt, ImportLinter, Deptry) to use the get_install_method result.
  • Adjusted expected command output strings in core tests to match the new command format.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/usethis/_tool/impl/test_requirements_txt.py Uses write_text for generating explicit pre-commit config YAML.
tests/usethis/_tool/impl/test_import_linter.py Updates pre-commit config generation for the import linter tool.
tests/usethis/_core/test_core_tool.py Adjusts expected output for the import-linter command message.
tests/usethis/_core/test_core_ci.py Replaces file touches with explicit configuration content.
src/usethis/_tool/impl/ruff.py Refactors print_how_to_use to use get_install_method for command logic.
src/usethis/_tool/impl/requirements_txt.py Implements new installation method detection in print_how_to_use.
src/usethis/_tool/impl/pyproject_fmt.py Uses get_install_method to change how commands are printed.
src/usethis/_tool/impl/import_linter.py Applies new get_install_method logic to determine command output.
src/usethis/_tool/impl/deptry.py Updates print_how_to_use to incorporate new installation method logic.

@nathanjmcdougall nathanjmcdougall merged commit 2af33db into main Jun 28, 2025
18 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 802-print_how_to_use-could-give-misleading-message-regarding-pre-commit branch June 28, 2025 03:02
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.

print_how_to_use could give misleading message regarding pre-commit

2 participants