asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve documentation of supported arguments

WoosterInitiative opened this issue · comments

commented

I would have sworn that I've seen some of this documented before, but I can't find it.

What I specifically was looking for was the supported version flags (--py310-plus, --py311-plus, etc.). I had a typo in mine in pre-commit (--312plus), which I could have determined myself without docs, but I feel that having them documented instead of buried at the bottom of a somewhat obscure _main.py file is less than intuitive.

I'd be happy to do it myself if there isn't an objection?

there's no reason to. when you typo'd the tool spit out the answer you were looking for directly and the standard way to ask a tool what it supports is via --help

commented

Sure, but when using pre-commit, there may not be a local install to run --help with. Also, the "answer" it provided was less than helpful. Helpful messages I've seen will say things like "'--py312plus' is not a valid argument, valid choices are '--py310-plus', '--py311-plus'" etc., or perhaps point to documentation.

I guess I don't see why this is such a difficult ask. Even if the readme pointed the user to the appropriate file to avoid having to remember to update the readme every time a new option was added, that would help hapless users such as myself, I think.

I've seen will say things like "'--py312plus' is not a valid argument, valid choices are '--py310-plus', '--py311-plus'" etc

that's literally what it does

commented

that's literally what it does

Holy balls, man, I missed that somehow. Just tested by intentionally mis-typing it and it does exactly that. Sorry for the trouble!

I'm sure you can see now why I'm frustrated that you wasted both of our time on this