Skip to content

Commit b8449af

Browse files
committed
ci: check keeper closing remarks
1 parent 844e244 commit b8449af

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/js-syntax-check.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- "app.js"
99
- "spoken-overview-client.js"
10+
- "keeper-closing-client.js"
1011
- "public-pages-client.js"
1112
- "index.html"
1213
- ".github/workflows/js-syntax-check.yml"
@@ -39,5 +40,23 @@ jobs:
3940
if (!result.includes('数値積分する。')) throw new Error('「数値積分します」が常体に変換されていません');
4041
if (/(です|ます)([。、,,]|$)/.test(result)) throw new Error('概要に「です・ます」調が残っています');
4142
NODE
43+
- name: Check keeper-closing-client.js syntax
44+
run: node --check keeper-closing-client.js
45+
- name: Test keeper closing remarks
46+
run: |
47+
node <<'NODE'
48+
require('./keeper-closing-client.js');
49+
const closingFor = globalThis.__projectTavernClosingFor;
50+
if (typeof closingFor !== 'function') throw new Error('keeper closing generator is unavailable');
51+
52+
const control = closingFor('リアクションホイール 数値積分 制御工学 シミュレータ', 'reaction-wheel-rocking-sim');
53+
const sensor = closingFor('BNO085 IMU センサ 姿勢推定', 'imu-test');
54+
const low = closingFor('CONF LOW 資料が少ない 詳細は判断できない', 'unknown-repo');
55+
console.log({ control, sensor, low });
56+
57+
if (!control || !sensor || !low) throw new Error('keeper closing remark was empty');
58+
if (control === sensor) throw new Error('different repository themes should not collapse to one closing');
59+
if (!/資料|推測|分かって/.test(low)) throw new Error('low-confidence closing is not appropriately cautious');
60+
NODE
4261
- name: Check public-pages-client.js syntax
4362
run: node --check public-pages-client.js

0 commit comments

Comments
 (0)