generate_changelog.actions.file_processing.IncrementalFileInsert

IncrementalFileInsert#

class generate_changelog.actions.file_processing.IncrementalFileInsert[source]#

Replace the start of a file with text.

__init__(filename, last_heading_pattern)#
Parameters:
Return type:

None

filename: Union[str, Callable[[], str]]#

The file name to write when called.

last_heading_pattern: Union[str, Callable[[], str]]#

A regular expression to detect the last heading. Content before this position is re-rendered and inserted.

__call__(input_text)[source]#

Replace the beginning of the file up to last_heading_pattern with input_text .

Parameters:

input_text (Union[str, Callable[[], str]]) – The text to insert.

Return type:

Union[str, Callable[[], str]]

Returns:

The same input_text