Skip to content

Commit

Permalink
Add reference link to library.properties-related error messages
Browse files Browse the repository at this point in the history
A link to the documentation for this file will ensure that the library maintainer understands the problem and how to fix it.
  • Loading branch information
per1234 committed Jul 18, 2021
1 parent 23a56c8 commit 91f8639
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,18 +350,18 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT
// Get submission library name. It is necessary to record this in the index source entry because the library is locked to this name.
libraryPropertiesPath := submissionClonePath.Join("library.properties")
if !libraryPropertiesPath.Exist() {
submission.Error = "Library is missing a library.properties metadata file."
submission.Error = "Library is missing a library.properties metadata file.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata"
return submission, ""
}
libraryProperties, err := properties.LoadFromPath(libraryPropertiesPath)
if err != nil {
submission.Error = fmt.Sprintf("Invalid library.properties file (%s)", err)
submission.Error = fmt.Sprintf("Invalid library.properties file: %s%%0A%%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata", err)
return submission, ""
}
var ok bool
submission.Name, ok = libraryProperties.GetOk("name")
if !ok {
submission.Error = "library.properties is missing a name field"
submission.Error = "library.properties is missing a name field.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata"
return submission, ""
}

Expand Down
3 changes: 2 additions & 1 deletion test/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@
"name": "",
"official": True,
"tag": "1.0.1",
"error": "Library is missing a library.properties metadata file.",
"error": "Library is missing a library.properties metadata file.%0A%0A"
"See: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
}
],
"",
Expand Down

0 comments on commit 91f8639

Please sign in to comment.