@@ -20,8 +20,8 @@ struct ProposalMetadataExtractor {
2020 /// - Returns: The extracted proposal metadata
2121 static func extractProposalMetadata( from markdown: String , proposalSpec: ProposalSpec , extractionDate: Date ) -> Proposal {
2222
23- var proposalMetadata = Proposal ( )
24- proposalMetadata . sha = proposalSpec. sha
23+ var proposal = Proposal ( )
24+ proposal . sha = proposalSpec. sha
2525
2626 var warnings : [ Proposal . Issue ] = [ ]
2727 var errors : [ Proposal . Issue ] = [ ]
@@ -37,63 +37,63 @@ struct ProposalMetadataExtractor {
3737 let document = Document ( parsing: markdown, options: [ . disableSmartOpts] )
3838
3939 guard !document. isEmpty else {
40- proposalMetadata . errors = [ ValidationIssue . emptyMarkdownFile]
41- return proposalMetadata
40+ proposal . errors = [ ValidationIssue . emptyMarkdownFile]
41+ return proposal
4242 }
4343
4444 // VALIDATION ENHANCEMENT: Currently no error or warning reported if missing title or summary.
4545 // Change to if lets to detect missing values and report.
46- proposalMetadata . title = extractValue ( from: document, with: TitleExtractor . self) ?? " "
47- proposalMetadata . summary = extractValue ( from: document, with: SummaryExtractor . self) ?? " "
46+ proposal . title = extractValue ( from: document, with: TitleExtractor . self) ?? " "
47+ proposal . summary = extractValue ( from: document, with: SummaryExtractor . self) ?? " "
4848
4949 if let headerFieldsByLabel = extractValue ( from: document, with: HeaderFieldExtractor . self) {
5050
5151 let proposalLink = extractValue ( from: headerFieldsByLabel, with: ProposalLinkExtractor . self)
52- proposalMetadata . id = proposalLink? . text ?? " "
53- proposalMetadata . link = proposalLink? . destination ?? " "
52+ proposal . id = proposalLink? . text ?? " "
53+ proposal . link = proposalLink? . destination ?? " "
5454 /* VALIDATION ENHANCEMENT: Probably also want to validate that the destination link matches the passed-in filename and the id matches the proposalID field */
5555
5656 if let authors = extractValue ( from: headerFieldsByLabel, with: AuthorExtractor . self) , authors. count > 0 {
57- proposalMetadata . authors = authors
57+ proposal . authors = authors
5858 } else {
5959 errors. append ( ValidationIssue . missingAuthors)
6060 }
6161
6262 if let reviewManagers = extractValue ( from: headerFieldsByLabel, with: ReviewManagerExtractor . self) , let reviewManager = reviewManagers. first {
63- proposalMetadata . reviewManager = reviewManager // reviewManager.first ?? Proposal.Person()
63+ proposal . reviewManager = reviewManager // reviewManager.first ?? Proposal.Person()
6464 } else {
6565 warnings. append ( ValidationIssue . missingReviewManager)
6666 }
6767
68- proposalMetadata . trackingBugs = extractValue ( from: headerFieldsByLabel, with: TrackingBugExtractor . self)
69- proposalMetadata . implementation = extractValue ( from: headerFieldsByLabel, with: ImplementationExtractor . self)
68+ proposal . trackingBugs = extractValue ( from: headerFieldsByLabel, with: TrackingBugExtractor . self)
69+ proposal . implementation = extractValue ( from: headerFieldsByLabel, with: ImplementationExtractor . self)
7070
7171 if let status = extractValue ( from: ( headerFieldsByLabel, extractionDate) , with: StatusExtractor . self) {
7272 if case . implemented( let version) = status, version == " none " {
7373 // VALIDATION ENHANCEMENT: Figure out a better way to special case the missing version strings for these proposals
7474 // VALIDATION ENHANCEMENT: Possibly just add version strings to the actual proposals
7575 if proposalSpec. id == " SE-0264 " || proposalSpec. id == " SE-0110 " {
76- proposalMetadata . status = . implemented( version: " " )
76+ proposal . status = . implemented( version: " " )
7777 } else {
7878 // VALIDATION ENHANCEMENT: This *should* be a validation error
79- proposalMetadata . status = . implemented( version: " " )
79+ proposal . status = . implemented( version: " " )
8080 }
8181 } else {
82- proposalMetadata . status = status
82+ proposal . status = status
8383 }
8484 } else {
8585 // VALIDATION ENHANCEMENT: Report an error
86- proposalMetadata . status = . statusExtractionFailed
86+ proposal . status = . statusExtractionFailed
8787 }
8888 } else {
8989 errors. append ( ValidationIssue . missingMetadataFields)
9090 }
9191
9292 // Add warnings and errors if present
93- if !warnings. isEmpty { proposalMetadata . warnings = warnings }
94- if !errors. isEmpty { proposalMetadata . errors = errors }
93+ if !warnings. isEmpty { proposal . warnings = warnings }
94+ if !errors. isEmpty { proposal . errors = errors }
9595
96- return proposalMetadata
96+ return proposal
9797 }
9898}
9999
0 commit comments