PyCodeAutoFormatter

Merged
#61 · Created  · Last updated

Merged pull request

Merged in pyCodeAutoFormatter (pull request #61)

0f29d8a·Author: ·Closed by: ·2021-01-23

Description

A new “auto format” button is added to the toolbar (and edit menu) of the script editor:

This feature can be configured via a new property page (Editor >> Auto Format) and allows
indicating a Python module, that is called to automatically re-format the current script based on
style guide rules.

In general, any Python module can be given, that accepts a script to be passed as standard in and returns the corrected version via its standard out stream.

Exemplary call commands for the following modules are given in the property page:

  • black

  • yapf

  • autopep8

This feature can also be disabled, such that no buttons appears. If this feature returns with an error (and if the user has enough rights), he is asked if the corresponding action in the editor should be disabled or not.

To test this feature, please install one of the indicated packages from pypi.org, go to the
property page and chose the corresponding module from the example combo box. Take it via the take button and accept the dialog. Open a script and click the button to see the formatting result.

 

0 attachments

0 comments

Loading commits...