swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.46k stars 226 forks source link

Lint is inconsistent on how source paths are reported #818

Open thomasvl opened 4 days ago

thomasvl commented 4 days ago
  1. Checkout https://github.com/apple/swift-protobuf @ c9fbc332ed293c64ff70af8d82367ca530dce11c
  2. Run
    swift format lint \
        Sources/SwiftProtobuf/Message.swift \
        Tests/SwiftProtobufTests/Test_Extensions.swift

You get:

Sources/SwiftProtobuf/Message.swift:46:16: warning: [DontRepeatTypeInStaticProperties] remove the suffix 'Message' from the name of the variable 'protoMessageName'
/Users/thomasvl/src/github/swift-protobuf/Tests/SwiftProtobufTests/Test_Extensions.swift:97:68: warning: [EndOfLineComment] move end-of-line comment that exceeds the line length

The order of the two arguments doesn't matters, the path to Message.swift is reported as the shortened relative path and Test_Extensions.swift is always reported as a full path instead.

ahoppen commented 4 days ago

Synced to Apple’s issue tracker as rdar://136639896