Skip to content

Commit bcc691d

Browse files
Remove proposal IDs from discussion extraction exception list
Remove IDs for proposals with formatting fixes from the exception list that ignores issues with this field. Update test snapshot to match latest proposals and new expected results
1 parent f015f86 commit bcc691d

13 files changed

+2492
-2278
lines changed

Sources/EvolutionMetadataExtraction/Extractors/FieldExtractors/DiscussionExtractor.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,33 @@ struct DiscussionExtractor: MarkupWalker, ValueExtractor {
4141
}
4242
}
4343

44+
// VALIDATION ENHANCEMENT: Potentially check for:
45+
// - Incorrect order of discussions (e.g. review before pitch)
46+
// - Non-standard naming
47+
// - 1st instead of first
48+
// - 'returned for revision' instead of 'revision'
49+
// - Capitalized values
50+
// - non-standard discussion names
51+
// - Formatting (in parenthesis, separated by comma, etc.
52+
4453
return ExtractionResult(value: discussions, warnings: warnings, errors: errors)
4554
}
4655

4756
// Existing proposals with known validation errors.
4857
// The listed exceptions will not generate warnings and errors for the known issues.
4958
private enum Legacy {
50-
static let missingReviewFields: Set<String> = ["SE-0001", "SE-0002", "SE-0004", "SE-0020", "SE-0051", "SE-0079", "SE-0100", "SE-0176", "SE-0177", "SE-0188", "SE-0193", "SE-0194", "SE-0196", "SE-0198", "SE-0201", "SE-0203", "SE-0205", "SE-0208", "SE-0209", "SE-0210", "SE-0212", "SE-0213", "SE-0219", "SE-0243", "SE-0245", "SE-0247", "SE-0248", "SE-0249", "SE-0250", "SE-0252", "SE-0259", "SE-0263", "SE-0268", "SE-0269", "SE-0273", "SE-0278", "SE-0284", "SE-0289", "SE-0295", "SE-0300", "SE-0303", "SE-0304", "SE-0312", "SE-0313", "SE-0317", "SE-0318", "SE-0337", "SE-0338", "SE-0341", "SE-0343", "SE-0344", "SE-0348", "SE-0350", "SE-0356", "SE-0365", "SE-0385",
51-
"SE-0433"]
59+
static let missingReviewFields: Set<String> = ["SE-0001", "SE-0002", "SE-0004", "SE-0020", "SE-0051", "SE-0079", "SE-0100", "SE-0176", "SE-0177", "SE-0188", "SE-0193", "SE-0194", "SE-0196", "SE-0198", "SE-0201", "SE-0203", "SE-0205", "SE-0208", "SE-0209", "SE-0210", "SE-0212", "SE-0213", "SE-0219", "SE-0243", "SE-0245", "SE-0247", "SE-0248", "SE-0249", "SE-0250", "SE-0252", "SE-0259", "SE-0263", "SE-0268", "SE-0269", "SE-0273", "SE-0278", "SE-0284", "SE-0289", "SE-0295", "SE-0300", "SE-0303", "SE-0304", "SE-0312", "SE-0313", "SE-0317", "SE-0318", "SE-0337", "SE-0338", "SE-0341", "SE-0343", "SE-0344", "SE-0348", "SE-0350", "SE-0356", "SE-0365", "SE-0385"]
5260

53-
static let discussionExtractionFailures: Set<String> = ["SE-0099", "SE-0363", "SE-0378", "SE-0391", "SE-0392"]
61+
static let discussionExtractionFailures: Set<String> = ["SE-0392"]
5462
}
5563

