Swiftlint: Implement support for changing configuration file path

Created on 26 Jul 2017  路  5Comments  路  Source: realm/SwiftLint

As part of our usage of Swiftlint, I'd like to propose being able to support a different path for configuration file, instead of being always .swiftlint.yml.

Like my previous suggestions, happy to prepare a PR for this.

We have two use cases for this:

  • We would potentially like to support having different configurations for our CI vs development. For example, having violations as warnings in development, but errors on the CI.
  • From a personal perspective, I'd like to not have the configuration as a hidden file (.swiftlint.yml). Swiftlint is a core part of our workflow and we've found some people are not sure where the configuration is, because, by default, macOS doesn't show hidden files.

I'd imagine simply another command line param e.g.: swiftlint --config-path=./swiftlint-ci.yml

Given that you can have swiftlint configuration files nested in folders, I'd expect them all to be named the same in the case, you can't mix and match.

Is this something useful or on your roadmap?

Most helpful comment

You can use swiftlint help lint to see all available options 馃槉

All 5 comments

You can use --config already.

Although I don't think nested configurations are supported currently (e.g. having all of them to be called config.yml).

cool, couldn't find anything documented but I see it in the code now.

Thanks!

You can use swiftlint help lint to see all available options 馃槉

@amlcurran, #1693 has a discussion on the possible future interaction of configuration merging and command line flags. (As Fabri said above, they are currently mutually exclusive.)

From what you鈥檝e said, it would directly affect (and hopefully help) your use case. I would love it if you would read #1693 and share some of your own thoughts.

Was this page helpful?
0 / 5 - 0 ratings