Compare commits

...

5 Commits

Author SHA1 Message Date
JP Simard 61066c4c70
Run fallthrough rule tests on CI 2018-11-28 11:51:36 -08:00
JP Simard 60fc3af44c
Fixup 2018-11-28 10:44:29 -08:00
JP Simard 50f16d6907
Fixup 2018-11-28 10:40:04 -08:00
JP Simard d1df7af294
Deserialize syntax tree using byte tree 2018-11-28 10:39:44 -08:00
JP Simard 02113220d1
Migrate FallthroughRule to SwiftSyntax [skip ci] 2018-11-28 10:39:15 -08:00
23 changed files with 8594 additions and 2614 deletions

View File

@ -46,6 +46,15 @@
"version": "0.22.0"
}
},
{
"package": "SwiftSyntax",
"repositoryURL": "https://github.com/jpsim/swift-syntax.git",
"state": {
"branch": "codegen-11-24",
"revision": "f893b851ffa503dac4caf067f133be6afc488398",
"version": null
}
},
{
"package": "SwiftyTextTable",
"repositoryURL": "https://github.com/scottrhoyt/SwiftyTextTable.git",

View File

@ -14,6 +14,7 @@ let package = Package(
.library(name: "SwiftLintFramework", targets: ["SwiftLintFramework"])
],
dependencies: [
.package(url: "https://github.com/jpsim/swift-syntax.git", .branch("codegen-11-24")),
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.15.0"),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.22.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "1.0.1"),
@ -32,6 +33,7 @@ let package = Package(
name: "SwiftLintFramework",
dependencies: [
"SourceKittenFramework",
"SwiftSyntax",
"Yams",
] + (addCryptoSwift ? ["CryptoSwift"] : [])
),

View File

@ -1,5 +1,6 @@
import Foundation
import SourceKittenFramework
import SwiftSyntax
private var responseCache = Cache({ file -> [String: SourceKitRepresentable]? in
do {
@ -11,6 +12,22 @@ private var responseCache = Cache({ file -> [String: SourceKitRepresentable]? in
return nil
}
})
private var syntaxCache = Cache({ file -> SourceFileSyntax? in
do {
let response = try Request.syntaxTree(file: file, byteTree: true).sendIfNotDisabled()
guard let syntaxTreeData = response["key.serialized_syntax_tree"] as? Data else {
return nil
}
let deserializer = SyntaxTreeDeserializer()
return try deserializer.deserialize(syntaxTreeData, serializationFormat: .byteTree)
} catch let error as Request.Error {
queuedPrintError(error.description)
return nil
} catch {
return nil
}
})
private var structureCache = Cache({ file -> Structure? in
if let structure = responseCache.get(file).map(Structure.init) {
queueForRebuild.append(structure)
@ -129,6 +146,17 @@ extension File {
return structure
}
internal var syntax: SourceFileSyntax {
guard let syntax = syntaxCache.get(self) else {
if let handler = assertHandler {
handler()
return SourceFileSyntax({ _ in })
}
queuedFatalError("Never call this for file that sourcekitd fails.")
}
return syntax
}
internal var syntaxMap: SyntaxMap {
guard let syntaxMap = syntaxMapCache.get(self) else {
if let handler = assertHandler {
@ -151,7 +179,7 @@ extension File {
return syntaxTokensByLines
}
internal var syntaxKindsByLines: [[SyntaxKind]] {
internal var syntaxKindsByLines: [[SourceKittenFramework.SyntaxKind]] {
guard let syntaxKindsByLines = syntaxKindsByLinesCache.get(self) else {
if let handler = assertHandler {
handler()
@ -164,6 +192,7 @@ extension File {
public func invalidateCache() {
responseCache.invalidate(self)
syntaxCache.invalidate(self)
assertHandlerCache.invalidate(self)
structureCache.invalidate(self)
syntaxMapCache.invalidate(self)
@ -174,6 +203,7 @@ extension File {
internal static func clearCaches() {
queueForRebuild.clear()
responseCache.clear()
syntaxCache.clear()
assertHandlerCache.clear()
structureCache.clear()
syntaxMapCache.clear()

View File

@ -1,4 +1,5 @@
import SourceKittenFramework
import SwiftSyntax
public struct FallthroughRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
@ -28,10 +29,32 @@ public struct FallthroughRule: ConfigurationProviderRule, OptInRule, AutomaticTe
)
public func validate(file: File) -> [StyleViolation] {
return file.match(pattern: "fallthrough", with: [.keyword]).map {
StyleViolation(ruleDescription: type(of: self).description,
severity: configuration.severity,
location: Location(file: file, characterOffset: $0.location))
// SourceKitten implementation
// return file.match(pattern: "fallthrough", with: [.keyword]).map {
// StyleViolation(ruleDescription: type(of: self).description,
// severity: configuration.severity,
// location: Location(file: file, characterOffset: $0.location))
// SwiftSyntax implementation
class FallthroughVisitor: SyntaxVisitor {
var positions = [AbsolutePosition]()
override func shouldVisit(_ kind: SwiftSyntax.SyntaxKind) -> Bool {
return kind == .fallthroughStmt
}
override func visit(_ node: FallthroughStmtSyntax) -> SyntaxVisitorContinueKind {
positions.append(node.positionAfterSkippingLeadingTrivia)
return super.visit(node)
}
}
let visitor = FallthroughVisitor()
file.syntax.walk(visitor)
return visitor.positions.map { position in
StyleViolation(ruleDescription: type(of: self).description, severity: configuration.severity,
location: Location(file: file.path, line: position.line, character: position.column))
}
}
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:SwiftLint.xcodeproj">
location = "self:">
</FileRef>
</Workspace>

View File

@ -2,7 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<false/>
</dict>
</plist>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
BlueprintIdentifier = "SwiftLint::SwiftLintFramework"
BuildableName = "SwiftLintFramework.framework"
BlueprintName = "SwiftLintFramework"
ReferencedContainer = "container:SwiftLint.xcodeproj">
@ -22,15 +22,15 @@
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
BuildableName = "SwiftLintFrameworkTests.xctest"
BlueprintName = "SwiftLintFrameworkTests"
BlueprintIdentifier = "SwiftLint::swiftlint"
BuildableName = "swiftlint"
BlueprintName = "swiftlint"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -46,22 +46,13 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
BlueprintIdentifier = "SwiftLint::SwiftLintFrameworkTests"
BuildableName = "SwiftLintFrameworkTests.xctest"
BlueprintName = "SwiftLintFrameworkTests"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
BuildableName = "SwiftLintFramework.framework"
BlueprintName = "SwiftLintFramework"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@ -78,7 +69,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
BlueprintIdentifier = "SwiftLint::SwiftLintFramework"
BuildableName = "SwiftLintFramework.framework"
BlueprintName = "SwiftLintFramework"
ReferencedContainer = "container:SwiftLint.xcodeproj">
@ -88,20 +79,11 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
BuildableName = "SwiftLintFramework.framework"
BlueprintName = "SwiftLintFramework"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "2.0">
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
BuildableName = "swiftlint.app"
BlueprintIdentifier = "SwiftLint::swiftlint"
BuildableName = "swiftlint"
BlueprintName = "swiftlint"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
@ -26,41 +26,19 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1216C19E87B05005E4BAA"
BuildableName = "SwiftLintFramework.framework"
BlueprintName = "SwiftLintFramework"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES"
testExecutionOrdering = "random">
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0D1217619E87B05005E4BAA"
BlueprintIdentifier = "SwiftLint::SwiftLintFrameworkTests"
BuildableName = "SwiftLintFrameworkTests.xctest"
BlueprintName = "SwiftLintFrameworkTests"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
BuildableName = "swiftlint.app"
BlueprintName = "swiftlint"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@ -71,36 +49,23 @@
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "NO"
debugXPCServices = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "NO"
viewDebuggingEnabled = "No">
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
BuildableName = "swiftlint.app"
BlueprintIdentifier = "SwiftLint::swiftlint"
BuildableName = "swiftlint"
BlueprintName = "swiftlint"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "lint --no-cache"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "DEVELOPER_DIR"
value = "${DEVELOPER_DIR}"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "TOOLCHAINS"
value = "${TOOLCHAINS}"
key = "TOOLCHAIN_DIR"
value = "/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-11-22-a.xctoolchain"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
@ -108,21 +73,11 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0E7B63119E9C64500EDBA4D"
BuildableName = "swiftlint.app"
BlueprintName = "swiftlint"
ReferencedContainer = "container:SwiftLint.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:SwiftLint.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/SourceKitten/sourcekitten.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/Commandant/Commandant.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/Result/Result.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/SWXMLHash/SWXMLHash.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/SwiftyTextTable/SwiftyTextTable.xcodeproj">
</FileRef>
<FileRef
location = "group:Carthage/Checkouts/Yams/Yams.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,77 +1,17 @@
version: 2
jobs:
analyze:
swift_syntax:
macos:
xcode: "10.1.0"
steps:
- checkout
- run: make analyze
tsan:
macos:
xcode: "10.1.0"
steps:
- checkout
# Pre-cache
- run: swift run --sanitize=thread swiftlint lint --lenient
# Post-cache
- run: swift run --sanitize=thread swiftlint lint --lenient
# Test
- run: make test_tsan
osscheck:
shell: /bin/bash --login -eo pipefail
macos:
xcode: "10.1.0"
steps:
- checkout
- run: echo "ruby-2.4" > ~/.ruby-version
- run: bundle install
- run: bundle exec danger --verbose
swiftpm_4.2:
macos:
xcode: "10.1.0"
steps:
- checkout
- run: swift test --parallel
xcode_10:
macos:
xcode: "10.1.0"
steps:
- checkout
- run: set -o pipefail && script/cibuild | xcpretty -r junit
- store_test_results:
path: build/reports/
cocoapods:
shell: /bin/bash --login -eo pipefail
macos:
xcode: "10.1.0"
steps:
- checkout
- run: echo "ruby-2.4" > ~/.ruby-version
- run: bundle install
- run: curl -sS https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash
- run: bundle exec pod lib lint SwiftLintFramework.podspec
linux_swift_4.2:
docker:
- image: norionomura/swift:42
steps:
- checkout
- run: swift test --parallel
- run: curl https://swift.org/builds/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2018-11-22-a/swift-DEVELOPMENT-SNAPSHOT-2018-11-22-a-osx.pkg -o swift.pkg
- run: sudo installer -pkg swift.pkg -target /
- run: TOOLCHAIN_DIR=/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-11-22-a.xctoolchain swift test --filter FallthroughRuleTests
workflows:
version: 2
workflow:
jobs:
- analyze
- tsan
- osscheck
- swiftpm_4.2
- xcode_10
- cocoapods
- linux_swift_4.2
- swift_syntax