laminate-cli 0.1.5__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: laminate-cli
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Generate release-ready changelogs from git history using a local LLM
5
5
  Author-email: Apleut <me@apleut.dev>
6
6
  License-Expression: MIT
@@ -180,6 +180,9 @@ Only include commits before a specific date.
180
180
  laminate --until 2026-10-01
181
181
  ```
182
182
 
183
+ > [!IMPORTANT]
184
+ > Both `--since` and `--until` use YYYY-MM-DD format for dates.
185
+
183
186
  ### `--range`
184
187
 
185
188
  Process a specific Git commit range.
@@ -188,8 +191,11 @@ Process a specific Git commit range.
188
191
  laminate --range v1.0.0..v1.1.0
189
192
  ```
190
193
 
191
- > [!IMPORTANT]
192
- > Laminate does not currently support range formats like `v1.0.0..HEAD`. Version-to-present functionality will be added in a future release.
194
+ You can also use `--range` to read commits from a specific version to the last commit, like this:
195
+
196
+ ```bash
197
+ laminate --range v1.0.0..HEAD
198
+ ```
193
199
 
194
200
  `--range` overrides `--since` and `--until`.
195
201
 
@@ -239,6 +245,10 @@ Without `--release`, Laminate generates:
239
245
  ## [Unreleased]
240
246
  ```
241
247
 
248
+ ### `--append`
249
+
250
+ Append the new changelog contents to the output file instead of completely overwriting them. Without `--append`, the changelog will only contain the commit range you specified. If you include `--append` though, it will simply add that release to the top of the file.
251
+
242
252
  ## Example
243
253
 
244
254
  Suppose your repository contains commits like:
@@ -155,6 +155,9 @@ Only include commits before a specific date.
155
155
  laminate --until 2026-10-01
156
156
  ```
157
157
 
158
+ > [!IMPORTANT]
159
+ > Both `--since` and `--until` use YYYY-MM-DD format for dates.
160
+
158
161
  ### `--range`
159
162
 
160
163
  Process a specific Git commit range.
@@ -163,8 +166,11 @@ Process a specific Git commit range.
163
166
  laminate --range v1.0.0..v1.1.0
164
167
  ```
165
168
 
166
- > [!IMPORTANT]
167
- > Laminate does not currently support range formats like `v1.0.0..HEAD`. Version-to-present functionality will be added in a future release.
169
+ You can also use `--range` to read commits from a specific version to the last commit, like this:
170
+
171
+ ```bash
172
+ laminate --range v1.0.0..HEAD
173
+ ```
168
174
 
169
175
  `--range` overrides `--since` and `--until`.
170
176
 
@@ -214,6 +220,10 @@ Without `--release`, Laminate generates:
214
220
  ## [Unreleased]
215
221
  ```
216
222
 
223
+ ### `--append`
224
+
225
+ Append the new changelog contents to the output file instead of completely overwriting them. Without `--append`, the changelog will only contain the commit range you specified. If you include `--append` though, it will simply add that release to the top of the file.
226
+
217
227
  ## Example
218
228
 
219
229
  Suppose your repository contains commits like:
@@ -38,6 +38,7 @@ def generate(
38
38
  output: str = typer.Option("CHANGELOG.md", help="Path to write the generated changelog to."),
39
39
  batch_size: int = typer.Option(15, "--batch-size", help="Number of commits sent to the LLM per batch."),
40
40
  release: str = typer.Option(None, "--release", help="Version number for this release, e.g. 1.1.0. If omitted, the changelog is headed [Unreleased]."),
41
+ append: bool = typer.Option(False, "--append", help="Appends the new changelog contents to the existing file instead of overwriting it."),
41
42
  version: bool = typer.Option(
42
43
  False,
43
44
  "--version",
@@ -100,7 +101,7 @@ def generate(
100
101
  raise typer.Exit(code=1)
101
102
 
102
103
  changelog = render_changelog(entries, version=release)
103
- write_changelog(changelog, output)
104
+ write_changelog(changelog, output, append)
104
105
 
105
106
  typer.echo(f"\nDone. Changelog written to {output}", file=sys.stdout)
106
107
 
@@ -47,7 +47,16 @@ def render_changelog(entries: list[CategorizedEntry], version: str | None = None
47
47
  return "\n".join(lines).rstrip() + "\n"
48
48
 
49
49
 
50
- def write_changelog(content: str, output_path: str = "CHANGELOG.md") -> None:
50
+ def write_changelog(content: str, output_path: str = "CHANGELOG.md", append: bool | None = None) -> None:
51
+ if append is True:
52
+ with open(output_path, "r", encoding="utf-8") as f:
53
+ existing_content = f.read()
54
+ existing_stub = existing_content[existing_content.find('## [') + 1:]
55
+ else:
56
+ existing_stub = ""
57
+
58
+ content = content + "\n" + existing_stub
59
+
51
60
  with open(output_path, "w", encoding="utf-8") as f:
52
61
  f.write(content)
53
62
 
@@ -67,5 +76,5 @@ if __name__ == "__main__":
67
76
  changelog = render_changelog(entries)
68
77
 
69
78
  print(changelog)
70
- write_changelog(changelog)
79
+ write_changelog(changelog, append=True)
71
80
  print("Wrote changelog.md")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: laminate-cli
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Generate release-ready changelogs from git history using a local LLM
5
5
  Author-email: Apleut <me@apleut.dev>
6
6
  License-Expression: MIT
@@ -180,6 +180,9 @@ Only include commits before a specific date.
180
180
  laminate --until 2026-10-01
181
181
  ```
182
182
 
183
+ > [!IMPORTANT]
184
+ > Both `--since` and `--until` use YYYY-MM-DD format for dates.
185
+
183
186
  ### `--range`
184
187
 
185
188
  Process a specific Git commit range.
@@ -188,8 +191,11 @@ Process a specific Git commit range.
188
191
  laminate --range v1.0.0..v1.1.0
189
192
  ```
190
193
 
191
- > [!IMPORTANT]
192
- > Laminate does not currently support range formats like `v1.0.0..HEAD`. Version-to-present functionality will be added in a future release.
194
+ You can also use `--range` to read commits from a specific version to the last commit, like this:
195
+
196
+ ```bash
197
+ laminate --range v1.0.0..HEAD
198
+ ```
193
199
 
194
200
  `--range` overrides `--since` and `--until`.
195
201
 
@@ -239,6 +245,10 @@ Without `--release`, Laminate generates:
239
245
  ## [Unreleased]
240
246
  ```
241
247
 
248
+ ### `--append`
249
+
250
+ Append the new changelog contents to the output file instead of completely overwriting them. Without `--append`, the changelog will only contain the commit range you specified. If you include `--append` though, it will simply add that release to the top of the file.
251
+
242
252
  ## Example
243
253
 
244
254
  Suppose your repository contains commits like:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "laminate-cli"
3
- version = "0.1.5"
3
+ version = "0.1.7"
4
4
  authors = [
5
5
  { name="Apleut", email="me@apleut.dev" },
6
6
  ]
File without changes
File without changes