Skip to content

Enable format GitHub Action check #2998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ jobs:
api_breakage_check_allowlist_path: "Release Notes/api-breakages.txt"
# https://github.com/swiftlang/swift-syntax/issues/2987
docs_check_enabled: false
# https://github.com/swiftlang/swift-syntax/issues/2988
format_check_enabled: false
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ swift-syntax is formatted using [swift-format](http://github.com/swiftlang/swift

To format your changes run the formatter using the following command
```bash
./swift-syntax-dev-utils format
swift format --in-place --parallel --recursive .
# Or alternatively
swift format -ipr .
```
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.

Expand All @@ -38,7 +40,7 @@ Generated source code is not formatted to make it easier to spot changes when re
> #!/usr/bin/env bash
> set -e
> SOURCE_DIR=$(realpath "$(dirname $0)/../..")
> swift "$SOURCE_DIR/swift-syntax-dev-utils" format --lint
> swift format lint --strict --parallel --recursive $SOURCE_DIR
> ```
> 2. Mark the file as executable: `chmod a+x swift-syntax/.git/hooks/pre-commit`
> 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 "$@"`
Expand Down
5 changes: 3 additions & 2 deletions CodeGeneration/Sources/Utils/CopyrightHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public var copyrightHeader: Trivia =
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file
""" + .newlines(2)
5 changes: 3 additions & 2 deletions Sources/SwiftParser/generated/ExperimentalFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

extension Parser {
@_spi(ExperimentalLanguageFeatures)
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftParser/generated/IsLexerClassified.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftParser/generated/LayoutNodes+Parsable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftParser/generated/Parser+TokenSpecSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftParser/generated/TokenSpecStaticMembers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

#if compiler(>=6)
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) internal import SwiftSyntax
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/ChildNameForKeyPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// If the keyPath is one from a layout structure, return the property name
/// of it.
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/Keyword.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

public enum Keyword: UInt8, Hashable, Sendable {
case __consuming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

extension AccessorDeclSyntax {
@available(*, deprecated, renamed: "unexpectedBetweenModifierAndAccessorSpecifier")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@available(*, deprecated, renamed: "ImportPathComponentListSyntax")
public typealias AccessPathSyntax = ImportPathComponentListSyntax
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxAnyVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// A `SyntaxVisitor` that can visit the nodes as generic ``Syntax`` values.
///
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

// MARK: - DeclSyntax

Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxCollections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// ### Children
///
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxEnum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// Enum to exhaustively switch over all different syntax nodes.
public enum SyntaxEnum: Sendable {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// Enumerates the known kinds of Syntax represented in the Syntax tree.
public enum SyntaxKind: Sendable {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxRewriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

//
// This file defines the SyntaxRewriter, a class that performs a standard walk
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxTraits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

// MARK: - BracedSyntax

Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/SyntaxVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// The enum describes how the ``SyntaxVisitor`` should continue after visiting
/// the current node.
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/TokenKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// Enumerates the kinds of tokens in the Swift language.
public enum TokenKind: Hashable, Sendable {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/Tokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

extension TokenSyntax {
public static func arrowToken(
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/TriviaPieces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

/// A contiguous stretch of a single kind of trivia. The constituent part of
/// a ``Trivia`` collection.
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesAB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(ExperimentalLanguageFeatures)
@_spi(RawSyntax)
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public struct Raw_CanImportExprSyntax: RawExprSyntaxNodeProtocol {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public protocol RawDeclSyntaxNodeProtocol: RawSyntaxNodeProtocol {}
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesEF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public protocol RawExprSyntaxNodeProtocol: RawSyntaxNodeProtocol {}
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesGHI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public struct RawGenericArgumentClauseSyntax: RawSyntaxNodeProtocol {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesJKLMN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public struct RawKeyPathComponentListSyntax: RawSyntaxNodeProtocol {
Expand Down
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesOP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
// Automatically generated by generate-swift-syntax
// Do not edit directly!
// swift-format-ignore-file

@_spi(RawSyntax)
public protocol RawPatternSyntaxNodeProtocol: RawSyntaxNodeProtocol {}
Expand Down
Loading