Skip to content

Commit

Permalink
Merge pull request #10 from ashfurrow/config-directory-docs
Browse files Browse the repository at this point in the history
Documentation for configFile & directory parameters
  • Loading branch information
ashfurrow authored Apr 2, 2018
2 parents 8eacb93 + 18f30da commit 8f5f9d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ If you want the lint result shows in diff instead of comment, you can use inline
SwiftLint.lint(inline: true)
```

#### Config & Directory

You can also specify a path to the config file using `configFile` parameter and a path to the directory you want to lint using `directory` parameter. This is helpful when you want to have different config files for different directories. E.g. Harvey wants to lint test files differently than the source files, thus they have the following setup:

```swift
SwiftLint.lint(directory: "Sources", configFile: ".swiftlint.yml")
SwiftLint.lint(directory: "Tests", configFile: "Tests/HarveyTests/.swiftlint.yml")
```

It's not possible to use [nested configurations](https://github.com/realm/SwiftLint#nested-configurations), because Danger SwiftLint lints each file on it's own, and by doing that the nested configuration is disabled. If you want to learn more details about this, read the whole issue [here](https://github.com/ashfurrow/danger-swiftlint/issues/4).

# Contributing

If you find a bug, please [open an issue](https://github.com/ashfurrow/danger-swiftlint/issues/new)! Or a pull request :wink:
Expand Down

0 comments on commit 8f5f9d2

Please sign in to comment.