Skip to content

Commit 4250125

Browse files
committed
Add check for files without extensions in manual linting script
1 parent 221331c commit 4250125

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/manual_lint.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ async function main() {
3030
}
3131
}
3232

33+
// Check for files without extensions
34+
for (var filePath of allFiles) {
35+
const stats = await fs.stat(filePath);
36+
// Only check files (not directories)
37+
if (stats.isFile()) {
38+
const extension = path.extname(filePath);
39+
if (extension === '') {
40+
errors.push(`文件 ${filePath} 不符合仓库的规范!文件必须有扩展名!`);
41+
}
42+
}
43+
}
44+
3345
for (var filePath of directories) {
3446
var data = await fs.readFile(filePath, 'utf8');
3547
var filename = path.parse(filePath).base.replace(".md","");

0 commit comments

Comments
 (0)