-
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
Different output on different systems (Error: where
clauses are preferred)
#3990
Comments
@wdg different toolchains? try on each machine:
|
This is likely caused by different Swift versions - see #3975 |
Hi, Sorry for the delay. GitHub:
I accedently upgraded my Mac, I missed a step, so I'm running the beta software now (unfortunately).
|
@wdg give https://github.com/kylef/swiftenv a whirl. |
I'm seeing this too - one of our scenarios is using the docker (latest) image on an Ubuntu runner (this is the one flagging several new Edit: confirmed that going back and pinning the docker image to 0.47.1 instead of latest does not flag these new |
@wdg: Where in you example does the rule trigger. I do not manage to trigger the warning with any of the mentioned Swift versions in this example. @schlagelk: You say |
@SimplyDanny They seem like legit violations of this rule which were not previously reported |
Weird, on a / the test repo it doesn't happen... |
update: with further testing, the problem seems to be in a differtent file, the github reporter was pointing to a different file. /Users/runner/work/-iOS/-iOS/*/Views/Notifications/NotificationsService.swift:48:17: error: For Where Violation: which contained for notification in self.notification {
if !(notification.isRead ?? false) {
DispatchQueue.main.async {
self.unread += 1
}
}
} Still weird, that it triggered an error on the GitHub runner and not on my local machine. |
The This issue has been addressed in the context of #3975. Thus, with the current HEAD version of SwiftLint or its next coming release, the differences are expected to vanish. |
Thanks for confirming @SimplyDanny. Just to add another level of confidence to this diagnosis I went ahead and compiled the project from |
Thank you for checking that out and the confirmation of the theory! 👍 |
New Issue Checklist
Describe the bug
On 2 different systems with (almost) the same configuration I got different messages
Complete output when running SwiftLint, including the stack trace and command used
System 1 (MacOS Local)
System 2 (GitHub Worker)
Environment
swiftlint version
to be sure)?If so, paste their relative paths and respective contents.
xcodebuild -version
)?echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.===
Code
The text was updated successfully, but these errors were encountered: