Reference
High Level API¤
extract_release_comments(tags, path, output_filename)
¤
A high-level API for extracting comments and docstrings added in between 2 (ideally 2) tags or commits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags |
list[str]
|
A list of tags or commits (ideally 2 most recent) to find diff between. |
required |
path |
str
|
Path of the sub-directory to find the diff of. |
required |
output_filename |
str
|
Path of the file to store the diff in. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
comments |
list[str]
|
A list of comments and docstrings added in between the provided tags. |
Source code in releaseup/high_level.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Low Level API¤
extract_additions(filename)
¤
Extracts all the additions made to a codebase from a file containing git diff.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename |
str
|
File containing the |
required |
Returns:
| Name | Type | Description |
|---|---|---|
extracted_additions |
list[str]
|
A list of additions made to the codebase. |
Source code in releaseup/extract.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
get_comments_and_docstrings(preprocessed_additions)
¤
Extracts comments and docstrings from preprocessed git diff output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preprocessed_additions |
list[str]
|
A list of preprocessed additions from |
required |
Returns:
| Name | Type | Description |
|---|---|---|
extracted_docs |
list[str]
|
Extracted comments and docstrings from the preprocessed_additions. |
Source code in releaseup/extract.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
get_diff(tags, path='./', output_filename='diff.txt')
¤
Writes git diff to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags |
list[str]
|
A list of tags or commits (ideally 2 most recent) to find diff between. |
required |
path |
str
|
Path of the sub-directory to find the diff of. |
'./'
|
output_filename |
str
|
Path of the file to store the diff in. |
'diff.txt'
|
Source code in releaseup/extract.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
preprocess_additions(extracted_additions)
¤
Preprocesses the extracted additions from git diff.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extracted_additions |
list[str]
|
A |
required |
Returns:
| Name | Type | Description |
|---|---|---|
preprocessed_additions |
list[str]
|
Preprocessed additions. |
Source code in releaseup/extract.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
save(content, filename)
¤
Save contents in a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content |
list[str]
|
A list of contents to be saved. |
required |
filename |
str
|
Path of the file in which the contents have to be saved |
required |
Source code in releaseup/extract.py
127 128 129 130 131 132 133 134 135 136 137 138 | |