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.
Motivation
With fixing #242, we will need to have variable-content messages based on whether we are using
srclayout, we would haveAnd without it we might have
I don't like that logic living in the
usethis/_core/tool.pyfile 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_usemethod in theToolprotocol and use it to simplify the code inusethis/_core/tool.py.