-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to enable the compiler to make better optimizations
- Loading branch information
Showing
30 changed files
with
193 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...tend/Formatters/CheckstyleFormatter.swift → ...yKit/Formatters/CheckstyleFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...end/Formatters/CodeClimateFormatter.swift → ...Kit/Formatters/CodeClimateFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import Foundation | ||
import PeripheryKit | ||
|
||
final class CodeClimateFormatter: OutputFormatter { | ||
|
||
|
1 change: 0 additions & 1 deletion
1
...es/Frontend/Formatters/CsvFormatter.swift → ...eripheryKit/Formatters/CsvFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...s/Frontend/Formatters/JsonFormatter.swift → ...ripheryKit/Formatters/JsonFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Sources/PeripheryKit/Formatters/OutputDeclarationFilter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Foundation | ||
import SystemPackage | ||
import Shared | ||
import FilenameMatcher | ||
|
||
public final class OutputDeclarationFilter { | ||
private let configuration: Configuration | ||
private let logger: ContextualLogger | ||
|
||
public required init(configuration: Configuration = .shared, logger: Logger = .init()) { | ||
self.configuration = configuration | ||
self.logger = logger.contextualized(with: "report:filter") | ||
} | ||
|
||
public func filter(_ declarations: [ScanResult]) -> [ScanResult] { | ||
if configuration.reportInclude.isEmpty && configuration.reportExclude.isEmpty { | ||
return declarations | ||
} | ||
|
||
return declarations | ||
.filter { | ||
let path = $0.declaration.location.file.path | ||
|
||
if configuration.reportIncludeMatchers.isEmpty { | ||
if configuration.reportExcludeMatchers.anyMatch(filename: path.string) { | ||
self.logger.debug("Excluding \(path.string)") | ||
return false | ||
} | ||
|
||
return true | ||
} | ||
|
||
if configuration.reportIncludeMatchers.anyMatch(filename: path.string) { | ||
self.logger.debug("Including \(path.string)") | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
.sorted { $0.declaration < $1.declaration } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
.../Frontend/Formatters/XcodeFormatter.swift → ...ipheryKit/Formatters/XcodeFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.