Files
SwiftLint/Tests/SwiftLintFrameworkTests/ConfigurationTests+ProjectMock.swift
JP SimardandGitHub e63e8cad0f Add UnusedDeclarationRule (#2814)
This PR adds a new `unused_declaration` analyzer rule to lint for unused declarations.
By default, detects unused `fileprivate`, `private` and `internal` declarations.
Configure the rule with `include_public_and_open: true` to also detect unused `public` and `open` declarations.

Completely remove the `unused_private_declaration` rule.

This is built on the work enabling collecting rule infrastructure in https://github.com/realm/SwiftLint/pull/2714.
2019-07-18 18:23:43 -07:00

94 lines
3.3 KiB
Swift

@testable import SwiftLintFramework
extension ConfigurationTests {
var projectMockPathLevel0: String {
return testResourcesPath.stringByAppendingPathComponent("ProjectMock")
}
var projectMockPathLevel1: String {
return projectMockPathLevel0.stringByAppendingPathComponent("Level1")
}
var projectMockPathLevel2: String {
return projectMockPathLevel1.stringByAppendingPathComponent("Level2")
}
var projectMockPathLevel3: String {
return projectMockPathLevel2.stringByAppendingPathComponent("Level3")
}
var projectMockYAML0: String {
return projectMockPathLevel0.stringByAppendingPathComponent(Configuration.fileName)
}
var projectMockYAML0CustomPath: String {
return projectMockPathLevel0.stringByAppendingPathComponent("custom.yml")
}
var projectMockYAML0CustomRules: String {
return projectMockPathLevel0.stringByAppendingPathComponent("custom_rules.yml")
}
var projectMockYAML2: String {
return projectMockPathLevel2.stringByAppendingPathComponent(Configuration.fileName)
}
var projectMockYAML2CustomRules: String {
return projectMockPathLevel2.stringByAppendingPathComponent("custom_rules.yml")
}
var projectMockYAML2CustomRulesDisabled: String {
return projectMockPathLevel2.stringByAppendingPathComponent("custom_rules_disabled.yml")
}
var projectMockSwift0: String {
return projectMockPathLevel0.stringByAppendingPathComponent("Level0.swift")
}
var projectMockSwift1: String {
return projectMockPathLevel1.stringByAppendingPathComponent("Level1.swift")
}
var projectMockSwift2: String {
return projectMockPathLevel2.stringByAppendingPathComponent("Level2.swift")
}
var projectMockSwift3: String {
return projectMockPathLevel3.stringByAppendingPathComponent("Level3.swift")
}
var projectMockConfig0: Configuration {
return Configuration(path: projectMockYAML0, rootPath: projectMockPathLevel0,
optional: false, quiet: true)
}
var projectMockConfig0CustomPath: Configuration {
return Configuration(path: projectMockYAML0CustomPath, rootPath: projectMockPathLevel0,
optional: false, quiet: true)
}
var projectMockConfig0CustomRules: Configuration {
return Configuration(path: projectMockYAML0CustomRules, rootPath: projectMockPathLevel0,
optional: false, quiet: true)
}
var projectMockConfig2: Configuration {
return Configuration(path: projectMockYAML2, optional: false, quiet: true)
}
var projectMockConfig2CustomRules: Configuration {
return Configuration(path: projectMockYAML2CustomRules, rootPath: projectMockPathLevel0,
optional: false, quiet: true)
}
var projectMockConfig2CustomRulesDisabled: Configuration {
return Configuration(path: projectMockYAML2CustomRulesDisabled, rootPath: projectMockPathLevel0,
optional: false, quiet: true)
}
var projectMockConfig3: Configuration {
return Configuration(path: Configuration.fileName, rootPath: projectMockPathLevel3,
optional: false, quiet: true)
}
}