Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,4 @@ private extension FunctionCallExprSyntax {

return false
}

func isModifierChainRoot() -> Bool {
// Check if this function call is at the root of a modifier chain
// (i.e., it's the topmost expression in a chain like Text().modifier1().modifier2())
guard let memberAccess = calledExpression.as(MemberAccessExprSyntax.self) else {
return false // Direct function calls like Text() are not modifier chain roots
}
return memberAccess.base != nil // Has a base, so it's part of a modifier chain
}
}
1 change: 0 additions & 1 deletion Source/SwiftLintBuiltInRules/Rules/Lint/MarkRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ private extension TokenSyntax {
].map(basePattern).joined(separator: "|")) + capturingGroup(hyphenOrEmpty)

private static let anySpace = " *"
private static let nonSpaceOrTwoOrMoreSpace = "(?: {2,})?"

private static let anyText = "(?:\\S.*)"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ struct DeploymentTargetConfiguration: SeverityBasedRuleConfiguration {
self.init(platform: platform, major: major, minor: minor, patch: patch)
}

var configurationKey: String {
platform.configurationKey
}

private static func parseVersion(string: String) throws -> (Int, Int, Int) {
func parseNumber(_ string: String) throws -> Int {
guard let number = Int(string) else {
Expand Down
24 changes: 0 additions & 24 deletions Source/SwiftLintBuiltInRules/Rules/Style/IdentifierNameRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ private extension IdentifierNameRule {
}
}

private extension DeclModifierListSyntax {
var staticOrClassModifier: DeclModifierSyntax? {
first { ["static", "class"].contains($0.name.text) }
}
}

private extension IdentifierPatternSyntax {
var enclosingVarDecl: VariableDeclSyntax? {
let identifierDecl =
Expand All @@ -171,24 +165,6 @@ private extension IdentifierPatternSyntax {
}
}

private extension VariableDeclSyntax {
var allDeclaredNames: [String] {
bindings
.map(\.pattern)
.flatMap { pattern -> [String] in
if let id = pattern.as(IdentifierPatternSyntax.self) {
[id.identifier.text]
} else if let tuple = pattern.as(TuplePatternSyntax.self) {
tuple.elements.compactMap {
$0.pattern.as(IdentifierPatternSyntax.self)?.identifier.text
}
} else {
[]
}
}
}
}

private enum NamedDeclType: CustomStringConvertible {
case function(name: String, resolvedName: String, isPrivate: Bool)
case enumElement(name: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import SwiftSyntax

@SwiftSyntaxRule(optIn: true)
struct TypeContentsOrderRule: Rule {
private typealias TypeContentOffset = (typeContent: TypeContent, offset: ByteCount)

var configuration = TypeContentsOrderConfiguration()

static let description = RuleDescription(
Expand Down
17 changes: 0 additions & 17 deletions Source/SwiftLintCore/Extensions/Dictionary+SwiftLint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ public struct SourceKittenDictionary {
(value["key.bodyoffset"] as? Int64).map(ByteCount.init)
}

/// Body byte range.
public var bodyByteRange: ByteRange? {
guard let offset = bodyOffset, let length = bodyLength else { return nil }
return ByteRange(location: offset, length: length)
}

/// Kind.
public var kind: String? {
value["key.kind"] as? String
Expand All @@ -76,12 +70,6 @@ public struct SourceKittenDictionary {
(value["key.nameoffset"] as? Int64).map(ByteCount.init)
}

/// Byte range of name.
public var nameByteRange: ByteRange? {
guard let offset = nameOffset, let length = nameLength else { return nil }
return ByteRange(location: offset, length: length)
}

/// Offset.
public var offset: ByteCount? {
(value["key.offset"] as? Int64).map(ByteCount.init)
Expand All @@ -103,11 +91,6 @@ public struct SourceKittenDictionary {
value["key.typename"] as? String
}

/// Documentation length.
public var docLength: ByteCount? {
(value["key.doclength"] as? Int64).flatMap(ByteCount.init)
}

/// The attribute for this dictionary, as returned by SourceKit.
public var attribute: String? {
value["key.attribute"] as? String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ public extension SourceKittenDictionary {
return results
}

func structures(forByteOffset byteOffset: ByteCount) -> [SourceKittenDictionary] {
var results = [SourceKittenDictionary]()

func parse(_ dictionary: SourceKittenDictionary) {
guard let byteRange = dictionary.byteRange, byteRange.contains(byteOffset) else {
return
}

results.append(dictionary)
dictionary.substructure.forEach(parse)
}
parse(self)
return results
}

/// Return the string content of this structure in the given file.
/// - Parameter file: File this structure occurs in
/// - Returns: The content of the file which this `SourceKittenDictionary` structure represents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
@preconcurrency import SourceKittenFramework

public extension SwiftDeclarationKind {
static let variableKinds: Set<SwiftDeclarationKind> = [
.varClass,
.varGlobal,
.varInstance,
.varLocal,
.varParameter,
.varStatic,
]

static let functionKinds: Set<SwiftDeclarationKind> = [
.functionAccessorAddress,
.functionAccessorDidset,
Expand All @@ -34,12 +25,4 @@ public extension SwiftDeclarationKind {
.associatedtype,
.enum,
]

static let extensionKinds: Set<SwiftDeclarationKind> = [
.extension,
.extensionClass,
.extensionEnum,
.extensionProtocol,
.extensionStruct,
]
}
Loading