Skip to content

Commit

Permalink
Fix nested config traversing did not stop on root path
Browse files Browse the repository at this point in the history
  • Loading branch information
norio-nomura committed Feb 13, 2016
1 parent 1234ae5 commit f9fc51b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/SwiftLintFramework/Models/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public struct Configuration: Equatable {
if path.isEmpty || !NSFileManager.defaultManager().fileExistsAtPath(fullPath) {
if !optional { fail() }
self.init()!
self.rootPath = rootPath
return
}
do {
Expand All @@ -165,6 +166,7 @@ public struct Configuration: Equatable {
}
self.init(dict: dict)!
configurationPath = fullPath
self.rootPath = rootPath
return
} catch {
fail()
Expand Down Expand Up @@ -202,7 +204,7 @@ extension Configuration {
// If a configuration exists and it isn't us, load and merge the gurations
if configurationSearchPath != configurationPath &&
NSFileManager.defaultManager().fileExistsAtPath(configurationSearchPath) {
return merge(Configuration(path: configurationSearchPath, optional: false, quiet: true))
return merge(Configuration(path: configurationSearchPath, rootPath: rootPath, optional: false, quiet: true))
}

// If we are not at the root path, continue down the tree
Expand Down

0 comments on commit f9fc51b

Please sign in to comment.