Skip to content

Create an abstraction for a Tool's how-to-use message #318

@nathanjmcdougall

Description

@nathanjmcdougall

Motivation
With fixing #242, we will need to have variable-content messages based on whether we are using src layout, we would have

Run 'deptry src' to run deptry.

And without it we might have

Run 'deptry .' to run deptry.

I don't like that logic living in the usethis/_core/tool.py file since I'm aiming for that file to basically just be boilerplate - on that basis we could have a method to print the how-to-use message by generating it dynamically using an underlying logic instead of hard-coding it.

We also have a few helper methods already which provide different behaviour between when we are using pre-commit and when we aren't. Likewise this can go into the method.

This is also part of a more general desire to create tool abstractions and reduce the amount of bespoke config in that file.

Summary of desired enhancement
Create a print_how_to_use method in the Tool protocol and use it to simplify the code in usethis/_core/tool.py.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions