ddd
This commit is contained in:
parent
0a343ecbc5
commit
c3a6f5ff37
80 changed files with 2512 additions and 1625 deletions
28
scripts/check-source-policy.js
Normal file
28
scripts/check-source-policy.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
|
||||
const fs=require('fs');
|
||||
const path=require('path');
|
||||
|
||||
const root=path.resolve(__dirname,'..');
|
||||
const governed=[
|
||||
'archive-codec.js',
|
||||
'build-meta.js',
|
||||
'runtime-config.js',
|
||||
'shared-contracts.js',
|
||||
'client/input/frame-scheduler.js',
|
||||
'client/input/drag.js',
|
||||
'client/input/gesture-coordinator.js',
|
||||
'client/input/interaction-state.js',
|
||||
'client/ui/cursor.js',
|
||||
'server/http-router.js',
|
||||
'server/auth.js',
|
||||
'server/json-repository.js',
|
||||
'server/player-service.js'
|
||||
];
|
||||
const maximum=180,violations=[];
|
||||
for(const relative of governed){
|
||||
const file=path.join(root,relative),lines=fs.readFileSync(file,'utf8').split(/\r?\n/);
|
||||
lines.forEach((line,index)=>{if(line.length>maximum)violations.push(`${relative}:${index+1} (${line.length})`)});
|
||||
}
|
||||
if(violations.length)throw new Error(`Handwritten source lines exceed ${maximum} columns:\n${violations.join('\n')}`);
|
||||
console.log(`Source policy passed for ${governed.length} handwritten modules (${maximum}-column maximum)`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue