-
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
Add remote, parent & child configuration features #3058
Conversation
Generated by 🚫 Danger |
@jpsim I added the missing tests (didn't come up with a proper idea how to test remote configs though), so this is now finally ready for review 🎉 |
0f4ef95
to
3dbff86
Compare
3dbff86
to
97b61d7
Compare
I just rebased to fix merge conflicts |
97b61d7
to
e92efda
Compare
e92efda
to
0f38492
Compare
I just rebased to fix conflicts. |
e141d25
to
12e1795
Compare
12e1795
to
707ccf3
Compare
I just rebased to fix conflicts. |
7ddb50d
to
d95c3ac
Compare
Is there anything I can do to help this get merged and shipped? |
@mokagio Thanks for asking and offering your help! 👍 From my side, this PR is ready and only needs a review. But as it changes a lot of things quite significantly, such a review
But as this is a big PR and especially with the current situation, nobody can blame them for not having reviewed this yet or expect them to review this right now. So, what you can do, is what you already did: Test this PR in real projects (and post your results in this thread), so that we can find bugs or other issues that may still exist. That's really helpful and gives confidence that this PR actually works in real environments! 🚀 Also, if you have the time, you may also do a review! I just think that @jpsim or @marcelofabri or another experienced SwiftLint contributor should approve this PR, but that doesn't say that other opinions aren't valuable! |
d95c3ac
to
9eaafc7
Compare
9eaafc7
to
de94775
Compare
I just rebased to fix merge conflicts. |
de94775
to
e51a40b
Compare
Codecov Report
@@ Coverage Diff @@
## master #3058 +/- ##
==========================================
- Coverage 90.58% 90.21% -0.38%
==========================================
Files 416 423 +7
Lines 20406 21033 +627
==========================================
+ Hits 18484 18974 +490
- Misses 1922 2059 +137
Continue to review full report at Codecov.
|
e51a40b
to
6a19709
Compare
6a19709
to
92efddf
Compare
Codecov Report
@@ Coverage Diff @@
## master #3058 +/- ##
==========================================
- Coverage 90.48% 90.17% -0.32%
==========================================
Files 417 424 +7
Lines 20508 21135 +627
==========================================
+ Hits 18557 19058 +501
- Misses 1951 2077 +126
Continue to review full report at Codecov.
|
00f4a59
to
8a7018d
Compare
Quick update: I finished the rebase and implemented the review feedback, but noticed that I still have to take a closer look on the |
@fredpi This is incredible! I'd love to look this over and give feedback if you'd like once you're done finishing up what you mentioned in your last comment. That said, this has been outstanding for a long time, so I don't blame you if you just want to get it merged |
8a7018d
to
39e8d84
Compare
@sethfri While I didn't test everything myself yet, I don't see any major issues anymore, so I'd love it if you would try out the PR and report any issues you see! 👍 Also, it would be great if you could have a look at the new behavior specification for multiple configurations in the README and tell me whether you agree with these specifications. Of course, before this will get merged, I will also test everything myself again. |
@mokagio It would be great if you could also report whether this PR is still working for you ;) |
abc9a61
to
ed50938
Compare
@fredpi hey there! You're awesome for relentlessly working on this ❤️ I updated our experiment repo to use The only thing I noticed is that it's not respecting the As you can see in this CI build we're getting violation warnings from files in the Screenshot included because as I discovered GitHub Actions doesn't retain the logs indefinitely (for free repos, at least). The first couple of lines are from a file in |
3e8317b
to
a37d448
Compare
@mokagio Thanks for the feedback! 😃 I could reconstruct and understand the bug with the |
@fredpi thank you for your quick work! I updated to 👍 🙌 👏 |
4d094b8
to
3d20e27
Compare
3d20e27
to
4c5a3f0
Compare
I have added some more tests, tested the PR myself again and feel quite confident now that everything is working properly. So, if no new concerns get raised until then, I'm going to merge this on Sunday. @sethfri If you still want to take a look at this and don't have the time to do it until Sunday, please tell me – I would then delay the merging. |
Provides: - a runtime environment on ubuntu that does not include the Swift toolchain. - supportintg `docker build https://github.com/realm/SwiftLint.git` - add `libcurl4-openssl-dev` as build time dependency that introduced by #3058
I'm so happy this is in! ❤️ |
This PR closes #1352 and #2729.
It's basically the same as #2824, but I squashed all commits to keep it more comprehensible.
Change Overview
child_config
/parent_config
configurations. This even works recursively, as long as there are no cycles and no ambiguities.child_config
/parent_config
references)child_config
/parent_config
! This is just easy as dropping in a url that starts withhttp://
orhttps://
where normally there would be the path to a local file. Remote configs get cached (in a manner that git doesn't see it). There are timeouts to loading remote configs, that can also be customized usingremote_timeout
/remote_timeout_if_cached
Configuration
clutter has been cleaned up in a way that I hope everyone is happy with. I strongly felt like the current merging implementation that relied on arules
array and arulesMode
didn't express the very foundation of what a configuration is: A mode that is applied to an array of all available rules with configurations, resulting in an array of rules that should be linted. To express this very relation, I created the newRulesWrapper
type. While offering aresultingRules
variable that is lazily computed, it still retains what caused these rules and therefore eases understanding of the merging algorithm.Sidenote: Fixed Warnings in Moya
SwiftLintBot will probably complain that, with this new implementation, 3 warnings in Moya are now fixed. In fact, previously those have been false positives, as in the nested
.swiftlint.yml
covering these files there's the following configuration for thefile_length
rule:As the parent rule configuration was used for merging and there was no smart mechanism to decide which configuration to choose, the configuration originating from the nested configuration was ignored. With this PR, that's now fixed.