Skip to content

Commit

Permalink
Support non Swift files in --file argument
Browse files Browse the repository at this point in the history
Fixes #1721.
  • Loading branch information
marcelofabri committed Aug 17, 2017
1 parent b4b35c1 commit 016fac4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
[Ornithologist Coder](https://github.com/ornithocoder)
[#1093](https://github.com/realm/SwiftLint/issues/1093)

* Files with extensions other than `.swift` can now be used as argument
to `--file` when linting or autocorrecting.
[Marcelo Fabri](https://github.com/marcelofabri)
[#1721](https://github.com/realm/SwiftLint/issues/1721)

##### Bug Fixes

* Fix false positive on `force_unwrapping` rule when declaring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ extension Configuration {

internal func lintablePaths(inPath path: String,
fileManager: LintableFileManager = FileManager.default) -> [String] {
// If path is a Swift file, skip filtering with excluded/included paths
if path.bridge().isSwiftFile() && path.isFile {
// If path is a file, skip filtering with excluded/included paths
if path.isFile {
return [path]
}
let pathsForPath = included.isEmpty ? fileManager.filesToLint(inPath: path, rootDirectory: nil) : []
Expand Down

0 comments on commit 016fac4

Please sign in to comment.