Skip to content

Commit 9c284ea

Browse files
authored
Merge branch 'qt-creator:main' into main
2 parents ca431ed + eaf8b94 commit 9c284ea

File tree

4 files changed

+68
-13
lines changed

4 files changed

+68
-13
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A github workflow that validates all json files against their schema
22
name: Validate
3-
on: push
3+
on: [push, pull_request]
44

55
jobs:
66
validate:

registry/theqtcompany.vale/extension.json

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,46 @@
1515
},
1616
"latest": "0.7.0",
1717
"versions": {
18+
"1.0.3": {
19+
"sources": [
20+
{
21+
"url": "https://github.com/qt-creator/ValeLS/releases/download/v1.0.3/ValeLS.zip",
22+
"sha256": "ec04206932386bf9a8a319b8a7d664acbb47c58db8487a686a48014b5e14810a"
23+
}
24+
],
25+
"metadata": {
26+
"Id": "vale",
27+
"Url": "https://www.qt.io",
28+
"Name": "Vale Language Server",
29+
"Tags": [
30+
"language server",
31+
"Vale",
32+
"ValeLS",
33+
"Qt"
34+
],
35+
"Vendor": "The Qt Company",
36+
"License": "GPL",
37+
"Version": "1.0.3",
38+
"Category": "Language Server",
39+
"VendorId": "theqtcompany",
40+
"Copyright": "(C) The Qt Company 2024",
41+
"Type": "Script",
42+
"Languages": [
43+
"en",
44+
"de"
45+
],
46+
"Description": "Provides an integration of the Vale language server",
47+
"Dependencies": [
48+
{
49+
"Id": "lualanguageclient",
50+
"Version": "15.0.0"
51+
}
52+
],
53+
"Experimental": true,
54+
"CompatVersion": "1.0.0",
55+
"DisabledByDefault": false
56+
}
57+
},
1858
"0.7.0": {
1959
"sources": [
2060
{
@@ -136,4 +176,4 @@
136176
}
137177
}
138178
}
139-
}
179+
}

scripts/checkhashes.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function httpGet(url, resolve, reject) {
1919
httpGet(response.headers.location, resolve, reject);
2020
return
2121
}
22+
if (response.statusCode !== 200) {
23+
reject(new Error(`HTTP ${response.statusCode}`));
24+
return
25+
}
2226

2327
const hash = crypto.createHash('sha256');
2428
response.on('error', (err) => {
@@ -42,10 +46,15 @@ async function shaFromUrl(url) {
4246

4347
async function checkSource(source) {
4448
console.log(`Checking ${styleText('blue', source.url)}`);
45-
const actualSha = await shaFromUrl(source.url)
49+
try {
50+
const actualSha = await shaFromUrl(source.url)
4651

47-
if (actualSha !== source.sha256) {
48-
console.error(`Hash mismatch for ${styleText('red', source.url)}: expected ${styleText('green', source.sha256)} but got ${styleText('red', actualSha)}`);
52+
if (actualSha !== source.sha256) {
53+
console.error(`Hash mismatch for ${styleText('red', source.url)}: expected ${styleText('green', source.sha256)} but got ${styleText('red', actualSha)}`);
54+
return 1;
55+
}
56+
} catch (e) {
57+
console.error(`Failed to check ${styleText('red', source.url)}: ${e.message}`);
4958
return 1;
5059
}
5160

scripts/fixhashes.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ function httpGet(url, resolve, reject) {
88
if (response.statusCode === 301 || response.statusCode === 302) {
99
httpGet(response.headers.location, resolve, reject);
1010
return
11+
} else if (response.statusCode !== 200) {
12+
reject(new Error(`HTTP ${response.statusCode}`));
13+
return
1114
}
1215

1316
const hash = crypto.createHash('sha256');
@@ -32,16 +35,19 @@ async function shaFromUrl(url) {
3235

3336
async function checkSource(source) {
3437
console.log(`Checking ${styleText('blue', source.url)}`);
35-
const actualSha = await shaFromUrl(source.url)
36-
37-
if (actualSha !== source.sha256) {
38-
if (!source.sha256) {
39-
console.error(`No hash found for ${styleText('red', source.url)}, setting it to ${styleText('green', actualSha)}`);
38+
try {
39+
const actualSha = await shaFromUrl(source.url)
40+
if (actualSha !== source.sha256) {
41+
if (!source.sha256) {
42+
console.error(`No hash found for ${styleText('red', source.url)}, setting it to ${styleText('green', actualSha)}`);
43+
source.sha256 = actualSha;
44+
return;
45+
}
46+
console.error(`Hash mismatch for ${styleText('red', source.url)}: expected ${styleText('green', source.sha256)} but got ${styleText('red', actualSha)}, changing the hash.`);
4047
source.sha256 = actualSha;
41-
return;
4248
}
43-
console.error(`Hash mismatch for ${styleText('red', source.url)}: expected ${styleText('green', source.sha256)} but got ${styleText('red', actualSha)}, changing the hash.`);
44-
source.sha256 = actualSha;
49+
} catch (e) {
50+
console.error(`Failed to check ${styleText('red', source.url)}: ${e.message}`);
4551
}
4652
}
4753

0 commit comments

Comments
 (0)