Skip to content

Commit

Permalink
Fixed periphery scan
Browse files Browse the repository at this point in the history
  • Loading branch information
rofle100lvl committed Sep 30, 2024
1 parent 115f2b0 commit 1424b59
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Sources/ProjectDrivers/BazelProjectDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import Logger
import Shared
import SystemPackage

public class BazelProjectDriver: ProjectDriver {
public static var isSupported: Bool {
class BazelProjectDriver: ProjectDriver {
static var isSupported: Bool {
FilePath("MODULE.bazel").exists || FilePath("WORKSPACE").exists
}

public static func build(configuration: Configuration, shell: Shell, logger: Logger) throws -> Self {
static func build(configuration: Configuration, shell: Shell, logger: Logger) throws -> Self {
configuration.bazel = false // Generic project mode is used for the actual scan.
configuration.reportExclude.append("**/bazel-out/**/*")
return self.init(configuration: configuration, shell: shell, logger: logger)
}

private static let topLevelKinds = [
static let topLevelKinds = [
// rules_apple, iOS
"ios_app_clip",
"ios_application",
Expand Down Expand Up @@ -81,7 +81,7 @@ public class BazelProjectDriver: ProjectDriver {
self.fileManager = fileManager
}

public func build() throws {
func build() throws {
guard let executablePath = Bundle.main.executablePath else {
fatalError("Expected executable path.")
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProjectDrivers/GenericProjectDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Shared
import SwiftIndexStore
import SystemPackage

public final class GenericProjectDriver {
final class GenericProjectDriver {
struct GenericConfig: Decodable {
let indexstores: Set<String>
let plists: Set<String>
Expand All @@ -24,7 +24,7 @@ public final class GenericProjectDriver {
private let testTargets: Set<String>
private let configuration: Configuration

public convenience init(genericProjectConfig: FilePath, configuration: Configuration) throws {
convenience init(genericProjectConfig: FilePath, configuration: Configuration) throws {
guard genericProjectConfig.exists else {
throw PeripheryError.pathDoesNotExist(path: genericProjectConfig.string)
}
Expand Down
1 change: 1 addition & 0 deletions Sources/ProjectDrivers/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public final class Project {
)
}

// periphery:ignore
public init(configuration: Configuration) throws {
self.configuration = configuration
logger = Logger()
Expand Down
1 change: 1 addition & 0 deletions Sources/Scan/Scan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public final class Scan {
graph = SourceGraph(configuration: configuration)
}

// periphery:ignore
public init(
configuration: Configuration,
sourceGraph: SourceGraph
Expand Down

0 comments on commit 1424b59

Please sign in to comment.