pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

[Feature Request] Option to customize error message output

Open OliverSieweke opened this issue 5 years ago • 2 comments

It would be great to be able to customize the pydocstyle error message output.

In addition to being a pleasant feature, this would further allow improved integration into some IDEs such as PyCharm. I have tried out a minimal change to output error messages on a single line. This then makes it possible to configure a file watcher that directly shows error stripe marks along with appropriate error messages in the editor window:

pydocstyle PyCharm Integration Example

You can easily try it out for yourself by following the instructions on this fork.

As an idea, something like the pylint --msg-template option would do the job perfectly and could be used as follows:

pydocstyle --msg-template='{filename}:{line} {definition}: {message}' my_filename.py

It seems like this could be implemented with relatively little effort. The relevant part of the code can be found here: https://github.com/PyCQA/pydocstyle/blob/5e964875aef99b9df6f238616228ef1286afcfac/src/pydocstyle/violations.py#L86


Happy to submit a PR if you're keen on the proposal...

OliverSieweke avatar Mar 22 '20 20:03 OliverSieweke

This is an awesome idea!

saroad2 avatar May 15 '20 10:05 saroad2

If you use flake8 + flake8-docstrings you can already do this.

sigmavirus24 avatar May 15 '20 11:05 sigmavirus24