Skip to content

Commit 08df9b6

Browse files
committed
tweak CHANGELOG.md
1 parent 14d8df8 commit 08df9b6

File tree

3 files changed

+83
-98
lines changed

3 files changed

+83
-98
lines changed

CHANGELOG.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
1414
## Unreleased
1515

16-
> [!note]
17-
>
18-
> - Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
19-
> - Diff: [`6bc34f1...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/6bc34f1...HEAD)
20-
21-
## [2025-11-26]
16+
- Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
17+
- Diff: [`6bc34f1...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/6bc34f1...HEAD)
2218

23-
[2025-11-26]: https://github.com/aviatesk/JETLS.jl/pull/326
19+
## 2025-11-26
2420

25-
> [!note]
26-
>
27-
> - Commit: [`6bc34f1`](https://github.com/aviatesk/JETLS.jl/commit/6bc34f1)
28-
> - Diff: [`2be0cff...6bc34f1`](https://github.com/aviatesk/JETLS.jl/compare/2be0cff...6bc34f1)
21+
- Commit: [`6bc34f1`](https://github.com/aviatesk/JETLS.jl/commit/6bc34f1)
22+
- Diff: [`2be0cff...6bc34f1`](https://github.com/aviatesk/JETLS.jl/compare/2be0cff...6bc34f1)
2923

3024
### Changed
3125

@@ -37,14 +31,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3731
The release documentation index page shows the release date extracted from
3832
commit messages.
3933

40-
## [2025-11-25]
34+
## 2025-11-25
4135

42-
[2025-11-25]: https://github.com/aviatesk/JETLS.jl/pull/323
43-
44-
> [!note]
45-
>
46-
> - Commit: [`2be0cff`](https://github.com/aviatesk/JETLS.jl/commit/2be0cff)
47-
> - Diff: [`fac4eaf...2be0cff`](https://github.com/aviatesk/JETLS.jl/compare/fac4eaf...2be0cff)
36+
- Commit: [`2be0cff`](https://github.com/aviatesk/JETLS.jl/commit/2be0cff)
37+
- Diff: [`fac4eaf...2be0cff`](https://github.com/aviatesk/JETLS.jl/compare/fac4eaf...2be0cff)
4838

4939
### Added
5040

@@ -62,13 +52,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6252
Extensions that are actually used by JETLS are preserved with updated UUIDs.
6353
Fixes aviatesk/JETLS.jl#312. (aviatesk/JETLS.jl#320)
6454

65-
## [2025-11-24]
66-
67-
[2025-11-24]: https://github.com/aviatesk/JETLS.jl/commit/fac4eaf
55+
## 2025-11-24
6856

69-
> [!note]
70-
>
71-
> - Commit: [`fac4eaf`](https://github.com/aviatesk/JETLS.jl/commit/fac4eaf)
57+
- Commit: [`fac4eaf`](https://github.com/aviatesk/JETLS.jl/commit/fac4eaf)
7258

7359
### Changed / Breaking
7460

jetls-client/CHANGELOG.md

Lines changed: 27 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10-
> [!note]
11-
>
12-
> - Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
13-
> - Diff: [`250188fc...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/250188fc...HEAD)
10+
- Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
11+
- Diff: [`250188fc...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/250188fc...HEAD)
1412

15-
## [v0.2.2]
13+
## v0.2.2
1614

17-
[v0.2.2]: https://github.com/aviatesk/JETLS.jl/compare/250188fc...9008d1b
18-
19-
> [!note]
20-
> - Commit: [`250188fc`](https://github.com/aviatesk/JETLS.jl/commit/9008d1b)
21-
> - Diff: [`34278b3...250188fc`](https://github.com/aviatesk/JETLS.jl/compare/250188fc...9008d1b)
15+
- Commit: [`250188fc`](https://github.com/aviatesk/JETLS.jl/commit/9008d1b)
16+
- Diff: [`34278b3...250188fc`](https://github.com/aviatesk/JETLS.jl/compare/250188fc...9008d1b)
2217

2318
### Fixed
2419

2520
- (Really) fix installation command syntax in the migration commands invoked via
2621
the extension installation/update notification to use correct `Pkg.Apps.add`
2722
keyword argument format
2823

29-
## [v0.2.1]
30-
31-
[v0.2.1]: https://github.com/aviatesk/JETLS.jl/compare/34278b3...250188fc
24+
## v0.2.1
3225

33-
> [!note]
34-
> - Commit: [`250188fc`](https://github.com/aviatesk/JETLS.jl/commit/250188fc)
35-
> - Diff: [`34278b3...250188fc`](https://github.com/aviatesk/JETLS.jl/compare/34278b3...250188fc)
26+
- Commit: [`250188fc`](https://github.com/aviatesk/JETLS.jl/commit/250188fc)
27+
- Diff: [`34278b3...250188fc`](https://github.com/aviatesk/JETLS.jl/compare/34278b3...250188fc)
3628

3729
### Fixed
3830

3931
- Fixed installation command syntax in documentation and migration notification
4032
to use correct `Pkg.Apps.add` keyword argument format
4133

42-
## [v0.2.0]
43-
44-
[v0.2.0]: https://github.com/aviatesk/JETLS.jl/compare/b0a4a4c...34278b3
34+
## v0.2.0
4535

46-
> [!note]
47-
> - Commit: [`34278b3`](https://github.com/aviatesk/JETLS.jl/commit/34278b3)
48-
> - Diff: [`b0a4a4c...34278b3`](https://github.com/aviatesk/JETLS.jl/compare/b0a4a4c...34278b3)
36+
- Commit: [`34278b3`](https://github.com/aviatesk/JETLS.jl/commit/34278b3)
37+
- Diff: [`b0a4a4c...34278b3`](https://github.com/aviatesk/JETLS.jl/compare/b0a4a4c...34278b3)
4938

5039
> [!warning]
5140
> **Breaking changes**: JETLS installation method has changed significantly.
@@ -61,6 +50,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6150
2. Make sure `~/.julia/bin` is in your `PATH`
6251
3. Restart VSCode
6352

53+
### Added
54+
55+
- Added update notification system that prompts users to update the JETLS server
56+
when the extension is updated.
57+
6458
### Changed
6559

6660
- JETLS launch configuration has been significantly updated with the migration to the `jetls` executable app.
@@ -84,8 +78,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8478
For more details, see <https://aviatesk.github.io/JETLS.jl/dev/configuration/#config/diagnostic-patterns>.
8579
(aviatesk/JETLS.jl#313)
8680

87-
<!--- Added update notification system that prompts users to update the JETLS server when the extension is updated-->
88-
8981
### Breaking
9082

9183
- Thread setting for JETLS process should now be set via `jetls-client.executable.threads` option,
@@ -94,28 +86,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9486
configuration options have been removed in favor of the new `jetls-client.executable` configuration
9587
- `jetls-client.jetlsSettings` has been renamed to `jetls-client.settings`
9688

97-
## [v0.1.3]
98-
99-
[v0.1.3]: https://github.com/aviatesk/JETLS.jl/compare/6ac86f9...b0a4a4c
89+
## v0.1.3
10090

101-
> [!note]
102-
>
103-
> - Commit: [`b0a4a4c`](https://github.com/aviatesk/JETLS.jl/commit/b0a4a4c)
104-
> - Diff: [`6ac86f9...b0a4a4c`](https://github.com/aviatesk/JETLS.jl/compare/6ac86f9...b0a4a4c)
91+
- Commit: [`b0a4a4c`](https://github.com/aviatesk/JETLS.jl/commit/b0a4a4c)
92+
- Diff: [`6ac86f9...b0a4a4c`](https://github.com/aviatesk/JETLS.jl/compare/6ac86f9...b0a4a4c)
10593

10694
### Added
10795

10896
- Added `jetls-client.jetlsSettings.diagnostic` configuration to control
10997
diagnostic on/off state and severity levels (aviatesk/JETLS.jl#298)
11098

111-
## [v0.1.2]
112-
113-
[v0.1.2]: https://github.com/aviatesk/JETLS.jl/compare/f199854...6ac86f9
99+
## v0.1.2
114100

115-
> [!note]
116-
>
117-
> - Commit: [`6ac86f9`](https://github.com/aviatesk/JETLS.jl/commit/6ac86f9)
118-
> - Diff: [`f199854...6ac86f9`](https://github.com/aviatesk/JETLS.jl/compare/f199854...6ac86f9)
101+
- Commit: [`6ac86f9`](https://github.com/aviatesk/JETLS.jl/commit/6ac86f9)
102+
- Diff: [`f199854...6ac86f9`](https://github.com/aviatesk/JETLS.jl/compare/f199854...6ac86f9)
119103

120104
### Added
121105

@@ -126,21 +110,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126110
(aviatesk/JETLS.jl#284)
127111
- Added support for configuring JETLS through VSCode's `settings.json` file (aviatesk/JETLS.jl#296)
128112

129-
## [v0.1.1]
130-
131-
[v0.1.1]: https://github.com/aviatesk/JETLS.jl/compare/bc91e4e...f199854
132-
133-
> [!note]
134-
>
135-
> - Commit: [`f199854`](https://github.com/aviatesk/JETLS.jl/commit/f199854)
136-
> - Diff: [`bc91e4e...f199854`](https://github.com/aviatesk/JETLS.jl/compare/bc91e4e...f199854)
113+
## v0.1.1
137114

138-
## [v0.1.0]
115+
- Commit: [`f199854`](https://github.com/aviatesk/JETLS.jl/commit/f199854)
116+
- Diff: [`bc91e4e...f199854`](https://github.com/aviatesk/JETLS.jl/compare/bc91e4e...f199854)
139117

140-
[v0.1.0]: https://github.com/aviatesk/JETLS.jl/commit/bc91e4e
118+
## v0.1.0
141119

142-
> [!note]
143-
>
144-
> - Commit: [`bc91e4e`](https://github.com/aviatesk/JETLS.jl/commit/bc91e4e)
120+
- Commit: [`bc91e4e`](https://github.com/aviatesk/JETLS.jl/commit/bc91e4e)
145121

146122
- Initial release

scripts/update-changelog.py

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,56 @@
33
Update CHANGELOG.md after a release PR is merged.
44
55
Usage:
6-
python scripts/update-changelog.py <version> <commit> <pr_number> <prev_commit>
6+
python scripts/update-changelog.py <version> <commit> <prev_commit>
7+
python scripts/update-changelog.py --extract-section <version>
78
89
Example:
9-
python scripts/update-changelog.py 2025-11-26 6bc34f1 326 2be0cff
10+
python scripts/update-changelog.py 2025-11-26 6bc34f1 2be0cff
11+
python scripts/update-changelog.py --extract-section 2025-11-26
1012
1113
This script:
1214
1. Creates a new dated release section with the content from "Unreleased"
1315
2. Updates the "Unreleased" diff link to start from the new release commit
16+
3. Links the version header to the GitHub Release page
17+
4. Can extract a specific version's section for use in release notes
1418
"""
1519

1620
import re
1721
import sys
1822

1923

20-
def update_changelog(version: str, commit: str, pr_number: str, prev_commit: str) -> bool:
24+
def extract_unreleased_content() -> str:
25+
"""Extract content from the Unreleased section (for use before update)."""
26+
with open('CHANGELOG.md', 'r') as f:
27+
content = f.read()
28+
29+
# Pattern to match the Unreleased section header and metadata
30+
unreleased_header = r'## Unreleased\n\n- Commit: \[`HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/commit/HEAD\)\n- Diff: \[`[a-f0-9]+\.\.\.HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/compare/[a-f0-9]+\.\.\.HEAD\)\n'
31+
32+
# Find everything between the Unreleased header and the next release section
33+
pattern = f'({unreleased_header})(.*?)(## \\d{{4}}-\\d{{2}}-\\d{{2}})'
34+
match = re.search(pattern, content, re.DOTALL)
35+
36+
if not match:
37+
return ""
38+
39+
return match.group(2).strip()
40+
41+
42+
def update_changelog(version: str, commit: str, prev_commit: str) -> bool:
2143
with open('CHANGELOG.md', 'r') as f:
2244
content = f.read()
2345

2446
# Check if the release section already exists
25-
if re.search(rf'^## \[{re.escape(version)}\]', content, re.MULTILINE):
47+
if re.search(rf'^## {re.escape(version)}$', content, re.MULTILINE):
2648
print(f"Release {version} already exists in CHANGELOG.md, skipping update")
2749
return False
2850

2951
# Pattern to match the Unreleased section header and metadata
30-
unreleased_header = r'## Unreleased\n\n> \[!note\]\n>\n> - Commit: \[`HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/commit/HEAD\)\n> - Diff: \[`[a-f0-9]+\.\.\.HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/compare/[a-f0-9]+\.\.\.HEAD\)\n'
52+
unreleased_header = r'## Unreleased\n\n- Commit: \[`HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/commit/HEAD\)\n- Diff: \[`[a-f0-9]+\.\.\.HEAD`\]\(https://github\.com/aviatesk/JETLS\.jl/compare/[a-f0-9]+\.\.\.HEAD\)\n'
3153

3254
# Find everything between the Unreleased header and the next release section
33-
pattern = f'({unreleased_header})(.*?)(## \\[\\d{{4}}-\\d{{2}}-\\d{{2}}\\])'
55+
pattern = f'({unreleased_header})(.*?)(## \\d{{4}}-\\d{{2}}-\\d{{2}})'
3456
match = re.search(pattern, content, re.DOTALL)
3557

3658
if not match:
@@ -43,22 +65,16 @@ def update_changelog(version: str, commit: str, pr_number: str, prev_commit: str
4365
# Build the new Unreleased header with updated commit
4466
new_unreleased_header = f"""## Unreleased
4567
46-
> [!note]
47-
>
48-
> - Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
49-
> - Diff: [`{commit}...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/{commit}...HEAD)
68+
- Commit: [`HEAD`](https://github.com/aviatesk/JETLS.jl/commit/HEAD)
69+
- Diff: [`{commit}...HEAD`](https://github.com/aviatesk/JETLS.jl/compare/{commit}...HEAD)
5070
5171
"""
5272

5373
# Build the new release section
54-
new_release_section = f"""## [{version}]
74+
new_release_section = f"""## {version}
5575
56-
[{version}]: https://github.com/aviatesk/JETLS.jl/pull/{pr_number}
57-
58-
> [!note]
59-
>
60-
> - Commit: [`{commit}`](https://github.com/aviatesk/JETLS.jl/commit/{commit})
61-
> - Diff: [`{prev_commit}...{commit}`](https://github.com/aviatesk/JETLS.jl/compare/{prev_commit}...{commit})
76+
- Commit: [`{commit}`](https://github.com/aviatesk/JETLS.jl/commit/{commit})
77+
- Diff: [`{prev_commit}...{commit}`](https://github.com/aviatesk/JETLS.jl/compare/{prev_commit}...{commit})
6278
6379
"""
6480

@@ -78,17 +94,24 @@ def update_changelog(version: str, commit: str, pr_number: str, prev_commit: str
7894

7995

8096
def main() -> int:
81-
if len(sys.argv) != 5:
82-
print(f"Usage: {sys.argv[0]} <version> <commit> <pr_number> <prev_commit>")
83-
print(f"Example: {sys.argv[0]} 2025-11-26 6bc34f1 326 2be0cff")
97+
if len(sys.argv) >= 2 and sys.argv[1] == '--extract-unreleased':
98+
content = extract_unreleased_content()
99+
if content:
100+
print(content)
101+
return 0
102+
return 1
103+
104+
if len(sys.argv) != 4:
105+
print(f"Usage: {sys.argv[0]} <version> <commit> <prev_commit>")
106+
print(f" {sys.argv[0]} --extract-unreleased")
107+
print(f"Example: {sys.argv[0]} 2025-11-26 6bc34f1 2be0cff")
84108
return 1
85109

86110
version = sys.argv[1]
87111
commit = sys.argv[2]
88-
pr_number = sys.argv[3]
89-
prev_commit = sys.argv[4]
112+
prev_commit = sys.argv[3]
90113

91-
if update_changelog(version, commit, pr_number, prev_commit):
114+
if update_changelog(version, commit, prev_commit):
92115
return 0
93116
return 1
94117

0 commit comments

Comments
 (0)