Skip to content

Commit 7f98aef

Browse files
authored
Merge pull request #2998 from ahoppen/enable-formatting
Enable format GitHub Action check
2 parents f2a32a7 + 02df9a3 commit 7f98aef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+156
-416
lines changed

.github/workflows/pull_request.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@ jobs:
1515
api_breakage_check_allowlist_path: "Release Notes/api-breakages.txt"
1616
# https://github.com/swiftlang/swift-syntax/issues/2987
1717
docs_check_enabled: false
18-
# https://github.com/swiftlang/swift-syntax/issues/2988
19-
format_check_enabled: false

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ swift-syntax is formatted using [swift-format](http://github.com/swiftlang/swift
2525

2626
To format your changes run the formatter using the following command
2727
```bash
28-
./swift-syntax-dev-utils format
28+
swift format --in-place --parallel --recursive .
29+
# Or alternatively
30+
swift format -ipr .
2931
```
3032
It will build a local copy of swift-format from the `main` branch and format the repository. Since it is building a release version of `swift-format`, the first run will take few minutes. Subsequent runs take less than 2 seconds.
3133

@@ -38,7 +40,7 @@ Generated source code is not formatted to make it easier to spot changes when re
3840
> #!/usr/bin/env bash
3941
> set -e
4042
> SOURCE_DIR=$(realpath "$(dirname $0)/../..")
41-
> swift "$SOURCE_DIR/swift-syntax-dev-utils" format --lint
43+
> swift format lint --strict --parallel --recursive $SOURCE_DIR
4244
> ```
4345
> 2. Mark the file as executable: `chmod a+x swift-syntax/.git/hooks/pre-commit`
4446
> 3. If you have global git hooks installed, be sure to call them at the end of the script with `path/to/global/hooks/pre-commit "$@"`

CodeGeneration/Sources/Utils/CopyrightHeader.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public var copyrightHeader: Trivia =
2525
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
2626
//
2727
//===----------------------------------------------------------------------===//
28-
//// Automatically generated by generate-swift-syntax
29-
//// Do not edit directly!
28+
// Automatically generated by generate-swift-syntax
29+
// Do not edit directly!
30+
// swift-format-ignore-file
3031
""" + .newlines(2)

Sources/SwiftParser/generated/ExperimentalFeatures.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
extension Parser {
1617
@_spi(ExperimentalLanguageFeatures)

Sources/SwiftParser/generated/IsLexerClassified.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax

Sources/SwiftParser/generated/LayoutNodes+Parsable.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax

Sources/SwiftParser/generated/Parser+TokenSpecSet.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax

Sources/SwiftParser/generated/TokenSpecStaticMembers.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax

Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax

Sources/SwiftParserDiagnostics/generated/SyntaxKindNameForDiagnostics.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//// Automatically generated by generate-swift-syntax
13-
//// Do not edit directly!
12+
// Automatically generated by generate-swift-syntax
13+
// Do not edit directly!
14+
// swift-format-ignore-file
1415

1516
#if compiler(>=6)
1617
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax

0 commit comments

Comments
 (0)