Swift 6 build swiftlang/swift-format in its toolchain. Should this also work on linux?

One of the struggles with our cli tool is that the pipeline needs to build swiftlang/swift-format. I was surprised to read in the readme that it not is included in the xcode 16 toolchain and can be used system wide. Just test by running swift format -h and that works!

However if I try the same in pipeline that runs swiftlang/swift:nightly-6.0-jammy this times out. Is this to be expected? The command swift format lint just never starts.

The nightly Linux toolchains should include the formatter. We have adopt it in our NIO CI. You can see how we call it here swift-nio/.github/workflows/pull_request_soundness.yml at main · apple/swift-nio · GitHub

Does running swift-format lint (with - instead of a space) on Linux work?

Sorry to be late on my own question. With the nightly of swift now which is available in docker swift includes format as a subcommand also on linux.

# Just do not use the -!
swift format -h
OVERVIEW: Format or lint Swift source code

USAGE: swift-format [--version] <subcommand>

OPTIONS:
  -v, --version           Print the version and exit
  -h, --help              Show help information.

SUBCOMMANDS:
  dump-configuration      Dump the default configuration in JSON format to standard output
  format (default)        Format Swift source code
  lint                    Diagnose style issues in Swift source code

  See 'swift-format help <subcommand>' for detailed help.

But the weird thing is that it is not listed as a sub command of the swift main command. This seams a bug?

swift -h

...

Subcommands:

  swift build      Build Swift packages
  swift package    Create and work on packages
  swift run        Run a program from a package
  swift test       Run package tests
  swift repl       Experiment with Swift code interactively

  Use `swift --version` for Swift version information.

  Use `swift --help` for descriptions of available options and flags.

  Use `swift help <subcommand>` for more information about a subcommand.

created issue for it Swift 6 includes swift format sub command but does not list it · Issue #75502 · swiftlang/swift · GitHub