修复代码审查反馈:改进错误日志、常量命名、类型检查
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
3e8395923a
commit
f00d67061e
|
|
@ -63,8 +63,8 @@
|
||||||
<!-- BINGSHUO_BULLETIN_START -->
|
<!-- BINGSHUO_BULLETIN_START -->
|
||||||
| 时间 | 检查项 | 状态 |
|
| 时间 | 检查项 | 状态 |
|
||||||
|------|--------|------|
|
|------|--------|------|
|
||||||
| 03-09 17:16 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) |
|
| 03-09 17:29 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) |
|
||||||
| 03-09 17:15 | 🔧 系统更新: `.github/` | 铸渊 (Copilot) |
|
| 03-09 17:29 | 🔧 系统更新: `scripts/` | 铸渊 (Copilot) |
|
||||||
| 03-09 17:15 | 🔧 系统更新: `docs/` | 铸渊 (Copilot) |
|
| 03-09 17:15 | 🔧 系统更新: `docs/` | 铸渊 (Copilot) |
|
||||||
| 03-09 17:15 | 🔧 系统更新: `persona-brain-db/` | 铸渊 (Copilot) |
|
| 03-09 17:15 | 🔧 系统更新: `persona-brain-db/` | 铸渊 (Copilot) |
|
||||||
| 03-09 16:56 | ✅ 每日巡检 ✅ 通过 | 冰朔 |
|
| 03-09 16:56 | ✅ 每日巡检 ✅ 通过 | 冰朔 |
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ const COLLABORATORS_PATH = path.join(__dirname, '..', '.github', 'brain', 'colla
|
||||||
const MAX_BINGSHUO_ENTRIES = 15;
|
const MAX_BINGSHUO_ENTRIES = 15;
|
||||||
const MAX_COLLAB_ENTRIES = 20;
|
const MAX_COLLAB_ENTRIES = 20;
|
||||||
const MAX_GIT_LOG_COMMITS = 30;
|
const MAX_GIT_LOG_COMMITS = 30;
|
||||||
|
const BINGSHUO_USERNAME = 'qinfendebingshuo';
|
||||||
|
|
||||||
/* ── 公告区标记 ─────────────────────────── */
|
/* ── 公告区标记 ─────────────────────────── */
|
||||||
const MARKERS = {
|
const MARKERS = {
|
||||||
|
|
@ -86,7 +87,7 @@ const SYSTEM_PREFIXES = ['scripts', 'docs', '.github', 'persona-brain-db'];
|
||||||
function formatTime(ts) {
|
function formatTime(ts) {
|
||||||
if (!ts) return '—';
|
if (!ts) return '—';
|
||||||
const d = new Date(ts);
|
const d = new Date(ts);
|
||||||
if (isNaN(d.getTime())) return String(ts).substring(0, 10);
|
if (isNaN(d.getTime())) return typeof ts === 'string' ? ts.substring(0, Math.min(10, ts.length)) : '—';
|
||||||
const fmt = new Intl.DateTimeFormat('zh-CN', {
|
const fmt = new Intl.DateTimeFormat('zh-CN', {
|
||||||
timeZone: 'Asia/Shanghai',
|
timeZone: 'Asia/Shanghai',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
|
|
@ -583,7 +584,7 @@ async function sendAlertEmails(bingshuoIssues, collabIssuesByDev) {
|
||||||
// 冰朔邮件
|
// 冰朔邮件
|
||||||
if (bingshuoIssues.length > 0) {
|
if (bingshuoIssues.length > 0) {
|
||||||
const bingshuoEmail = process.env.BINGSHUO_EMAIL
|
const bingshuoEmail = process.env.BINGSHUO_EMAIL
|
||||||
|| await fetchUserEmail('qinfendebingshuo')
|
|| await fetchUserEmail(BINGSHUO_USERNAME)
|
||||||
|| null;
|
|| null;
|
||||||
|
|
||||||
if (bingshuoEmail) {
|
if (bingshuoEmail) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ try {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
collaborators = JSON.parse(fs.readFileSync('.github/brain/collaborators.json', 'utf8'));
|
collaborators = JSON.parse(fs.readFileSync('.github/brain/collaborators.json', 'utf8'));
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.log('⚠️ collaborators.json 读取失败,使用空列表:', err.message);
|
||||||
collaborators = [];
|
collaborators = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue