GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Implement libraries.io support for pre-commit · Issue #345 · pre-commit/pre-commit.com

Implement libraries.io support for pre-commit #345

New issue
Copy link
New issue
Copy link
Open
Open
Implement libraries.io support for pre-commit#345
Copy link
Labels
help wanted

Description

@asottile
asottile
opened on May 19, 2020
Issue body actions
  • https://github.com/librariesio/libraries.io/blob/master/docs/add-a-package-manager.md
  • can likely use all-repos.json and maybe(?) take some inspiration from the go implementation for libraries.io (since the distribution mechanism is similar)

Activity

  1. asottile
    added
    help wanted
    on May 19, 2020
  2. paulhfischer commented on Dec 19, 2020

    @paulhfischer
    paulhfischer
    on Dec 19, 2020
    Contributor
    More actions

    have a look at this commit, i used the all-repos.json file and parsed all attributes of the hooks (fallback are the default values listed on pre-commit.com).

    let me know if this is what you've imagined and if you have comments on it.

  3. asottile commented on Dec 22, 2020

    @asottile
    asottile
    on Dec 22, 2020
    MemberAuthor
    More actions

    looks like a good start! I imagine the version information would be useful as well -- is there a second mechanism for parsing .pre-commit-config.yaml from consuming repositories? to be honest I can't remember why this was useful (I think it was so a third party could integrate with showing packaging mappings / use)

  4. paulhfischer commented on Dec 22, 2020

    @paulhfischer
    paulhfischer
    on Dec 22, 2020
    Contributor
    More actions

    the reason why i commented out the self.version method is because libraries.io then automatic gets the latest tag (either you define your one version or it uses git tags. this can also be seen in the compatibility matrix). this is similar to the emacs-packages.

    not sure if i understood you correct regarding consuming repositories: do you mean parsing the additional_dependencies-field? i can add this for all languages that are listed in libraries.io (node, python via pypi, go). Here's an example of what i mean:

    {
        "https://github.com/pre-commit/mirrors-coffeelint": [
            {
                "id": "coffeelint",
                "name": "coffeelint",
                "entry": "coffeelint",
                "language": "node",
                "files": "\\.(js|coffee)$",
                "args": [],
                "additional_dependencies": ["[email protected]"],
                "minimum_pre_commit_version": "0.7.0"
            }
        ]
    }

    would return the following in self.dependencies:

    [
        {
            project_name: 'coffeelint',
            requirements: 2.1.0,
            kind: 'runtime',
            platform: 'npm'
        }
    ]
  5. asottile commented on Dec 22, 2020

    @asottile
    asottile
    on Dec 22, 2020
    MemberAuthor
    More actions

    ah no not additional_dependencies (though maybe that's worth doing too? idk?) -- I was thinking more like if you looked at https://github.com/asottile/t for example it would have dependencies on github.com/pre-commit/pre-commit-hooks, ... based on its consuming .pre-commit-config.yaml

    I don't know how that gets represented in libraries.io though 🤔

  6. paulhfischer commented on Dec 22, 2020

    @paulhfischer
    paulhfischer
    on Dec 22, 2020
    Contributor
    More actions

    oh ok, if i understood the documentation correct, this is done by bibliothecary (if you log in to libraries.io, this will check your repositories for dependencies). i added pre-commit to bibliothecary here.

  7. asottile commented on Dec 22, 2020

    @asottile
    asottile
    on Dec 22, 2020
    MemberAuthor
    More actions

    neat, that looks good -- though you'll want to skip repo: meta and repo: local

  8. paulhfischer commented on Dec 22, 2020

    @paulhfischer
    paulhfischer
    on Dec 22, 2020
    Contributor
    More actions

    neat, that looks good -- though you'll want to skip repo: meta and repo: local

    yeah thanks, i'm going to to change this.

  9. paulhfischer commented on Dec 22, 2020

    @paulhfischer
    paulhfischer
    on Dec 22, 2020
    Contributor
    More actions

    i just tried adding the parsing of additional_dependencies, but encountered two problems:

    1. most languages have multiple package managers in libraries.io, but we are required to specify which one the dependency uses. it would be possible to search for the corresponding package manager in libraries.io, but this would be quite expensive and might cause errors if the same name is specified in multiple package managers
    2. the dependencies wouldn't be consistent, as not all additional_dependencies can be found on libraries.io, which kind of ruins the purpose imo

    let me know what you think about adding this or if you have any suggestions

  10. asottile commented on Dec 22, 2020

    @asottile
    asottile
    on Dec 22, 2020
    MemberAuthor
    More actions

    feel free to skip additional_dependencies 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.