Skip to content

Commit 431f556

Browse files
authored
chore: centralize license header checks (#952)
* chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks
1 parent 610f195 commit 431f556

File tree

320 files changed

+2093
-420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+2093
-420
lines changed

.github/workflows/mobile-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ jobs:
6969
- name: Run prettier
7070
run: yarn fmt
7171
working-directory: ./app
72+
- name: Check license headers
73+
run: node scripts/check-license-headers.mjs --check
74+
working-directory: ./
7275

7376
test:
7477
runs-on: macos-latest

.husky/pre-commit

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@ if ! yarn gitleaks; then
33
echo "💡 To skip this check temporarily, use: git commit --no-verify"
44
exit 1
55
fi
6+
7+
# Check license headers
8+
echo "🔍 Checking license headers..."
9+
if ! node scripts/check-license-headers.mjs --check; then
10+
echo "❌ License header check failed. Please review the output above and fix any issues."
11+
echo "💡 You can auto-fix some issues with: node scripts/check-license-headers.mjs --fix"
12+
echo "💡 To skip this check temporarily, use: git commit --no-verify"
13+
exit 1
14+
fi

.vscode/tasks.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Check License Headers",
6+
"type": "shell",
7+
"command": "node",
8+
"args": ["scripts/check-license-headers.mjs", "--check"],
9+
"group": {
10+
"kind": "build",
11+
"isDefault": false
12+
},
13+
"presentation": {
14+
"echo": true,
15+
"reveal": "always",
16+
"focus": false,
17+
"panel": "shared",
18+
"showReuseMessage": true,
19+
"clear": false
20+
},
21+
"problemMatcher": [],
22+
"detail": "Check that all license headers are properly formatted"
23+
},
24+
{
25+
"label": "Fix License Headers",
26+
"type": "shell",
27+
"command": "node",
28+
"args": ["scripts/check-license-headers.mjs", "--fix"],
29+
"group": {
30+
"kind": "build",
31+
"isDefault": false
32+
},
33+
"presentation": {
34+
"echo": true,
35+
"reveal": "always",
36+
"focus": false,
37+
"panel": "shared",
38+
"showReuseMessage": true,
39+
"clear": false
40+
},
41+
"problemMatcher": [],
42+
"detail": "Auto-fix license header formatting issues"
43+
},
44+
{
45+
"label": "Analyze License Headers",
46+
"type": "shell",
47+
"command": "node",
48+
"args": ["scripts/migrate-license-headers.mjs", "analyze", "--verbose"],
49+
"group": {
50+
"kind": "build",
51+
"isDefault": false
52+
},
53+
"presentation": {
54+
"echo": true,
55+
"reveal": "always",
56+
"focus": false,
57+
"panel": "shared",
58+
"showReuseMessage": true,
59+
"clear": false
60+
},
61+
"problemMatcher": [],
62+
"detail": "Analyze license header distribution across the codebase"
63+
},
64+
{
65+
"label": "Test License Header Tooling",
66+
"type": "shell",
67+
"command": "yarn",
68+
"args": ["test:license-headers"],
69+
"group": {
70+
"kind": "test",
71+
"isDefault": false
72+
},
73+
"presentation": {
74+
"echo": true,
75+
"reveal": "always",
76+
"focus": false,
77+
"panel": "shared",
78+
"showReuseMessage": true,
79+
"clear": false
80+
},
81+
"problemMatcher": [],
82+
"detail": "Run comprehensive tests for license header tooling"
83+
}
84+
]
85+
}

app/.eslintrc.cjs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
module.exports = {
46
root: true,
@@ -84,13 +86,12 @@ module.exports = {
8486
'import/newline-after-import': 'error',
8587
'import/no-duplicates': 'error',
8688

87-
// Header rule - configured to prevent duplicates, single line header only
88-
89-
'header/header': [
90-
'error',
91-
'line',
92-
' SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11',
93-
],
89+
// Header rule - DISABLED in favor of check-license-headers.mjs script
90+
// 'header/header': [
91+
// 'error',
92+
// 'line',
93+
// ' SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11',
94+
// ],
9495

9596
// Prevent empty lines at the beginning and end of files, and limit consecutive empty lines
9697
// Exception: allow one empty line after license header at file start

app/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
// CI/CD Pipeline Test - July 31, 2025 - With Permissions Fix
46
import { Buffer } from 'buffer';

app/babel.config.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
module.exports = {
46
presets: ['module:@react-native/babel-preset'],

app/declarations.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
declare module '@env';
46
declare module '*.png' {

app/docs/examples/tree-shaking/granular-circuits-example.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
// Granular import example: Circuit utilities only
46
// This will tree-shake out passport parsing, certificate parsing, etc.

app/docs/examples/tree-shaking/level2-optimal-example.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
// Level 2 Granular Import Example - Optimal Tree Shaking
46
// This demonstrates the new file-based imports for maximum optimization

app/docs/examples/tree-shaking/level3-migration-guide.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
1+
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
2+
// SPDX-License-Identifier: BUSL-1.1
3+
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
24

35
/**
46
* LEVEL 3 MIGRATION GUIDE - Function-Level Granular Imports

0 commit comments

Comments
 (0)