Skip to content

Specify link to Github, BitBucket or GitLab as requirement for url field #647

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
aliphys opened this issue Nov 25, 2023 · 1 comment
Closed
3 tasks done
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@aliphys
Copy link
Contributor

aliphys commented Nov 25, 2023

Describe the request

Add rule so that the linter checks for a link to Github, BitBucket or GitLab as in the url field. In many instances, for example https://github.com/arduino-libraries/MIDIUSB/blob/f9bcc4eaf7bb983ac1827ccf0f8b833f75001ac2/library.properties the url field links to another location.

Describe the current behavior

According to the library registery FAQ:

- [ ] The library repository must be hosted on a major Git-hosting website like GitHub, BitBucket or GitLab (other hosting sites may be considered on request).

Currently, we do have some useful checks in place for the url field. As an example, rule LP040 checks to see if the url is included, but does not check to see if it points back to GitHub, BitBucket or GitLab.

{
ProjectType: projecttype.Library,
SuperprojectType: projecttype.All,
Category: "library.properties",
Subcategory: "url field",
ID: "LP040",
Brief: "missing url field",
Description: "The `url` field is missing from the library's `library.properties` metadata file.",
MessageTemplate: "Missing url field in library.properties",
Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format",
DisableModes: nil,
EnableModes: []rulemode.Type{rulemode.Default},
InfoModes: nil,
WarningModes: nil,
ErrorModes: []rulemode.Type{rulemode.Default},
RuleFunction: rulefunction.LibraryPropertiesURLFieldMissing,
},

Arduino Lint version

latest

Operating system

N/A

Operating system version

N/A

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest version
  • My request contains all necessary details
@aliphys aliphys added the type: enhancement Proposed improvement label Nov 25, 2023
@per1234 per1234 self-assigned this Nov 26, 2023
@per1234 per1234 added the topic: code Related to content of the project itself label Nov 26, 2023
@per1234
Copy link
Contributor

per1234 commented Nov 26, 2023

Hi @aliphys. Thanks for your suggestion.

According to the library registery FAQ:

- [ ] The library repository must be hosted on a major Git-hosting website like GitHub, BitBucket or GitLab (other hosting sites may be considered on request).

That requirement is about the URL that is added to the repositories.txt file in the arduino/library-registry repository. The reason for the restrictions on that URL is because the libraries-repository-engine tool must be able to check out the library's Git repository in order to generate the Library Manager index and associated assets.

Since this data is not part of the Arduino library project content, a separate tool is used to check the Library Manager submissions for compliance with this requirement:

https://github.com/arduino/library-registry-submission-parser/blob/1.1.1/main.go#L272-L279


The purpose of the url field of the library.properties metadata file is to provide the library user with a link they can follow to get more information about the library. The library repository might be the place where that information is found, but this is not required. In fact, many of the official Arduino libraries use the URL of the library's page in the Arduino Library Reference (example), and that is perfectly fine (and in fact superior for the purpose when compared to sending the end user directly to the repository). So there is no need to apply the same requirements on the url field of the library.properties file as we impose on the registration URL.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2023
@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants