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 3, 2017
1 parent 54d6199 commit df82148
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 @@ -22,6 +22,11 @@
[Otávio Lima](https://github.com/otaviolima)
[#1710](https://github.com/realm/SwiftLint/issues/1710)

* 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 df82148

Please sign in to comment.