Skip to content

Commit

Permalink
Fix picking the wrong configuration with —path
Browse files Browse the repository at this point in the history
Fixes #1744
  • Loading branch information
marcelofabri committed Aug 17, 2017
1 parent 49475d3 commit ffd7be5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
[Hossam Ghareeb](https://github.com/hossamghareeb)
[#1763](https://github.com/realm/SwiftLint/issues/1763)

* Fix using wrong configuration when using `--path` and when there is
a configuration in a parent directory.
[Marcelo Fabri](https://github.com/marcelofabri)
[#1744](https://github.com/realm/SwiftLint/issues/1744)

## 0.21.0: Vintage Washboard

##### Breaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ extension Configuration {
let pathNSString = path.bridge()
let configurationSearchPath = pathNSString.appendingPathComponent(Configuration.fileName)

if configurationSearchPath == configurationPath {
return self
}

// If a configuration exists and it isn't us, load and merge the configurations
if configurationSearchPath != configurationPath &&
FileManager.default.fileExists(atPath: configurationSearchPath) {
Expand Down

0 comments on commit ffd7be5

Please sign in to comment.