File tree Expand file tree Collapse file tree 2 files changed +51
-12
lines changed Expand file tree Collapse file tree 2 files changed +51
-12
lines changed Original file line number Diff line number Diff line change 40
40
"problemMatcher" : []
41
41
},
42
42
{
43
- "label" : " Create change note" ,
43
+ "label" : " Create query change note" ,
44
44
"type" : " process" ,
45
45
"command" : " python3" ,
46
46
"args" : [
47
47
" misc/scripts/create-change-note.py" ,
48
48
" ${input:language}" ,
49
+ " src" ,
49
50
" ${input:name}" ,
50
- " ${input:category}"
51
+ " ${input:categoryQuery}"
52
+ ],
53
+ "presentation" : {
54
+ "reveal" : " never" ,
55
+ "close" : true
56
+ },
57
+ "problemMatcher" : []
58
+ },
59
+ {
60
+ "label" : " Create library change note" ,
61
+ "type" : " process" ,
62
+ "command" : " python3" ,
63
+ "args" : [
64
+ " misc/scripts/create-change-note.py" ,
65
+ " ${input:language}" ,
66
+ " lib" ,
67
+ " ${input:name}" ,
68
+ " ${input:categoryLibrary}"
51
69
],
52
70
"presentation" : {
53
71
"reveal" : " never" ,
70
88
" csharp" ,
71
89
" python" ,
72
90
" ruby" ,
91
+ " rust" ,
73
92
" swift" ,
74
93
]
75
94
},
76
95
{
77
96
"type" : " promptString" ,
78
97
"id" : " name" ,
79
- "description" : " Name "
98
+ "description" : " Short name (kebab-case) "
80
99
},
81
100
{
82
101
"type" : " pickString" ,
83
- "id" : " category " ,
84
- "description" : " Category" ,
102
+ "id" : " categoryQuery " ,
103
+ "description" : " Category (query change) " ,
85
104
"options" :
86
105
[
87
- " minorAnalysis" ,
106
+ " breaking" ,
107
+ " deprecated" ,
88
108
" newQuery" ,
89
- " fix " ,
109
+ " queryMetadata " ,
90
110
" majorAnalysis" ,
111
+ " minorAnalysis" ,
112
+ " fix" ,
113
+ ]
114
+ },
115
+ {
116
+ "type" : " pickString" ,
117
+ "id" : " categoryLibrary" ,
118
+ "description" : " Category (library change)" ,
119
+ "options" :
120
+ [
91
121
" breaking" ,
122
+ " deprecated" ,
123
+ " feature" ,
124
+ " majorAnalysis" ,
125
+ " minorAnalysis" ,
126
+ " fix" ,
92
127
]
93
128
}
94
129
]
Original file line number Diff line number Diff line change 4
4
5
5
# Expects to receive the following arguments:
6
6
# - What language the change note is for
7
+ # - Whether it's a query or library change (the string `src` or `lib`)
7
8
# - The name of the change note (in kebab-case)
8
9
# - The category of the change.
9
10
17
18
18
19
# Read the given arguments
19
20
language = sys .argv [1 ]
20
- change_note_name = sys .argv [2 ]
21
- change_category = sys .argv [3 ]
21
+ subdir = sys .argv [2 ]
22
+ change_note_name = sys .argv [3 ]
23
+ change_category = sys .argv [4 ]
22
24
23
25
# Find the root of the repository. The current script should be located in `misc/scripts`.
24
26
root = os .path .dirname (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
25
27
26
28
# Go to the repo root
27
29
os .chdir (root )
28
30
31
+ output_dir = f"{ language } /ql/{ subdir } /change-notes"
32
+
29
33
# Abort if the output directory doesn't exist
30
- if not os .path .exists (f" { language } /ql/lib/change-notes" ):
31
- print (f"Output directory { language } /ql/lib/change-notes does not exist" )
34
+ if not os .path .exists (output_dir ):
35
+ print (f"Output directory { output_dir } does not exist" )
32
36
sys .exit (1 )
33
37
34
38
# Get the current date
35
39
import datetime
36
40
current_date = datetime .datetime .now ().strftime ("%Y-%m-%d" )
37
41
38
42
# Create the change note file
39
- change_note_file = f"{ language } /ql/lib/change-notes /{ current_date } -{ change_note_name } .md"
43
+ change_note_file = f"{ output_dir } /{ current_date } -{ change_note_name } .md"
40
44
41
45
change_note = f"""
42
46
---
You can’t perform that action at this time.
0 commit comments