Skip to content

Commit 519b0db

Browse files
committed
chore: add license check to CI and remove unused logs
1 parent 32d5b79 commit 519b0db

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ jobs:
4646
echo "Generated config types are out of date. Run 'npm run generate-config-types' locally and commit the changes."
4747
exit 1
4848
fi
49+
50+
- name: Check license headers
51+
run: npm run check-license-headers

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"cypress:run": "cypress run",
7171
"cypress:open": "cypress open",
7272
"generate-config-types": "quicktype --src-lang schema --lang typescript --out src/config/generated/config.ts --top-level GitProxyConfig config.schema.json && ts-node scripts/add-banner.ts src/config/generated/config.ts && prettier --write src/config/generated/config.ts",
73-
"add-license-headers": "node scripts/add-license-headers.ts"
73+
"add-license-headers": "node scripts/add-license-headers.ts",
74+
"check-license-headers": "node scripts/check-license-headers.ts"
7475
},
7576
"bin": {
7677
"git-proxy": "./dist/index.js",

scripts/add-license-headers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function addLicenseHeader(filePath: string, licenseHeader: string): void {
5151
let shebang = '';
5252

5353
if (hasLicenseHeader(content, licenseHeader)) {
54-
console.log(`Skipping ${filePath} (already has header)`);
5554
return;
5655
}
5756

@@ -75,7 +74,6 @@ function processDirectory(dirPath: string, licenseHeader: string): void {
7574

7675
if (entry.isDirectory()) {
7776
if (!IGNORE_DIRS.includes(entry.name)) {
78-
console.log(`Processing directory: ${fullPath} ${entry.name}`);
7977
processDirectory(fullPath, licenseHeader);
8078
}
8179
} else if (entry.isFile()) {
@@ -89,6 +87,7 @@ function processDirectory(dirPath: string, licenseHeader: string): void {
8987

9088
function main(): void {
9189
try {
90+
console.log('Executing scripts/add-license-headers.ts');
9291
console.log('Reading license header...');
9392
const licenseHeader = readLicenseHeader();
9493

0 commit comments

Comments
 (0)