Package: docmat
docmatPython docstring formatter.Main FunctionalitiesInstallationUsageSupported docstring formatsExamplesIntegration with VSCodeRoadmapMain FunctionalitiesAdjusts indentation and spacing.Wraps all docstring text.InstallationpipinstalldocmatUsageIn order to format the docstring of a file, run in a terminal shell:docmat<filename>|<folder>|<glob>Examples:docmatto_format.pydocmatto_format.pyother_file_to_format.pydocmatto_format.py--line-length79docmatdirectorydocmatdirectory/*Supported docstring formatsGoogleAdding support for other docstring formats is in the Roadmap.ExamplesBefore:deffunc():"""This fits in one line."""After:deffunc():"""This fits in one line."""Before:deffunc():"""start with lower letter, dot missing"""After:deffunc():"""Start with lower letter, dot missing."""Before:deffunc():"""In this docstring a newline after the summary is missing.Summary and description should be separated by a newline."""After:deffunc():"""In this docstring a newline after the summary is missing.Summary and description should be separated by a newline."""Before:deffunc():"""Summary.The length of the function description in this specific function exceeds the maximum line length, that in this case is left to the default value `88`. This block of text should be wrapped."""After:deffunc():"""Summary.The length of the function description in this specific function exceeds the maximumline length, that in this case is left to the default value `88`. This block of textshould be wrapped."""Adding the parameter--wrap-summaryBefore:deffunc():"""By default, the summary line is not wrapped even if it exceeds the maximum line length.This behavior can be overriden by adding the `--wrap-summary` command line parameter"""After:deffunc():"""By default, the summary line is not wrapped even if it exceeds the maximum linelength.This behavior can be overriden by adding the `--wrap-summary` command lineparameter."""Before:deffunc(arg1,arg2):"""Summary.args:arg1(type): The indentation level of this argument is not correct.arg2(type): In this case, the description of this argument exceeds the maximum line length and it needs to be wrapped."""After:deffunc(arg1,arg2):"""Summary.Args:arg1(type): The indentation level of this argument is not correct.arg2(type): In this case, the description of this argument exceeds the maximumline length and it needs to be wrapped."""Integration with VSCodedocmatwill be integrated withVSCodeusing a dedicated extension (see alsoroadmap).In the meantime,docmatcan be used fromVSCodewith a keyboard shortcut. Here are the steps to make it work:Installdocmatin the python environment used by VSCode following theinstallation stepsOpen the Keyboard Shortcuts configuration file in VSCodePreferences > Keyboard Shortcuts > Open Keyboard Shortcuts (JSON) [icon in the top-right]this will open thekeybindings.jsonfile containing the keyboard shortcuts.Associate the docmat command to a key-binding by adding the following entry to the keybindings list:[{"key":"shift+alt+d","command":"workbench.action.terminal.sendSequence","args":{"text":"docmat '${file}'\u000D"}}]The suggested key-binding isshift+alt+D, but you can change it to whatever you like.Save the file.Now, every time you are working on a python file you can hitshift+alt+Dand thedocmatcommand will be executed in the VSCode terminal on the file that you have currently opened. Eventual errors or log messages will be shown there. Please note that the environment wheredocmatis installed should be active in the VSCode integrated terminal prior to using the shortcut.RoadmapAdd support for a no-format comment token.Add support for bullet lists.Add support for other docstring formats:NumpydocreSTEpytextIntegrate with pre-commit.Create VSCode extension.Add support for code examples in docstring.