Skip to content

OliverSieweke/pydocstyle

 
 

Repository files navigation

pydocstyle-pycharm-integration

This is a fork of pydocstyle to experiment with improved PyCharm integration possibilities and is merely meant to act as a proof of concept.

With this minimally amended version of pydocstyle and the right PyCharm configurations, it is possible to directly see error stripe marks and corresponding error messages in the editor, as shown below:

pydocstyle Pycharm Integration Example

Setup

  1. Clone this repository and install the package:
$ git clone https://github.com/OliverSieweke/pydocstyle.git
$ cd pycodestyle
$ python setup.py

​ Make reference of the location where the pydocstyle binary was installed (watch for the line Installing pydocstyle script to ... )

  1. Configure PyCharm (NB: this has been tested with PyCharm Professional 2019.3)

    • Open a Python project
    • Go to PyCharm > Preferences... > Tools > File Watchers
    • Add a file watcher by clicking the Add button icon, select <custom> and provide the following configurations:
      • Name: pydocstyle
      • File Types: Python
      • Scope: Project Files
      • Program: <path to the pydocstyle binary from step 1>
      • Arguments: $FilePath$
      • Output paths to refresh: $FilePath$
      • Working directory: $ProjectFileDir$
      • Auto-save edited files to trigger the watcher: ✘
      • Trigger the watcher on external changes: ✘
      • Trigger the watcher regardless of syntax errors: ✔︎
      • Create output file from stdout: ✘
      • Show console: Never
      • Output filters: $FILE_PATH$:$LINE$.*?: $MESSAGE$

    pydocstyle Pycharm Integration Configurations

    • Go to PyCharm > Preferences... > Editor > Inspections > File Watchers and make sure the File watcher problems inspection is enabled.
  2. Write some Python code with docstrings not conforming to the PEP 257 conventions and save your file.

  3. You should now see error stripe marks appear on the right hand side of your editor window with corresponding error message tooltips when hovering over them! 🎉

I hope this was interesting, comments are very welcome….

Resources

About

docstring style checker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%