Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork12
Support full constraint syntax of library.propertiesdepends field#384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
At the time the dependency on `go.bug.st/relaxed-semver` was added to the project, there was not a release versionavailable, so it was necessary to use a "pseudo-version" instead.Since that time, the first release of `go.bug.st/relaxed-semver`, offering the opportunity for more effective managementof the dependency:- Greater stability through the use of release versions- Automated update offers from DependabotThe relevant changes made to `go.bug.st/relaxed-semver` in the interim have been the expansion of the versionconstraints syntax, so it will be important for Arduino Lint to use the same version as`arduino/libraries-repository-engine` and Arduino CLI in order to correctly lint the constraints syntax used in thelibrary.properties `depends` field.
This will allow the code to be shared by additional rule functions which need this data.
… field elementsEmpty version constraints are supported by the Arduino library system (they match any version).Previously, the regular expression used to split the library name from the version constraint caused these emptyconstraints to incorrectly be considered invalid.
Arduino CLI and the Library Manager system have support for specifying version constraints in the library.properties`depends` field.This was previously validated as part of the general `depends` field data format check in LP047.The constraint system has recently been made much more capable through the addition of support for more syntax.The previous approach for validating the version constraint was a complex and lengthy regular expression in thelibrary.properties JSON schema. Extending this to comprehensively validate the full range of constraint forms possiblewith the new syntax will not be feasible or maintainable.The new approach is to validate it using the same `go.bug.st/relaxed-semver` module used by Arduino CLI and`arduino/libraries-repository-engine` to handle the version constraints in this field.
…ibrary.properties schemaA regular expression is employed in the library.properties JSON schemas to validate the format of the contents of thedepends field. Previously, this regular expression was configured to validate the syntax of the optional versionconstraint.The constraint system has recently been made much more capable through the addition of support for more syntax. Theregular expression did not have support for that syntax, which caused valid data to fail validation.Expanding the already complex and lengthy regular expression to comprehensively validate the full range of constraintforms possiblewith the new syntax would not be feasible or maintainable.The new approach is to validate it directly via Go code using the same `go.bug.st/relaxed-semver` module used byArduino CLI and `arduino/libraries-repository-engine` to handle the version constraints in this field. The schema willcontinue to provide a general validation on the `depends` field format.
codecov-commenter commentedMay 26, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## main #384 +/- ##==========================================+ Coverage 90.01% 90.05% +0.04%========================================== Files 44 44 Lines 6770 6800 +30 ==========================================+ Hits 6094 6124 +30 Misses 553 553 Partials 123 123
Flags with carried forward coverage won't be shown.Click here to find out more.
Continue to review full report at Codecov.
|
Arduino CLI andthe Library Manager system have support for specifying library dependency version constraints in the
dependsfield ofthelibrary.propertiesmetadata file.This was previously validated as part of the general
dependsfield data format check inruleLP047.The constraint system has recently been made much more capable throughthe addition of support formore syntax.
The previous approach for validating the version constraint was a complex and lengthy regular expression in the
library.propertiesJSON schema. Extending this to comprehensively validate the full range of constraint forms possible with the new syntax will not be feasible or maintainable.The new approach is to validate it using the same
go.bug.st/relaxed-semvermodule used by Arduino CLI andarduino/libraries-repository-engineto check the version constraint syntax in this field.The JSON schema based
LP047is now used solely for validating the data format of thedependsfield. A new ruleLP058is dedicated to checking the version constraint syntax within each of the field items.