-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Sharing .swiftlint.yml config(s) within a team across projects #1319
Comments
I don't think this requires anything other than #676. Do you agree @sundeepgupta? |
Yes, that would definitely make this possible. I was more curious about the approach in general (like using submodules or if there is a better way). In ESLint this can be done via NPM. Here is a snippet of the "devDependencies": {
"eslint": "3.6.1",
"eslint-config-google": "0.6.0"
}, |
I suppose it could be possible to do something similar with CocoaPods, but if we had some sort of configuration registry, I'd rather it work with all installation methods for SwiftLint. |
I've proposed an alternative approach which may address this? #1352 |
Hi @sundeepgupta, I live the idea of a team across config. Alas, the global one is ignored due to the missing merge function described here: #676 |
@gretzki How does/would each project pull in the team config file and keep it updated? |
@sundeepgupta As said, we've got one repo with shared config of all tools like oclint, provisioning profiles, etc. It's checked out in the same location on every developer's machine and on the CI machine. As it doesn't change daily or even weekly it is enough to update it occasionally. On the CI machines, we've got jobs updating the repo daily. That way, it stays updated. As I debugged SwiftLint I realized, that the project's config file is already been merged with the global one, that is being specified via the config option. I did some more research and found another related issue. I explain it in some more detail in #1357 1357 |
I see, thanks @gretzki |
I'm still not following fully, I think merging of configurations should be sufficient to enable this workflow. Am I missing something? If not, let's close this as a duplicate of #676. |
Yes, the merging would be sufficient along with some mechanism (left up to the team) to distribute the shared config. |
Good day all, Visiting this thread because of the exact intentions. My team achieved this via having a separate repo for the Swiftlint file & pointing to it via git submodule in all team projects. Then we point the project to it in Xcode build via |
For those of us integrating Swiftlint as a Cocoapod, you can:
CONFIG_FILE="${PODS_ROOT}/My-SwiftLint-Config/swiftlint.yml"
"${PODS_ROOT}/SwiftLint/swiftlint" --config $CONFIG_FILE |
Has anyone implemented anything to accomplish this?
My initial thoughts are to create a centralized repo,
configs
which would contain all team-wide rules. For example:app-config.yml
test-config.yml
Each project would include the
configs
repo as a submodule and create symlinks named.swiftlint.yml
in their app and test directories that would point to the respective config file. When the team decides to update rules, each project could update their submodule to keep in sync.The problem I see with that though is how would a project be able to override/append project specific rules? If inheriting rules was supported, perhaps the symlink lives at a higher directory level thereby allowing the project to override/append rules.
The text was updated successfully, but these errors were encountered: