-
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
Extend SwiftLint to allow team-wide and project-specific configs together #1357
Comments
Hi @nigelflack, But yeah, same good ideas ;) |
As I debugged SwiftLint I realized, that the project's config file is already being merged with the global one specified via the config option. |
Ok, this was closed a bit early. |
Hi @jpsim . |
Hi, @gretzki! Have you debugged this merge call? I set a breakpoint at |
With SwiftLint it's currently possible to specify such a shared config file via the
--config
option.Having a project-specific .swiftlint.yml file at the root of the project, a merge of both configurations is already possible. Even if the merge function is not implemented yet, as stated in #676.
But having multiple project specific configurations at different locations inside the project and one global configuration specified, the merge function is not invoked as expected.
The following example should clarify the problem:
$PROJECT_ROOT /
$HOME /
When analysing the project with
swiftlint lint --path $PROJECT_ROOT --config $HOME/corporation-wide-swiftlint.yml
the merge function is invoked as follows:Merge1)
$PROJECT_ROOT/.swiftlint.yml (as parameter)
$HOME/corporation-wide-swiftlint.yml (as self)
Merge2)
$PROJECT_ROOT/Database/.swiftlint.yml (as parameter)
$HOME/corporation-wide-swiftlint.yml (as self)
Expected behavior:
When linting
B.swift
I would expect the recursive merge to merge as follows:Expected Merge2a)
$PROJECT_ROOT/Database/.swiftlint.yml (as parameter)
$PROJECT_ROOT/.swiftlint.yml (as self)
Expected Merge2b)
Merged config of merge2a (as parameter)
$HOME/corporation-wide-swiftlint.yml (as self)
The text was updated successfully, but these errors were encountered: