File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
pydocstringformatter/formatting Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ options:
2424 -v, --version Show version number and exit
2525```
2626
27- ### Confiuguration
27+ ### Configuration
2828
2929Pydocstringformatter will also read any configuration added to the ` [tool.pydocstringformatter] ` section of a ` pyproject.toml ` file.
3030
@@ -86,8 +86,17 @@ multi-line docstring
8686
8787## Development
8888
89+ ### Linting
90+
8991Use ` pre-commit install ` to install the pre-commit hook for the repository.
9092
93+ ### Creating a new formatter
94+
95+ - Implement a Formatter by inheriting from `` pydocstringformatter.formatting.Formatter ``
96+ - Add your new formatter to `` pydocstringformatter.formatting.FORMATTERS ``
97+ - Create a clear docstring because this will be user-facing: it's what will be seen in the help.
98+ - Choose a proper name because this will be user-facing: the name will be used for option of the CLI.
99+
91100### Testing
92101
93102To run all the tests:
Original file line number Diff line number Diff line change 1- __all__ = ["FORMATTERS" ]
1+ __all__ = ["FORMATTERS" , "Formatter" ]
22
33from typing import List
44
Original file line number Diff line number Diff line change @@ -6,7 +6,15 @@ class Formatter:
66 """Base class for docstring formatter"""
77
88 optional = False
9- name : str
9+
10+ @property
11+ @abc .abstractmethod
12+ def name (self ) -> str :
13+ """Name of the Formatter, chose wisely, this is an API.
14+
15+ This will be used to create argparse options when added to
16+ 'pydocstringformatter.formatting.FORMATTERS'.
17+ """
1018
1119 @abc .abstractmethod
1220 def treat_token (self , tokeninfo : tokenize .TokenInfo ) -> tokenize .TokenInfo :
You can’t perform that action at this time.
0 commit comments