Skip to content

Commit 84c0fd0

Browse files
Fix releaseherald documentation (#1180)
* fixed releaseherald documentation
1 parent 4e10892 commit 84c0fd0

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix releaseherald documentation

releaseherald/docs/configuration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
`releaseherald` needs at least a known git repository to run. It can be provided as a command line
44
parameter `--git-dir path/to/git/dir`
55
or just simply running `releaseherlad` somewhere in a git repository. The root of the git repository is considered as
6-
the place of the config files. If no config files exists it will run with defaults, which will be detailed in the
7-
[Configurable Options](#configurable-options) section.
6+
the place of the config files. If no config files exists it will run with defaults, which will be detailed below.
87

98
## Config files
109

releaseherald/docs/plugins/stock.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on the list). Other plugins can depend on this default behaviour and extend,alte
1313
This plugin responsible to render the news into an output based on a jinja2 template. This added automatically to
1414
the list of plugins even if not mentioned in the config, though if a plugin implement their own rendering this can
1515
be removed adding `-base_output` to the list of plugins.
16-
[/configuration/](../configuration.md#base-output-plugin-configuration)
16+
[/configuration/](../configuration.md#base_output-plugin-configuration)
1717

1818
## latest
1919
This is a simple plugin, it adds the `--latest` commandline switch for generate and understand the

releaseherald/releaseherald/configuration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class Configuration(BaseModel):
2020
"""
2121
This class represent the configuration read from the config file.
22-
See attribute details in [Configuration](/configuration)
22+
See attribute details in [Configuration](../configuration.md)
2323
"""
2424

2525
config_path: Path
@@ -62,27 +62,30 @@ def parse_sub_config(
6262
"""
6363
Helper for plugin developers to parse a section of the config with the passed model, and replace the
6464
dictionary with the model object
65+
6566
Args:
6667
attribute_name: the attribute holding the plugin config
6768
sub_config_model: the model describe the sub config
6869
69-
Returns: an instance of the parsed config
70+
Returns:
71+
an instance of the parsed config
7072
7173
"""
7274
config = getattr(self, attribute_name, None)
7375
parsed_config = sub_config_model.parse_obj(config) if config else None
7476
setattr(self, attribute_name, parsed_config)
7577
return parsed_config
7678

77-
def resolve_path(self, path: Path):
79+
def resolve_path(self, path: Path) -> Path:
7880
"""
7981
Helper function for plugin developers to resolve relative paths in config that supposed to be relative to this
8082
config file
8183
8284
Args:
8385
path: the path to resolve
8486
85-
Returns: an absolute path
87+
Returns:
88+
an absolute path
8689
8790
"""
8891
root = _config_root(self.config_path)

releaseherald/releaseherald/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def generate(ctx: click.Context, **kwargs):
127127
@click.option(
128128
"--config",
129129
type=click.Path(exists=True, dir_okay=False, path_type=Path),
130-
help="Path to the config file, if not provided releaseherald.toml or pyproject.toml usde from git repo root.",
130+
help="Path to the config file. If not provided, releaseherald.toml or pyproject.toml is used from git repo root.",
131131
)
132132
@click.pass_context
133133
def setup(

releaseherald/releaseherald/plugins/hookspecs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def get_command_options(command: str) -> CommandOptions:
5050
def on_start_command(command: str, kwargs: Dict[str, Any]):
5151
"""
5252
Called before a cli command start to execute.
53+
5354
Args:
5455
command: the name of the command
5556
kwargs: the parameters the command called with
@@ -154,6 +155,7 @@ def generate_output(
154155
"""
155156
The plugin can generate an output in memory in any kind of format it want. It also has a
156157
chance to alter or replace an output generated by any previous plugins
158+
157159
Args:
158160
version_news:
159161
All the version/news collected and processed by
@@ -168,6 +170,7 @@ def write_output(output: Output):
168170
"""
169171
The plugin should do its final output step here. Write to file, to stdout or send a mail,
170172
upload to some service whatever desired.
173+
171174
Args:
172175
output: the output from [generate_output][releaseherald.plugins.hookspecs.generate_output]
173176

releaseherald/releaseherald/plugins/interface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def date(self) -> datetime.datetime:
8181
class News:
8282
"""
8383
Represent a single newsfile
84+
8485
Attributes:
8586
file_name: file name of the news fragment
8687
content: the content of the news file

releaseherald/releaseherald/plugins/plugin_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def get_command_options(self, command: str) -> Optional[CommandOptions]:
108108
"""
109109
Generate command options from Annotated fields which can be returned directly from
110110
[get_command_options hook][releaseherald.plugins.hookspecs.get_command_options]
111+
111112
Args:
112113
command: the command these command options are registered with
113114
@@ -135,6 +136,7 @@ def update(self, command: str, kwargs: Dict[str, Any]) -> None:
135136
"""
136137
Update itself from commandline options, can be used in
137138
[on_start_command hook][releaseherald.plugins.hookspecs.on_start_command]
139+
138140
Args:
139141
command: the command
140142
kwargs: the commandline args for the command

0 commit comments

Comments
 (0)