-
Notifications
You must be signed in to change notification settings - Fork 291
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
silence #file to #filePath warnings #133
Conversation
weissi
commented
Jun 1, 2020
•
edited
Loading
edited
Formatting issues: https://ci.swiftserver.group/job/swift-log-swift50-prb/162/console (whitespace) PR LGTM, ok to keep compatibility and no surprising changes I guess. |
I'm deliberately not fixing the formatting right now because I think this is blocked on https://bugs.swift.org/browse/SR-12934 |
68dc009
to
2fc1809
Compare
@ktoso PR totally different now. Swift 5.3 actually keeps the behaviour, we just need to silence the XCTest warnings for now. |
@@ -11,3 +11,5 @@ | |||
--ifdef no-indent | |||
|
|||
# rules | |||
|
|||
--disable redundantParens # https://github.com/nicklockwood/SwiftFormat/issues/638 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Tests/LoggingTests/TestLogger.swift
Outdated
@@ -292,3 +300,14 @@ internal struct TestLibrary { | |||
} | |||
} | |||
} | |||
|
|||
#if compiler(>=5.3) | |||
internal func fullFilePath(_ filePath: StaticString = #filePath) -> StaticString { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this one in tests?
If #file == #filePath but just the warning around = #file
sounds like there should be no difference on how we treat this in tests and the lib itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for digging into and sanity checking all this.
Not sure all the comments / usage are consistent now?
0558512
to
a12d094
Compare
Motivation: Swift 5.3 will keep `#file` == `#filePath` but starts warning if you pass `#file` to an argument that's `#filePath` defaulted (XCTest). Modification: - Replace `#file` with `(#file)` to silence the warning. In Swift 5.3 `#file` == `#filePath`. Result: No warnings
// was meant for: #135 Status update — I think this likely will be fine but I’ve ran out of time in the day to get it to completion in my project to really see it work out end to end. It makes the label pretty useless but I guess we’ll agree that’s what it is. I’ll post a review tomorrow |
// was meant for: #135
I thought about Let's consider a whole system and let's assume the system offers 2 services, let's call them service A and service B. Services A & B both use a multitude of sub-subsystems. Then everything that belongs to Service A gets
|
@ktoso I think we're discussing this on the wrong issue actually :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Motivation: Swift 5.3 will keep `#file` == `#filePath` but starts warning if you pass `#file` to an argument that's `#filePath` defaulted (XCTest). Modification: - Replace `#file` with `(#file)` to silence the warning. In Swift 5.3 `#file` == `#filePath`. Result: No warnings