From 23c9d4f73308da8961f7441c588788fdd0939efb Mon Sep 17 00:00:00 2001 From: Anduin Xue Date: Sun, 20 Apr 2025 12:47:35 +0000 Subject: [PATCH] Add check for files without extensions in manual linting script --- .github/manual_lint.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/manual_lint.js b/.github/manual_lint.js index c7951916..a37f317f 100644 --- a/.github/manual_lint.js +++ b/.github/manual_lint.js @@ -30,6 +30,18 @@ async function main() { } } + // Check for files without extensions + for (var filePath of allFiles) { + const stats = await fs.stat(filePath); + // Only check files (not directories) + if (stats.isFile()) { + const extension = path.extname(filePath); + if (extension === '') { + errors.push(`文件 ${filePath} 不符合仓库的规范!文件必须有扩展名!`); + } + } + } + for (var filePath of directories) { var data = await fs.readFile(filePath, 'utf8'); var filename = path.parse(filePath).base.replace(".md","");