Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
per1234 merged 5 commits intoarduino:mainfromper1234:full-depends-constraints-support
May 26, 2022
Merged

Support full constraint syntax of library.propertiesdepends field#384

per1234 merged 5 commits intoarduino:mainfromper1234:full-depends-constraints-support
May 26, 2022

Conversation

@per1234
Copy link
Contributor

Arduino CLI andthe Library Manager system have support for specifying library dependency version constraints in thedepends field ofthelibrary.properties metadata file.

This was previously validated as part of the generaldepends field 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 thelibrary.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 samego.bug.st/relaxed-semver module used by Arduino CLI andarduino/libraries-repository-engine to check the version constraint syntax in this field.

The JSON schema basedLP047 is now used solely for validating the data format of thedepends field. A new ruleLP058 is dedicated to checking the version constraint syntax within each of the field items.

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.
@per1234per1234 added topic: codeRelated to content of the project itself type: imperfectionPerceived defect in any part of project labelsMay 26, 2022
@per1234per1234 requested a review fromumbynosMay 26, 2022 07:06
@per1234per1234 self-assigned thisMay 26, 2022
…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
Copy link

codecov-commenter commentedMay 26, 2022
edited
Loading

Codecov Report

Merging#384 (264f66a) intomain (fa3e94c) willincrease coverage by0.04%.
The diff coverage is100.00%.

@@            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
FlagCoverage Δ
unit90.05% <100.00%> (+0.04%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
...ternal/rule/ruleconfiguration/ruleconfiguration.go100.00% <ø> (ø)
internal/rule/schema/schemadata/bindata.go49.67% <ø> (ø)
internal/rule/rulefunction/library.go96.39% <100.00%> (+0.10%)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatefb7be8a...264f66a. Read thecomment docs.

@per1234per1234 merged commitf05802f intoarduino:mainMay 26, 2022
@per1234per1234 deleted the full-depends-constraints-support branchMay 26, 2022 12:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@umbynosumbynosumbynos approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@per1234per1234

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@per1234@codecov-commenter@umbynos

[8]ページ先頭

©2009-2025 Movatter.jp