5664
mutating func visitLink(_ link: Link) -> () {
5765
guard let linkInfo = LinkInfo(link: link) else {
5866
return
5967
}
6068

69+
// VALIDATION ENHANCEMENT: Potentially check for links with numbers as last two path components.
70+
// This would catch cases not linked to the top of the discussion, but a post in the middle.
6171
if let discussionURL = linkInfo.swiftForumsDestination {
6272
discussions.append(Proposal.Discussion(name: linkInfo.text, link: discussionURL))
6373
} else {

Tests/ExtractionTests/Resources/AllProposals.evosnapshot/expected-results.json

Lines changed: 182 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit" : "3a0ba96f7d09df771e82e0bce95bda6a8f1dc8cd",
3-
"creationDate" : "2024-04-23T00:21:36Z",
2+
"commit" : "d456463a0921794d4c8cfc9ad893202bce01d677",
3+
"creationDate" : "2024-05-01T16:18:29Z",
44
"implementationVersions" : [
55
"2.2", "3.0", "3.0.1", "3.1", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2",
66
"5.3", "5.4", "5.5", "5.5.2", "5.6", "5.7", "5.8", "5.9", "5.9.2", "5.10",
@@ -4131,6 +4131,18 @@
41314131
}
41324132
],
41334133
"discussions" : [
4134+
{
4135+
"link" : "https:\/\/forums.swift.org\/t\/pitch-making-where-and-interchangeable-in-guard-conditions\/2702",
4136+
"name" : "pitch"
4137+
},
4138+
{
4139+
"link" : "https:\/\/forums.swift.org\/t\/review-se-0099-restructuring-condition-clauses\/2808",
4140+
"name" : "review"
4141+
},
4142+
{
4143+
"link" : "https:\/\/forums.swift.org\/t\/accepted-with-revision-se-0099-restructuring-condition-clauses\/2921",
4144+
"name" : "acceptance"
4145+
}
41344146
],
41354147
"id" : "SE-0099",
41364148
"link" : "0099-conditionclauses.md",
@@ -4144,22 +4156,13 @@
41444156
"name" : "Joe Groff"
41454157
}
41464158
],
4147-
"sha" : "db41664fc6f9682e936268e070bc3baed186be68",
4159+
"sha" : "32410c59d5cab024327c17137d6d21b378a5a0f5",
41484160
"status" : {
41494161
"state" : "implemented",
41504162
"version" : "3.0"
41514163
},
41524164
"summary" : "Swift condition clauses appear in `guard`, `if`, and `while` statements. This proposal re-architects the condition grammar to enable an arbitrary mix of Boolean expressions, `let` conditions (which test and unwrap optionals), general `case` clauses for arbitrary pattern matching, and availability tests. It removes `where` clauses from optional binding conditions and case conditions, and eliminates gramatical ambiguity by using commas for separation between clauses instead of using them both to separate clauses and terms within each clause. These modifications streamline Swift's syntax and alleviate the situation where many Swift developers don't know they can use arbitrary Boolean conditions after a value binding.",
4153-
"title" : "Restructuring Condition Clauses",
4154-
"warnings" : [
4155-
{
4156-
"code" : 0,
4157-
"kind" : "warning",
4158-
"message" : "Discussion link doesn't refer to a Swift forum thread. Discussion removed.",
4159-
"stage" : "validate",
4160-
"suggestion" : ""
4161-
}
4162-
]
4165+
"title" : "Restructuring Condition Clauses"
41634166
},
41644167
{
41654168
"authors" : [
@@ -16168,6 +16171,18 @@
1616816171
}
1616916172
],
1617016173
"discussions" : [
16174+
{
16175+
"link" : "https:\/\/forums.swift.org\/t\/pitch-unicode-for-string-processing\/56907",
16176+
"name" : "pitch"
16177+
},
16178+
{
16179+
"link" : "https:\/\/forums.swift.org\/t\/se-0363-unicode-for-string-processing\/58520",
16180+
"name" : "review"
16181+
},
16182+
{
16183+
"link" : "https:\/\/forums.swift.org\/t\/accepted-se-0363-unicode-for-string-processing\/59998",
16184+
"name" : "acceptance"
16185+
}
1617116186
],
1617216187
"id" : "SE-0363",
1617316188
"link" : "0363-unicode-for-string-processing.md",
@@ -16181,7 +16196,7 @@
1618116196
"name" : "Ben Cohen"
1618216197
}
1618316198
],
16184-
"sha" : "43bbe84b05d57654876e103d4c468e8a34c7ec20",
16199+
"sha" : "6c41352258a6d94e94f005392889bb2719d495d4",
1618516200
"status" : {
1618616201
"state" : "implemented",
1618716202
"version" : "5.7"
@@ -16964,6 +16979,18 @@
1696416979
}
1696516980
],
1696616981
"discussions" : [
16982+
{
16983+
"link" : "https:\/\/forums.swift.org\/t\/pitch-package-registry-authentication\/61047",
16984+
"name" : "pitch"
16985+
},
16986+
{
16987+
"link" : "https:\/\/forums.swift.org\/t\/se-0378-swift-package-registry-authentication\/61436",
16988+
"name" : "review"
16989+
},
16990+
{
16991+
"link" : "https:\/\/forums.swift.org\/t\/accepted-with-modifications-se-0378-swift-package-registry-authentication\/62556",
16992+
"name" : "acceptance"
16993+
}
1696716994
],
1696816995
"id" : "SE-0378",
1696916996
"implementation" : [
@@ -16985,7 +17012,7 @@
1698517012
"name" : "Tom Doron"
1698617013
}
1698717014
],
16988-
"sha" : "5b20615c83d10dc11a8199713d6e507257b06089",
17015+
"sha" : "7a9f9f825f33cc5f84e53fab94659af84d1245a7",
1698917016
"status" : {
1699017017
"state" : "implemented",
1699117018
"version" : "5.8"
@@ -17702,8 +17729,88 @@
1770217729
}
1770317730
],
1770417731
"discussions" : [
17732+
{
17733+
"link" : "https:\/\/forums.swift.org\/t\/pitch-package-registry-publish\/62828",
17734+
"name" : "pitch"
17735+
},
17736+
{
17737+
"link" : "https:\/\/forums.swift.org\/t\/se-0391-package-registry-publish\/63405",
17738+
"name" : "review"
17739+
},
17740+
{
17741+
"link" : "https:\/\/forums.swift.org\/t\/accepted-se-0391-swift-package-registry-authentication\/64088",
17742+
"name" : "acceptance"
17743+
}
1770517744
],
1770617745
"id" : "SE-0391",
17746+
"implementation" : [
17747+
{
17748+
"account" : "apple",
17749+
"id" : "6101",
17750+
"repository" : "swift-package-manager",
17751+
"type" : "pull"
17752+
},
17753+
{
17754+
"account" : "apple",
17755+
"id" : "6146",
17756+
"repository" : "swift-package-manager",
17757+
"type" : "pull"
17758+
},
17759+
{
17760+
"account" : "apple",
17761+
"id" : "6159",
17762+
"repository" : "swift-package-manager",
17763+
"type" : "pull"
17764+
},
17765+
{
17766+
"account" : "apple",
17767+
"id" : "6169",
17768+
"repository" : "swift-package-manager",
17769+
"type" : "pull"
17770+
},
17771+
{
17772+
"account" : "apple",
17773+
"id" : "6188",
17774+
"repository" : "swift-package-manager",
17775+
"type" : "pull"
17776+
},
17777+
{
17778+
"account" : "apple",
17779+
"id" : "6189",
17780+
"repository" : "swift-package-manager",
17781+
"type" : "pull"
17782+
},
17783+
{
17784+
"account" : "apple",
17785+
"id" : "6215",
17786+
"repository" : "swift-package-manager",
17787+
"type" : "pull"
17788+
},
17789+
{
17790+
"account" : "apple",
17791+
"id" : "6217",
17792+
"repository" : "swift-package-manager",
17793+
"type" : "pull"
17794+
},
17795+
{
17796+
"account" : "apple",
17797+
"id" : "6220",
17798+
"repository" : "swift-package-manager",
17799+
"type" : "pull"
17800+
},
17801+
{
17802+
"account" : "apple",
17803+
"id" : "6229",
17804+
"repository" : "swift-package-manager",
17805+
"type" : "pull"
17806+
},
17807+
{
17808+
"account" : "apple",
17809+
"id" : "6237",
17810+
"repository" : "swift-package-manager",
17811+
"type" : "pull"
17812+
}
17813+
],
1770717814
"link" : "0391-package-registry-publish.md",
1770817815
"reviewManager" : {
1770917816
"link" : "https:\/\/github.com\/tomerd",
@@ -17715,7 +17822,7 @@
1771517822
"name" : "Tom Doron"
1771617823
}
1771717824
],
17718-
"sha" : "af6ba211991124d9dc81145c84ab1cb52dc122c5",
17825+
"sha" : "689f188e292fbb79a619183659454bdeec638a73",
1771917826
"status" : {
1772017827
"state" : "implemented",
1772117828
"version" : "5.9"
@@ -19629,7 +19736,7 @@
1962919736
},
1963019737
{
1963119738
"link" : "https:\/\/forums.swift.org\/t\/accepted-with-modifications-se-0428-resolve-distributedactor-protocols\/71366",
19632-
"name" : "acceptance with modifications"
19739+
"name" : "acceptance"
1963319740
}
1963419741
],
1963519742
"id" : "SE-0428",
@@ -19652,23 +19759,12 @@
1965219759
"name" : "Freddy Kellison-Linn"
1965319760
}
1965419761
],
19655-
"sha" : "45bddc6f77c690f1308d1448f5ceb12a65a0f79a",
19762+
"sha" : "0039976fec9d6963eca04402b360050a6832da59",
1965619763
"status" : {
19657-
"end" : "2024-03-26T00:00:00Z",
19658-
"start" : "2024-03-13T00:00:00Z",
19659-
"state" : "activeReview"
19764+
"state" : "acceptedWithRevisions"
1966019765
},
1966119766
"summary" : "Swift's distributed actors offer developers a flexible bring-your-own-runtime approach to building distributed systems using the actor paradigm. The initial design of the feature aimed for systems where all nodes of a distributed actor system (such as nodes in a [cluster](https:\/\/github.com\/apple\/swift-distributed-actors)) share the same binary, and therefore all have access to the concrete `distributed actor` declarations which may be resolved and made remote calls on.",
19662-
"title" : "Resolve DistributedActor protocols",
19663-
"warnings" : [
19664-
{
19665-
"code" : 0,
19666-
"kind" : "warning",
19667-
"message" : "Review ended on 2024-03-26 00:00:00 +0000.",
19668-
"stage" : "validate",
19669-
"suggestion" : ""
19670-
}
19671-
]
19767+
"title" : "Resolve DistributedActor protocols"
1967219768
},
1967319769
{
1967419770
"authors" : [
@@ -19711,15 +19807,12 @@
1971119807
"name" : "Xiaodi Wu"
1971219808
}
1971319809
],
19714-
"sha" : "4dfa633db8fb0e7c55dc150d2047f3f9ecd3a29c",
19810+
"sha" : "fd54b90d48f27a4bb3321ac9f3df3daca7a54a0e",
1971519811
"status" : {
1971619812
"state" : "accepted"
1971719813
},
1971819814
"summary" : "We propose allowing noncopyable fields in deinit-less aggregates to be consumed individually, so long as they are defined in the current module or frozen. Additionally, we propose allowing fields of such an aggregate with a deinit to be consumed individually *within that deinit*. This permits common patterns to be used with many noncopyable values.",
19719-
"title" : "Partial consumption of noncopyable values",
19720-
"upcomingFeatureFlag" : {
19721-
"flag" : "MoveOnlyPartialConsumption"
19722-
}
19815+
"title" : "Partial consumption of noncopyable values"
1972319816
},
1972419817
{
1972519818
"authors" : [
@@ -19858,17 +19951,14 @@
1985819951
"name" : "Ben Cohen"
1985919952
}
1986019953
],
19861-
"sha" : "6ccb1bb274c546e4b30019ed5ddd32343c154d74",
19954+
"sha" : "677c03b5ddbd7d473c0535580d1526f3bda4f4a8",
1986219955
"status" : {
1986319956
"end" : "2024-04-22T00:00:00Z",
1986419957
"start" : "2024-04-09T00:00:00Z",
1986519958
"state" : "activeReview"
1986619959
},
1986719960
"summary" : "Pattern matching over noncopyable types, particularly noncopyable enums, can be generalized to allow for pattern matches that borrow their subject, in addition to the existing support for consuming pattern matches.",
1986819961
"title" : "Borrowing and consuming pattern matching for noncopyable types",
19869-
"upcomingFeatureFlag" : {
19870-
"flag" : "BorrowingSwitch"
19871-
},
1987219962
"warnings" : [
1987319963
{
1987419964
"code" : 0,
@@ -19894,6 +19984,10 @@
1989419984
{
1989519985
"link" : "https:\/\/forums.swift.org\/t\/se-0433-synchronous-mutual-exclusion-lock\/71174",
1989619986
"name" : "review"
19987+
},
19988+
{
19989+
"link" : "https:\/\/forums.swift.org\/t\/accepted-se-0433-synchronous-mutual-exclusion-lock\/71463",
19990+
"name" : "acceptance"
1989719991
}
1989819992
],
1989919993
"id" : "SE-0433",
@@ -19916,11 +20010,9 @@
1991620010
"name" : "Stephen Canon"
1991720011
}
1991820012
],
19919-
"sha" : "abddd3be21b22ea6a7cc110823a1b75a27f3183b",
20013+
"sha" : "e40e058f61a2b09eab27d0d0e616b363a306b54f",
1992020014
"status" : {
19921-
"end" : "2024-04-24T00:00:00Z",
19922-
"start" : "2024-04-10T00:00:00Z",
19923-
"state" : "activeReview"
20015+
"state" : "accepted"
1992420016
},
1992520017
"summary" : "This proposal introduces a mutual exclusion lock, or a mutex, to the standard library. `Mutex` will be a new synchronization primitive in the synchronization module.",
1992620018
"title" : "Synchronous Mutual Exclusion Lock 🔒"
@@ -19979,6 +20071,52 @@
1997920071
"suggestion" : ""
1998020072
}
1998120073
]
20074+
},
20075+
{
20076+
"authors" : [
20077+
{
20078+
"link" : "https:\/\/github.com\/xedin",
20079+
"name" : "Pavel Yaskevich"
20080+
}
20081+
],
20082+
"discussions" : [
20083+
{
20084+
"link" : "https:\/\/forums.swift.org\/t\/pitch-swiftpm-swift-language-version-per-target\/71067",
20085+
"name" : "pitch"
20086+
},
20087+
{
20088+
"link" : "https:\/\/forums.swift.org\/t\/se-0435-swift-language-version-per-target\/71546",
20089+
"name" : "review"
20090+
}
20091+
],
20092+
"id" : "SE-0435",
20093+
"implementation" : [
20094+
{
20095+
"account" : "apple",
20096+
"id" : "7439",
20097+
"repository" : "swift-package-manager",
20098+
"type" : "pull"
20099+
}
20100+
],
20101+
"link" : "0435-swiftpm-per-target-swift-language-version-setting.md",
20102+
"reviewManager" : {
20103+
"link" : "https:\/\/github.com\/beccadax",
20104+
"name" : "Becca Royal-Gordon"
20105+
},
20106+
"reviewManagers" : [
20107+
{
20108+
"link" : "https:\/\/github.com\/beccadax",
20109+
"name" : "Becca Royal-Gordon"
20110+
}
20111+
],
20112+
"sha" : "c4c99b537dfe7a5f98960a0d9dfdc595dbadfb22",
20113+
"status" : {
20114+
"end" : "2024-05-13T00:00:00Z",
20115+
"start" : "2024-04-30T00:00:00Z",
20116+
"state" : "activeReview"
20117+
},
20118+
"summary" : "The current Swift Package Manager manifest API for specifying Swift language version(s) applies to an entire package which is limiting when adopting new language versions that have implications for source compatibility.",
20119+
"title" : "Swift Language Version Per Target"
1998220120
}
1998320121
],
1998420122
"schemaVersion" : "0.1.0",

0 commit comments

Comments
 (0)