format.sh 749 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. ##===----------------------------------------------------------------------===##
  3. ##
  4. ## This source file is part of the Swift Argument Parser open source project
  5. ##
  6. ## Copyright (c) 2025 Apple Inc. and the Swift project authors
  7. ## Licensed under Apache License v2.0 with Runtime Library Exception
  8. ##
  9. ## See https://swift.org/LICENSE.txt for license information
  10. ##
  11. ##===----------------------------------------------------------------------===##
  12. # Move to the project root
  13. cd "$(dirname "$0")" || exit
  14. cd ..
  15. echo "Formatting Swift sources in $(pwd)"
  16. # Run the format / lint commands
  17. git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
  18. git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel