flake8
flake8 copied to clipboard
Display list of available formatters with help for --format
In GitLab by @blueyed on Apr 26, 2018, 03:32
flake8 --help contains:
--format=format Format errors according to the chosen formatter.
It would be nice/helpful if the list of available formats would be listed there.
In GitLab by @Ruairidh on May 13, 2020, 09:01
Is this request still viable? I may have time to take a look.
In GitLab by @asottile on May 13, 2020, 13:38
yep! this shouldn't be too difficult to handle -- basically you'll iterate through the available formatter plugins and add that to the help text
you can look at how the code for --version works to see how plugin collection works
In GitLab by @Ruairidh on May 13, 2020, 15:00
First attempt at this here. I had to move the register_default_options call to after the plugins are registered -- not sure if that's the preferred method though.
Hi @asottile Is this one still relevant and available? In case it is I would like to try to contribute :)
yep still needs doing -- @rkm might've been working on this so maybe take a look at the progress they made above
I don't remember if I made any progress after this. Feel free to pick it up!
Cool, tnx!
Just want to verify that I got the idea - so the idea is to update help output for --format to something like:
--format format Format errors according to the chosen formatter. Available formatters: x, y, z
Please just confirm if above is correct, also if you have any high level info on how would you approach solving this in code it would be helpful (is previous approach on right track?) :)
I don't believe so
it also needs to mention (similar to the previous attempt) that format can also take the other form with fields
got it, tnx!