28 lines
993 B
JavaScript
28 lines
993 B
JavaScript
'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)`);
|