-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress "Messages" header or configure verbosity #56
Comments
@guykisel What format does pre-commit require? There are several output options available already (see http://prospector.readthedocs.org/en/latest/usage.html#output-format). Are any of them useful? If not, feel free to create a new output formatter which can fix exactly what you need. Examples are here: https://github.com/landscapeio/prospector/tree/master/prospector/formatters I'm happy to answer any questions :) |
There's no particular required format, it normally just displays whatever is written to stdout with no modifications. Your default human-readable format is actually pretty much perfect, I just want to skip the headers because they end up being a little redundant. Example output (with
|
Looks like I could make my own version of the |
Right now there's no ability to use a third-party formatter, but I don't mind merging in one called "precommit" or whatever you want. Also happy to merge in a change to allow third-party formatters! Maybe a feature which allows 'output template' strings would be nice, so you could say:
|
Cool, that would be nice. I was also thinking, an alternative would be to modify prospector to allow an arbitrary number of positional path arguments, as opposed to being limited to one. I suspect this would require more significant modifications, though. |
@guykisel Yes, I think that is the better solution but it requires fiddling with setoptconf a bit so it is perhaps non-trivial. That is something I'd like to do though. |
I think once prospector can accept multiple input paths, the pre-commit hook would work great without needing a custom formatter. Until then, the Thank you for your help! |
This is somewhat related to pre-commit/pre-commit#178
I'm working on setting up a Prospector hook for http://pre-commit.com/ (a handy git pre-commit hook manager). The way I'm configuring it, pre-commit runs
prospector
viaxargs
. See https://github.com/pre-commit/pre-commit/blob/master/pre_commit/languages/system.pyI'm currently setting the entry point to prospector as
-n 1 prospector
so that pre-commit ends up runningxargs -0 -n 1 prospector
, which then calls prospector once per input file. This ends up creating a lot of redundant summaries and message headers in the output, when I would rather just get the messages themselves. I can supply the-M
argument to suppress the summaries, but I still get theMessages
header once per file, even when there are no messages for that file.My request is to add some sort of flag for either suppressing the
Messages
header specifically, or for more generally controlling output verbosity.If this seems reasonable, I'd be willing to work on it and submit a pull request. Alternatively, if there's a better way to do this or something obvious I'm missing, I would appreciate any help.
(my efforts so far are at https://github.com/guykisel/prospector-mirror [which could probably use a better project name])
The text was updated successfully, but these errors were encountered: