Skip to content

Commit 52c9df9

Browse files
authored
Merge pull request #2995 from ahoppen/enable-minor-soundness
Enable API breakage, unacceptable language and yamllint CI checks
2 parents f325c9c + 3ac3a9a commit 52c9df9

File tree

15 files changed

+169
-178
lines changed

15 files changed

+169
-178
lines changed

Diff for: .github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml

+34-34
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@ name: BasicFormat Bug
22
description: A bug in the BasicFormat module
33
labels: [bug, BasicFormat]
44
body:
5-
- type: markdown
6-
attributes:
7-
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports).
8-
- type: textarea
9-
id: source
10-
attributes:
11-
label: Source Code
12-
description: The source code that, when formatted, produces incorrectly formatted code.
13-
value: |
14-
```swift
15-
```
16-
- type: textarea
17-
id: source
18-
attributes:
19-
label: Actual Formatted Code
20-
description: The way that `BasicFormat` formats the above code
21-
value: |
22-
```swift
23-
```
5+
- type: markdown
6+
attributes:
7+
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports).
248
- type: textarea
25-
id: source
26-
attributes:
27-
label: Expected Formatted Code
28-
description: The way that you think `BasicFormat` should format the code
29-
value: |
30-
```swift
31-
```
32-
- type: textarea
33-
id: description
34-
attributes:
35-
label: Description
36-
description: |
37-
Any additional information you can provide for this issue, like
38-
- Has this issue started occurring recently?
39-
- Is the issue only happening under certain circumstances?
9+
id: source
10+
attributes:
11+
label: Source Code
12+
description: The source code that, when formatted, produces incorrectly formatted code.
13+
value: |
14+
```swift
15+
```
16+
- type: textarea
17+
id: source
18+
attributes:
19+
label: Actual Formatted Code
20+
description: The way that `BasicFormat` formats the above code
21+
value: |
22+
```swift
23+
```
24+
- type: textarea
25+
id: source
26+
attributes:
27+
label: Expected Formatted Code
28+
description: The way that you think `BasicFormat` should format the code
29+
value: |
30+
```swift
31+
```
32+
- type: textarea
33+
id: description
34+
attributes:
35+
label: Description
36+
description: |
37+
Any additional information you can provide for this issue, like
38+
- Has this issue started occurring recently?
39+
- Is the issue only happening under certain circumstances?

Diff for: .github/ISSUE_TEMPLATE/BUG_REPORT.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: Bug Report
22
description: Something isn't working as expected
33
labels: [bug]
44
body:
5-
- type: textarea
6-
id: description
7-
attributes:
8-
label: Description
9-
description: |
10-
A short description of the incorrect behavior.
11-
If you think this issue has been recently introduced and did not occur in an
12-
earlier version, please note that. If possible, include the last version that
13-
the behavior was correct in addition to your current version.
14-
- type: textarea
15-
id: steps-to-reproduce
16-
attributes:
17-
label: Steps to Reproduce
18-
description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior.
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: |
10+
A short description of the incorrect behavior.
11+
If you think this issue has been recently introduced and did not occur in an
12+
earlier version, please note that. If possible, include the last version that
13+
the behavior was correct in addition to your current version.
14+
- type: textarea
15+
id: steps-to-reproduce
16+
attributes:
17+
label: Steps to Reproduce
18+
description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior.

Diff for: .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Feature Request
22
description: A suggestion for a new feature
33
labels: [enhancement]
44
body:
5-
- type: textarea
6-
id: description
7-
attributes:
8-
label: Description
9-
description: |
10-
A description of your proposed feature.
11-
Examples that show what's missing, or what new capabilities will be possible, are very helpful!
12-
If this feature unlocks new use-cases please describe them.
13-
Provide links to existing issues or external references/discussions, if appropriate.
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: |
10+
A description of your proposed feature.
11+
Examples that show what's missing, or what new capabilities will be possible, are very helpful!
12+
If this feature unlocks new use-cases please describe them.
13+
Provide links to existing issues or external references/discussions, if appropriate.

Diff for: .github/ISSUE_TEMPLATE/PARSER_BUG.yml

+33-33
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ name: SwiftParser Bug
22
description: A bug in the new Swift parser
33
labels: [bug, SwiftParser]
44
body:
5-
- type: markdown
6-
attributes:
7-
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports).
8-
- type: dropdown
9-
id: issue-type
10-
attributes:
11-
label: Issue Kind
12-
description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details.
13-
options:
14-
- Round-Trip Failure
15-
- Parser Crash
16-
- Parse of Valid Source Failed
17-
- Parse of Valid Source Produced Invalid Syntax Tree
18-
- Bad Diagnostic Produced
19-
- Other
20-
- I Don’t Know
21-
- type: textarea
22-
id: source
23-
attributes:
24-
label: Source Code
25-
description: The source code that, when fed into the parser, produces the bug.
26-
value: |
27-
```swift
28-
```
29-
- type: textarea
30-
id: description
31-
attributes:
32-
label: Description
33-
description: |
34-
Any additional information you can provide for this issue, like
35-
- What did you expect to happen?
36-
- Has this issue started occurring recently?
37-
- If it’s a crash, the stack trace.
5+
- type: markdown
6+
attributes:
7+
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports).
8+
- type: dropdown
9+
id: issue-type
10+
attributes:
11+
label: Issue Kind
12+
description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details.
13+
options:
14+
- Round-Trip Failure
15+
- Parser Crash
16+
- Parse of Valid Source Failed
17+
- Parse of Valid Source Produced Invalid Syntax Tree
18+
- Bad Diagnostic Produced
19+
- Other
20+
- I Don’t Know
21+
- type: textarea
22+
id: source
23+
attributes:
24+
label: Source Code
25+
description: The source code that, when fed into the parser, produces the bug.
26+
value: |
27+
```swift
28+
```
29+
- type: textarea
30+
id: description
31+
attributes:
32+
label: Description
33+
description: |
34+
Any additional information you can provide for this issue, like
35+
- What did you expect to happen?
36+
- Has this issue started occurring recently?
37+
- If it’s a crash, the stack trace.

Diff for: .github/ISSUE_TEMPLATE/config.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# This source file is part of the Swift.org open source project
2-
#
3-
# Copyright (c) 2022 Apple Inc. and the Swift project authors
4-
# Licensed under Apache License v2.0 with Runtime Library Exception
5-
#
6-
# See https://swift.org/LICENSE.txt for license information
7-
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
2+
#
3+
# Copyright (c) 2022 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See https://swift.org/LICENSE.txt for license information
7+
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
88

9-
contact_links:
10-
- name: Discussion Forum
11-
url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax
12-
about: Ask and answer questions about SwiftSyntax
13-
- name: SwiftSyntax Documentation
14-
url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax
15-
about: Learn about how to use the SwiftSyntax in your projects
9+
contact_links:
10+
- name: Discussion Forum
11+
url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax
12+
about: Ask and answer questions about SwiftSyntax
13+
- name: SwiftSyntax Documentation
14+
url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax
15+
about: Learn about how to use the SwiftSyntax in your projects

Diff for: .github/workflows/pull_request.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ jobs:
1515
name: Soundness
1616
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
1717
with:
18-
# https://github.com/swiftlang/swift-syntax/issues/2986
19-
api_breakage_check_enabled: false
18+
api_breakage_check_allowlist_path: "Release Notes/api-breakages.txt"
2019
# https://github.com/swiftlang/swift-syntax/issues/2987
2120
docs_check_enabled: false
2221
# https://github.com/swiftlang/swift-syntax/issues/2988
2322
format_check_enabled: false
24-
# https://github.com/swiftlang/swift-syntax/issues/2990
25-
unacceptable_language_check_enabled: false
26-
# https://github.com/swiftlang/swift-syntax/issues/2991
27-
yamllint_check_enabled: false

Diff for: .spi.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# This is manifest file for the Swift Package Index for it to
1+
# This is manifest file for the Swift Package Index for it to
22
# auto-generate and host DocC documentation.
33
# For reference see https://swiftpackageindex.com/swiftpackageindex/spimanifest/documentation/spimanifest/commonusecases#Host-DocC-documentation-in-the-Swift-Package-Index.
44

55
version: 1
66
builder:
77
configs:
88
- documentation_targets:
9-
# First item in the list is the "landing" (default) target
10-
- SwiftSyntax
11-
- SwiftBasicFormat
12-
- SwiftCompilerPlugin
13-
- SwiftDiagnostics
14-
- SwiftIDEUtils
15-
- SwiftIfConfig
16-
- SwiftLexicalLookup
17-
- SwiftOperators
18-
- SwiftParser
19-
- SwiftParserDiagnostics
20-
- SwiftRefactor
21-
- SwiftSyntaxBuilder
22-
- SwiftSyntaxMacros
23-
- SwiftSyntaxMacroExpansion
24-
- SwiftSyntaxMacrosGenericTestSupport
25-
- SwiftSyntaxMacrosTestSupport
9+
# First item in the list is the "landing" (default) target
10+
- SwiftSyntax
11+
- SwiftBasicFormat
12+
- SwiftCompilerPlugin
13+
- SwiftDiagnostics
14+
- SwiftIDEUtils
15+
- SwiftIfConfig
16+
- SwiftLexicalLookup
17+
- SwiftOperators
18+
- SwiftParser
19+
- SwiftParserDiagnostics
20+
- SwiftRefactor
21+
- SwiftSyntaxBuilder
22+
- SwiftSyntaxMacros
23+
- SwiftSyntaxMacroExpansion
24+
- SwiftSyntaxMacrosGenericTestSupport
25+
- SwiftSyntaxMacrosTestSupport
2626
custom_documentation_parameters: [--experimental-skip-synthesized-symbols]

