Stricter checks on libs/cores arguments #431
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously
globals.ParseReferenceArgs
was used to parse both core reference and library reference, but this doesn't work well because:[email protected]
is a valid library reference but not a valid core reference (because it's missing the architecture part likearduino:[email protected]
.This PR adds another function
global.ParseLibraryReferenceArgs
that also provides a better error messages for the reason why the parameters are rejected:invalid empty library name
(ex:@2.3.4
)invalid empty library version
(ex:MyLib@
)and for cores:
invalid empry core argument
invalid empty core reference
(ex:@1.2.3
)invalid empty core version
(ex:arduino:avr@
)invalid empty core name
(ex::[email protected]
)invalid empty core architecture
(exarduino:@1.2.3
)