Skip to content
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

Merged
merged 2 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
--ifdef no-indent

# rules

--disable redundantParens # https://github.com/nicklockwood/SwiftFormat/issues/638
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

2 changes: 1 addition & 1 deletion Tests/LoggingTests/LoggingTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class LoggingTest: XCTestCase {
"lazy": .stringConvertible(LazyMetadataBox { "rendered-at-first-use" })])
}

private func dontEvaluateThisString(file: StaticString = #file, line: UInt = #line) -> Logger.Message {
private func dontEvaluateThisString(file: StaticString = (#file), line: UInt = #line) -> Logger.Message {
XCTFail("should not have been evaluated", file: file, line: line)
return "should not have been evaluated"
}
Expand Down
12 changes: 10 additions & 2 deletions Tests/LoggingTests/TestLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,20 @@ internal struct LogEntry {
}

extension History {
func assertExist(level: Logger.Level, message: String, metadata: Logger.Metadata? = nil, file: StaticString = #file, line: UInt = #line) {
func assertExist(level: Logger.Level,
message: String,
metadata: Logger.Metadata? = nil,
file: StaticString = (#file),
line: UInt = #line) {
let entry = self.find(level: level, message: message, metadata: metadata)
XCTAssertNotNil(entry, "entry not found: \(level), \(String(describing: metadata)), \(message) ", file: file, line: line)
}

func assertNotExist(level: Logger.Level, message: String, metadata: Logger.Metadata? = nil, file: StaticString = #file, line: UInt = #line) {
func assertNotExist(level: Logger.Level,
message: String,
metadata: Logger.Metadata? = nil,
file: StaticString = (#file),
line: UInt = #line) {
let entry = self.find(level: level, message: message, metadata: metadata)
XCTAssertNil(entry, "entry was found: \(level), \(String(describing: metadata)), \(message)", file: file, line: line)
}
Expand Down