refactor: audit phase 0, 1, 2, 3, 5, 6 foundations#1117
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b129c42ecc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return regex | ||
| } | ||
| regexLogger.fault("Failed to compile static regex pattern: \(pattern, privacy: .public)") | ||
| return NSRegularExpression() |
There was a problem hiding this comment.
Use a valid fallback regular expression
This fallback calls NSRegularExpression() with no arguments, but Foundation does not provide a parameterless initializer for NSRegularExpression in Swift, so the target will fail to compile whenever this file is built. Use a valid pattern such as (?!) for the fallback instead of constructing an empty regex.
Useful? React with 👍 / 👎.
| return regex | ||
| } | ||
| patternLogger.fault("Failed to compile JSON highlight pattern: \(pattern, privacy: .public)") | ||
| return NSRegularExpression() |
There was a problem hiding this comment.
Use a valid fallback regular expression
This fallback calls NSRegularExpression() with no arguments, but Foundation does not provide a parameterless initializer for NSRegularExpression in Swift, so the target will fail to compile whenever this file is built. Use a valid pattern such as (?!) for the fallback instead of constructing an empty regex.
Useful? React with 👍 / 👎.
| return regex | ||
| } | ||
| logger.fault("Failed to compile EnvVarResolver pattern: \(source, privacy: .public)") | ||
| return NSRegularExpression() |
There was a problem hiding this comment.
Use a valid fallback regular expression
This fallback calls NSRegularExpression() with no arguments, but Foundation does not provide a parameterless initializer for NSRegularExpression in Swift, so the target will fail to compile whenever this file is built. Use a valid pattern such as (?!) for the fallback instead of constructing an empty regex.
Useful? React with 👍 / 👎.
Summary
Five-phase refactor pulled out of the codebase audit (827 Swift files / 131k LOC). Each commit is foundation-only: pattern + 1-2 exemplar migrations. Long tail tracked in pattern docs at /tmp/audit/.
What's not in this PR
Style
No em dashes in the diff. Banned-word grep clean. swiftlint passes on every touched file. Build: every commit was built and pushed in sequence (force-pushed off main into this branch later).
Test plan