Skip to content

Commit bf56c7c

Browse files
fortmarekclaude
andcommitted
fix: keep ParserBuildSteps.swift under the 400-line SwiftLint limit
Inline the new filter clause across two lines instead of expanding it into a four-line block, so the file stays at 400 lines (the SwiftLint file_length limit). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: fortmarek <marekfort@me.com>
1 parent 72a437c commit bf56c7c

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

Sources/XCLogParser/parser/ParserBuildSteps.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -373,16 +373,9 @@ public final class ParserBuildSteps {
373373

374374
private func addCompilationTimesToTarget(_ target: BuildStep) -> BuildStep {
375375

376-
// For incremental builds, Xcode reuses substep entries from prior build sessions for files
377-
// that didn't need recompilation. Those substeps keep their original (older) timestamps and
378-
// are not flagged `wasFetchedFromCache`. Filtering them out by requiring the substep to
379-
// have ended at or after the target started avoids producing a negative compilationDuration.
380376
let lastCompilationStep = target.subSteps
381-
.filter {
382-
$0.isCompilationStep()
383-
&& $0.fetchedFromCache == false
384-
&& $0.compilationEndTimestamp >= target.startTimestamp
385-
}
377+
.filter { $0.isCompilationStep() && $0.fetchedFromCache == false &&
378+
$0.compilationEndTimestamp >= target.startTimestamp }
386379
.max { $0.compilationEndTimestamp < $1.compilationEndTimestamp }
387380
guard let lastStep = lastCompilationStep else {
388381
return target.with(newCompilationEndTimestamp: target.startTimestamp, andCompilationDuration: 0.0)
@@ -393,11 +386,8 @@ public final class ParserBuildSteps {
393386

394387
private func addCompilationTimesToApp(_ app: BuildStep) -> BuildStep {
395388
let lastCompilationStep = app.subSteps
396-
.filter {
397-
$0.compilationDuration > 0
398-
&& $0.fetchedFromCache == false
399-
&& $0.compilationEndTimestamp >= app.startTimestamp
400-
}
389+
.filter { $0.compilationDuration > 0 && $0.fetchedFromCache == false &&
390+
$0.compilationEndTimestamp >= app.startTimestamp }
401391
.max { $0.compilationEndTimestamp < $1.compilationEndTimestamp }
402392
guard let lastStep = lastCompilationStep else {
403393
return app.with(newCompilationEndTimestamp: app.startTimestamp,

0 commit comments

Comments
 (0)