Robin Bowes

Results 42 comments of Robin Bowes

Ugh, found a problem. I tried adding this to allow the common options to be specified before the command: ``` @app.callback() @from_city def main( ctx: typer.Context, ) -> None: #...

I'm using something similar to the previous example to share options. Here's a contrived example: ``` from datetime import datetime from types import SimpleNamespace from typing import Annotated, Optional import...

I tried this: ``` def make_date_option(help="Enter a date"): return Annotated[ Optional[datetime], typer.Option( formats=["%Y-%m-%d"], help=help, ), ], @app.command() def main( start_date: make_date_option(help="Start date") = None, end_date: make_date_option(help="End date") = None, ):...

> I think you have a comma left-over in the end of the make_date_option(). Good spot, but I think that's a copy/paste error and not the source of the F722...

> I have many shared options, as per your options.start_date and .end_date. Do you think it's worth the effort to organise them thematically using the SimpleNamespace() like you do? This...

I'm still trying to figure out a workable solution to this. I created this gist to demonstrate a minimal example that doesn't quite work: https://gist.github.com/robinbowes/fa815f2c0576fc6c76409ff3ba31b407 The common_opts approach *sort of*...

I have not yet added any tests. I am happy to do so if this change is likely to be accepted.

Apologies for the delay - my branch is now up-to-date.

> @robinbowes looks like some tests are failing. If you could take care of them before the end of the month I'll make sure to include these changes in the...

We're hitting the same problem. This secret is not detected: ``` env: APIKEY: 550e7956f012f471d91a126c635add67 ``` This secret *is* detected: ``` env: APIKEY: "550e7956f012f471d91a126c635add67" ``` If I scan the string directly,...