You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main.go
+12-5
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ type request struct {
74
74
Submissions []submissionType`json:"submissions"`// Data for submitted libraries.
75
75
IndexEntrystring`json:"indexEntry"`// Entry that will be made to the Library Manager index source file when the submission is accepted.
76
76
IndexerLogsURLsstring`json:"indexerLogsURLs"`// List of URLs where the logs from the Library Manager indexer for each submission are available for view.
77
+
Errorstring`json:"error"`// Error message.
77
78
}
78
79
79
80
// submissionType is the type of the data for each individual library submitted in the request.
// parseDiff parses the request diff and returns the request type, request error, `arduino-lint --library-manager` setting, and list of submission URLs.
// Check if the PR has removed the final newline from a file, which would cause a spurious diff for the next PR if merged.
186
+
// Unfortunately, the diff package does not have this capability (only to detect missing newline in the original file).
187
+
ifbytes.Contains(rawDiff, []byte("\\ No newline at end of file")) {
188
+
return"invalid", "Pull request removes newline from the end of a file.%0APlease add a blank line to the end of the file.", "", nil
189
+
}
190
+
184
191
diffs, err:=diff.ParseMultiFileDiff(rawDiff)
185
192
iferr!=nil {
186
193
panic(err)
187
194
}
188
195
189
196
if (len(diffs) !=1) || (diffs[0].OrigName[2:] !=listName) || (diffs[0].OrigName[2:] !=diffs[0].NewName[2:]) { // Git diffs have a a/ or b/ prefix on file names.
0 commit comments