Skip to content

Commit 02df9a3

Browse files
committed
Enable format GitHub Action check
Fixes #2988
1 parent f2a32a7 commit 02df9a3

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

-2
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

+4-2
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

+3-2
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

+3-2
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

+3-2
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

+3-2
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

+3-2
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

+3-2
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

+3-2
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

+3-2
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/TokenNameForDiagnostics.swift

+3-2
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/SwiftSyntax/generated/ChildNameForKeyPath.swift

+3-2
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 the keyPath is one from a layout structure, return the property name
1617
/// of it.

Sources/SwiftSyntax/generated/Keyword.swift

+3-2
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
public enum Keyword: UInt8, Hashable, Sendable {
1617
case __consuming

Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift

+3-2
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 AccessorDeclSyntax {
1617
@available(*, deprecated, renamed: "unexpectedBetweenModifierAndAccessorSpecifier")

Sources/SwiftSyntax/generated/RenamedNodesCompatibility.swift

+3-2
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
@available(*, deprecated, renamed: "ImportPathComponentListSyntax")
1617
public typealias AccessPathSyntax = ImportPathComponentListSyntax

Sources/SwiftSyntax/generated/SyntaxAnyVisitor.swift

+3-2
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
/// A `SyntaxVisitor` that can visit the nodes as generic ``Syntax`` values.
1617
///

Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift

+3-2
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
// MARK: - DeclSyntax
1617

Sources/SwiftSyntax/generated/SyntaxCollections.swift

+3-2
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
/// ### Children
1617
///

Sources/SwiftSyntax/generated/SyntaxEnum.swift

+3-2
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
/// Enum to exhaustively switch over all different syntax nodes.
1617
public enum SyntaxEnum: Sendable {

Sources/SwiftSyntax/generated/SyntaxKind.swift

+3-2
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
/// Enumerates the known kinds of Syntax represented in the Syntax tree.
1617
public enum SyntaxKind: Sendable {

Sources/SwiftSyntax/generated/SyntaxRewriter.swift

+3-2
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
//
1617
// This file defines the SyntaxRewriter, a class that performs a standard walk

Sources/SwiftSyntax/generated/SyntaxTraits.swift

+3-2
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
// MARK: - BracedSyntax
1617

Sources/SwiftSyntax/generated/SyntaxVisitor.swift

+3-2
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
/// The enum describes how the ``SyntaxVisitor`` should continue after visiting
1617
/// the current node.

Sources/SwiftSyntax/generated/TokenKind.swift

+3-2
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
/// Enumerates the kinds of tokens in the Swift language.
1617
public enum TokenKind: Hashable, Sendable {

Sources/SwiftSyntax/generated/Tokens.swift

+3-2
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 TokenSyntax {
1617
public static func arrowToken(

Sources/SwiftSyntax/generated/TriviaPieces.swift

+3-2
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
/// A contiguous stretch of a single kind of trivia. The constituent part of
1617
/// a ``Trivia`` collection.

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesAB.swift

+3-2
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
@_spi(ExperimentalLanguageFeatures)
1617
@_spi(RawSyntax)

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesC.swift

+3-2
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
@_spi(RawSyntax)
1617
public struct Raw_CanImportExprSyntax: RawExprSyntaxNodeProtocol {

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesD.swift

+3-2
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
@_spi(RawSyntax)
1617
public protocol RawDeclSyntaxNodeProtocol: RawSyntaxNodeProtocol {}

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesEF.swift

+3-2
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
@_spi(RawSyntax)
1617
public protocol RawExprSyntaxNodeProtocol: RawSyntaxNodeProtocol {}

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesGHI.swift

+3-2
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
@_spi(RawSyntax)
1617
public struct RawGenericArgumentClauseSyntax: RawSyntaxNodeProtocol {

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesJKLMN.swift

+3-2
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
@_spi(RawSyntax)
1617
public struct RawKeyPathComponentListSyntax: RawSyntaxNodeProtocol {

Sources/SwiftSyntax/generated/raw/RawSyntaxNodesOP.swift

+3-2
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
@_spi(RawSyntax)
1617
public protocol RawPatternSyntaxNodeProtocol: RawSyntaxNodeProtocol {}

0 commit comments

Comments
 (0)