Skip to content
New issue

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

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

Already on GitHub? # to your account

Rules file as argument to support multiple projects #1207

Closed
jacobjennings opened this issue Jan 17, 2017 · 7 comments
Closed

Rules file as argument to support multiple projects #1207

jacobjennings opened this issue Jan 17, 2017 · 7 comments
Labels
enhancement Ideas for improvements of existing features and rules. wontfix Issues that became stale and were auto-closed by a bot.

Comments

@jacobjennings
Copy link

It would be nice to specify a rules file as a command line argument, to support having one set of rules for multiple projects.

@ghost
Copy link

ghost commented Jan 18, 2017

What were you envisioning for this? A commandline argument? A configuration option in the .swiftlint.yml file that lists a path to this custom rules document?

@jacobjennings
Copy link
Author

Either way would be great. I like the configuration option in the .yml idea best

@jpsim
Copy link
Collaborator

jpsim commented Jan 21, 2017

Maybe we could support external file references in .swiftlint.yml. Maybe if used in backticks?

whitelist_rules: `~/.swiftlint/common_rules.yml`

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

I think in general it'd be better to have a base_configuration or something like this so this could be solved in a generic way. We'd probably need to implement #676 though.

@SDGGiesbrecht
Copy link
Contributor

This isn’t a native solution, but sharing configurations between projects is one of the reasons I started writing Workspace.

If...

  1. The only thing you want to configure is to disable rules, and...
  2. Your project supports the Swift Package Manager,

...Workspace should already be able to make SwiftLint share its configuration like you want. If your set‐up is more complicated, or if something below does not work properly, raise an issue at the Workspace repository, and I will look into it.

Steps:

  1. Read the summary of how to use Workspace.

  2. Add Workspace to each project.

  3. Create a configuration file like this one in one of the projects, then link to it like this in the other projects.

  4. Remove your own .swiftlint.yml from each project to pass control of SwiftLint off to Workspace.

  5. (Optional) Either put Workspace in charge of Xcode, or add the following script build phase to your own Xcode project:

~/.Workspace/Workspace/.build/release/workspace proofread

Thanks again to everyone at SwiftLint. Your work is much appreciated.

@pejalo
Copy link

pejalo commented Dec 12, 2017

I would love to reference the config file as a command line argument, or from within .swiftlint.config as @aamctustwo suggested. Ideally our organization could have a git repo for our versioned SwiftLint config file. SwiftLint would support loading the file via git@github.com:... (to bypass 2FA via https) along with a specific tag, similar to how CocoaPods can be referenced.

@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Ideas for improvements of existing features and rules. wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

No branches or pull requests

5 participants