Support full constraint syntax of library.properties depends field by per1234 · Pull Request #384 · arduino/arduino-lint (original) (raw)

Arduino CLI and the Library Manager system have support for specifying library dependency version constraints in the depends field of the library.properties metadata file.

This was previously validated as part of the general depends field data format check in rule 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 the library.properties JSON 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-semver module used by Arduino CLI and arduino/libraries-repository-engine to check the version constraint syntax in this field.

The JSON schema based LP047 is now used solely for validating the data format of the depends field. A new rule LP058 is dedicated to checking the version constraint syntax within each of the field items.