Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration via Command Line Flags? #1323

Closed
SDGGiesbrecht opened this issue Feb 20, 2017 · 5 comments
Closed

Configuration via Command Line Flags? #1323

SDGGiesbrecht opened this issue Feb 20, 2017 · 5 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@SDGGiesbrecht
Copy link
Contributor

(Related to #1207, but more specific.)

Is there a way to specify configuration options with command line flags, and still have them merged with any extant .swiftlint.yml files, or at least some other way of achieving a similar effect?

The reason I want to do this is that I am writing a project manager for Swift, Workspace, that stitches together and helps automate various tools like SwiftLint.

There are several configuration options that are necessary for SwiftLint to cooperate with the other tools, such as excluding the Swift Package Manager’s Packages folder. Right now I do this by writing a .swiftlint.yml file to the project root before running SwiftLint and deleting the file afterward. The problem with the current set‐up is that when a user wants to customize SwiftLint further by writing his or her own .swiftlint.yml, he or she must figure out what those basic necessary options are and include them manually.

I am looking for a way of specifying such options without touching any .swiftlint.yml files, so that they properly take effect no matter what, and at the same time the user can fully customize SwiftLint.

@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Feb 21, 2017
@marcelofabri
Copy link
Collaborator

There's no way to do this currently.

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2017

Maybe Workspace could ship with its own .swiftlint.yml file, stored in the app bundle maybe, and then the invocation of SwiftLint could specify that special config?

Although from what I can tell, Workspace is mostly intended to be built via SPM, which doesn't build bundles but static executables, so you could write the config file to ~/Library/Application Support/Workspace/.swiftlint.yml?

@SDGGiesbrecht
Copy link
Contributor Author

Maybe Workspace could ship with its own .swiftlint.yml file, stored in the app bundle maybe, and then the invocation of SwiftLint could specify that special config?

@jpsim, That would work, provided:


...from what I can tell, Workspace is mostly intended to be built via SPM...

Actually, for now it installs its own Git repository within ~/.Workspace (a Linux‐safe path) so that it can use resources and update itself easily.

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2017

Yes, you're correct on all counts there.

@SDGGiesbrecht
Copy link
Contributor Author

I’m closing this because its various aspects are each covered in other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

3 participants