The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 05:00 UTC
[codex] fix mobile native static analysis source discovery (#2942)
Co-authored-by: Julius Marminge <julius@mac.lan>
Julius Marminge committed
Jun 3, 2026 at 23:13 UTC
80b40ce96a50ccf07a2b64991419c01c01e67f53
1 file changed
+15
-8
scripts/mobile-native-static-check.ts
+15
-8
@@ -40,14 +40,13 @@ const sourceExtensions = new Set([".swift", ".kt", ".kts"]);
40
const excludedDirectories = new Set([
41
".expo",
42
".git",
43
- "android",
43
"build",
44
"DerivedData",
46
- "ios",
45
"node_modules",
46
"Pods",
47
"Vendor",
48
]);
49
+const generatedNativeProjectDirectories = new Set(["android", "ios"]);
50
51
const appRoot = Effect.service(Path.Path).pipe(
52
Effect.flatMap((path) => path.fromFileUrl(new URL("../apps/mobile", import.meta.url))),
@@ -108,6 +107,7 @@ const runCommand = Effect.fn("runCommand")(function* (
107
108
function collectSources(
109
directory: string,
110
+ root: string,
111
): Effect.Effect<
112
ReadonlyArray<string>,
113
PlatformError.PlatformError,
@@ -120,15 +120,18 @@ function collectSources(
120
const sources: Array<string> = [];
121
122
for (const entry of entries) {
123
- if (excludedDirectories.has(entry)) {
124
- continue;
125
- }
126
-
123
const entryPath = path.join(directory, entry);
124
const stat = yield* fs.stat(entryPath);
125
126
if (stat.type === "Directory") {
131
- sources.push(...(yield* collectSources(entryPath)));
127
+ const isGeneratedNativeProjectDirectory =
128
+ directory === root && generatedNativeProjectDirectories.has(entry);
129
+
130
+ if (excludedDirectories.has(entry) || isGeneratedNativeProjectDirectory) {
131
+ continue;
132
+ }
133
+
134
+ sources.push(...(yield* collectSources(entryPath, root)));
135
continue;
136
}
137
@@ -144,7 +147,7 @@ function collectSources(
147
const runNativeStaticChecks = Effect.fn("runNativeStaticChecks")(function* () {
148
const path = yield* Path.Path;
149
const root = yield* appRoot;
147
- const sources = yield* collectSources(root);
150
+ const sources = yield* collectSources(root, root);
151
const swiftSources = sources.filter((source) => path.extname(source) === ".swift");
152
const kotlinSources = sources.filter((source) => {
153
const extension = path.extname(source);
@@ -156,6 +159,10 @@ const runNativeStaticChecks = Effect.fn("runNativeStaticChecks")(function* () {
159
availableTools.set(tool.command, yield* commandExists(tool.command));
160
}
161
162
+ yield* Console.log(
163
+ `Found ${swiftSources.length} Swift and ${kotlinSources.length} Kotlin native source files.`,
164
+ );
165
+
166
if (swiftSources.length > 0) {
167
if (availableTools.get("swiftlint")) {
168
yield* runCommand("swiftlint", ["lint", "--config", ".swiftlint.yml", "--strict"], root);