Diff for: CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxBaseNodesFile.swift

+6-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
4242
/// These methods enable casting between syntax node types within the same
4343
/// base node protocol hierarchy (e.g., ``DeclSyntaxProtocol``).
4444
///
45-
/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
45+
/// While ``SyntaxProtocol`` offers general casting methods (``SyntaxProtocol.as(_:)``,
4646
/// ``SyntaxProtocol.is(_:)``, and ``SyntaxProtocol.cast(_:)``), these often aren't
4747
/// appropriate for use on types conforming to a specific base node protocol
4848
/// like ``\#(node.kind.protocolType)``. That's because at this level,
@@ -51,7 +51,7 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
5151
///
5252
/// To guide developers toward correct usage, this extension provides overloads
5353
/// of these casting methods that are restricted to the same base node type.
54-
/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
54+
/// Furthermore, it marks the inherited casting methods from ``SyntaxProtocol`` as
5555
/// deprecated, indicating that they will always fail when used in this context.
5656
extension \#(node.kind.protocolType) {
5757
/// Checks if the current syntax node can be cast to a given specialized syntax type.
@@ -184,9 +184,8 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
184184
"""
185185
/// Create a \(raw: node.kind.doccLink) node from a specialized syntax node.
186186
public init(_ syntax: __shared some \(node.kind.protocolType)) {
187-
// We know this cast is going to succeed. Go through init(_: SyntaxData)
188-
// to do a sanity check and verify the kind matches in debug builds and get
189-
// maximum performance in release builds.
187+
// We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
188+
// verify the kind matches in debug builds and get maximum performance in release builds.
190189
self = Syntax(syntax).cast(Self.self)
191190
}
192191
"""
@@ -205,9 +204,8 @@ let syntaxBaseNodesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
205204
DeclSyntax(
206205
"""
207206
public init(fromProtocol syntax: __shared \(node.kind.protocolType)) {
208-
// We know this cast is going to succeed. Go through init(_: SyntaxData)
209-
// to do a sanity check and verify the kind matches in debug builds and get
210-
// maximum performance in release builds.
207+
// We know this cast is going to succeed. Go through `init(_: SyntaxData)` just to double-check and
208+
// verify the kind matches in debug builds and get maximum performance in release builds.
211209
self = Syntax(syntax).cast(Self.self)
212210
}
213211
"""

Diff for: Contributor Documentation/API Breakage Checks.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# API Breakage Checks
2+
3+
We have a CI jobs that checks for API breakages. Since swift-syntax releases increase the major version number, it is possible to make API-breaking changes – but we should avoid them whenever possible to avoid churn on clients when they update to a new swift-syntax version.
4+
5+
If your change contains an API breaking change, add the change to `api-breakages.txt`. All API breaking changes should be accompanied by an [RFC](RFC%20Process.md).

Diff for: Contributor Documentation/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
The following documentation documents are primarily intended for developers of swift-syntax.
44

5+
- [API Breakage Checks](API%20Breakage%20Checks.md)
56
- [Changing Swift Syntax](Changing%20Swift%20Syntax.md)
67
- [Filing Parser Bug Reports](Filing%20Parser%20Bug%20Reports.md)
78
- [Fixing Bugs](Fixing%20Bugs.md)

Diff for: Sources/SwiftParser/Expressions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ extension Parser {
583583
) -> RawExprSyntax {
584584
// Try parse a single value statement as an expression (e.g do/if/switch).
585585
// Note we do this here in parseUnaryExpression as we don't allow postfix
586-
// syntax to hang off such expressions to avoid ambiguities such as postfix
586+
// syntax to be attached to such expressions to avoid ambiguities such as postfix
587587
// '.member', which can currently be parsed as a static dot member for a
588588
// result builder.
589589
switch self.at(anyIn: SingleValueStatementExpression.self) {

0 commit comments

Comments
 (0)