{"id":13726159,"url":"https://github.com/ocurrent/opam-dune-lint","last_synced_at":"2025-05-07T21:31:29.757Z","repository":{"id":43715551,"uuid":"319667177","full_name":"ocurrent/opam-dune-lint","owner":"ocurrent","description":"Ensure dune and opam dependencies are consistent","archived":false,"fork":false,"pushed_at":"2024-04-18T14:25:16.000Z","size":132,"stargazers_count":42,"open_issues_count":2,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-04T01:28:37.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocurrent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-12-08T14:42:09.000Z","updated_at":"2024-06-20T20:54:44.000Z","dependencies_parsed_at":"2023-09-29T16:23:45.321Z","dependency_job_id":"3d683b12-f3a9-4b37-ad1a-20c596c6a9e9","html_url":"https://github.com/ocurrent/opam-dune-lint","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocurrent%2Fopam-dune-lint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocurrent%2Fopam-dune-lint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocurrent%2Fopam-dune-lint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocurrent%2Fopam-dune-lint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocurrent","download_url":"https://codeload.github.com/ocurrent/opam-dune-lint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224654140,"owners_count":17347677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:54.357Z","updated_at":"2024-11-14T16:33:22.250Z","avatar_url":"https://github.com/ocurrent.png","language":"OCaml","funding_links":[],"categories":["OCaml","\u003ca name=\"OCaml\"\u003e\u003c/a\u003eOCaml"],"sub_categories":[],"readme":"# opam-dune-lint\n\n`opam-dune-lint` checks that all ocamlfind libraries listed as dune\ndependencies have corresponding opam dependencies listed in the opam files.\nIf not, it offers to add them (either to your opam files, or to your `dune-project` if you're generating your opam files from that).\n\nExample:\n\n```\n$ ls *.opam\ncurrent_ocluster.opam  ocluster-api.opam  ocluster.opam\n\n$ opam-dune-lint\ncurrent_ocluster.opam: changes needed:\n  \"ppx_deriving\" {\u003e= 5.1}                  [from (ppx), ocurrent-plugin]\nocluster-api.opam: changes needed:\n  \"ppx_deriving\" {\u003e= 5.1}                  [from (ppx), api]\nocluster.opam: changes needed:\n  \"capnp-rpc-lwt\" {\u003e= 0.8.0}               [from scheduler, worker]\n  \"capnp-rpc-net\" {\u003e= 0.8.0}               [from scheduler]\n  \"ppx_sexp_conv\" {\u003e= v0.14.1}             [from (ppx)]\n  \"prometheus\" {\u003e= 0.7}                    [from scheduler]\n  \"alcotest-lwt\" {with-test}               [from test] (missing {with-test} annotation)\nNote: version numbers are just suggestions based on the currently installed version.\nWrite changes? [y] y\nWrote \"dune-project\"\n```\n\nIt works as follows:\n\n1. Lists the `*.opam` files in your project's root (ensuring they're up-to-date, if generated).\n2. Runs `dune describe external-lib-deps` to get all externals and internals ocamlfind libraries for all dune libraries, executables and tests. The information about the package is also known except for the private executables.\n3. Runs `dune describe package-entries` to get all packages entries, this is for considering the external ocamlfind libraries of a private executable, because in Dune it is possible to install a private executable.\n4. Resolve for each opam library its internal and external ocamlfind library dependencies using the information of 1. and 2.\n5. Filters out vendored dependencies (by ignoring dependencies from subdirectories with their own `dune-project` file).\n6. For each ocamlfind library, it finds the corresponding opam library by\n   finding its directory and then finding the `*.changes` file saying which\n   opam package added its `META` file.\n7. Checks that each required opam package is listed in the opam file.\n8. For any missing packages, it offers to add a suitable dependency, using the installed package's version as the default lower-bound.\n\n`opam-dune-lint` can be run manually to update your project, or as part of CI to check for missing dependencies.\nIt exits with a non-zero status if changes are needed, or if the opam files were not up-to-date with the `dune-project` file.\nWhen run interactively, it asks for confirmation before writing files.\nIf `stdin` is not a tty, then it does not write changes unless run with `-f`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focurrent%2Fopam-dune-lint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focurrent%2Fopam-dune-lint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focurrent%2Fopam-dune-lint/lists"}