# Is there a function to check if every package in my \[deps\] has a \[compat\] entry in Project.toml?

**URL:** <https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708>\
**Category:** General Usage\
**Created:** [June 10, 2021, 11:29pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708 "2021-06-10T23:29:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [June 10, 2021, 11:29pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/1 "2021-06-10T23:29:49Z")

</div>

Sometimes, before I publish a new version of the package I accidentally forget that I’ve added a package to the dependencies and forgot to add [compat] entries in `Project.toml`.

I think I should add a git hook to remind me, but I wanted to check if there’s a simple function that I can use to check for missing [compat] vs [deps].

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 10, 2021, 11:41pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/2 "2021-06-10T23:41:22Z")

</div>

I’m not familiar with its API (so I can’t point you directly to the function you want), but that’s what [`RegistryCI.jl`](https://github.com/JuliaRegistries/RegistryCI.jl) does.

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [June 10, 2021, 11:45pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/3 "2021-06-10T23:45:46Z")

</div>

I think that Aqua.jl offers this as one of its features.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 11, 2021, 6:40am UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/4 "2021-06-11T06:40:32Z")

</div>

I guess you rather want something that can be automated but for interactive use, [PackageCompatUI](https://discourse.julialang.org/t/ann-packagecompatui/58118) will clearly show if you’re missing some compat and let you quickly correct it.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [June 11, 2021, 7:08am UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/5 "2021-06-11T07:08:41Z")

</div>

If your package is already pushed to GitHub and you have setup [CompatHelper.jl](https://github.com/JuliaRegistries/CompatHelper.jl) with `workflow_dispatch:`, then you can also trigger a CompatHelper run in the GitHub Actions tab to detect missing compat entries.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [June 11, 2021, 7:19am UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/6 "2021-06-11T07:19:54Z")

</div>

cool

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [June 11, 2021, 1:32pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/7 "2021-06-11T13:32:06Z")

</div>

PkgTemplates.jl sets the GitHub Action for CompatHelper.jl even up as default.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [June 12, 2021, 9:58am UTC](https://discourse.julialang.org/t/is-there-a-function-to-check-if-every-package-in-my-deps-has-a-compat-entry-in-project-toml/62708/8 "2021-06-12T09:58:05Z")

</div>

Checking `[compat]` entries without depending on anything else is literally **the** function of the [CompatHelperLocal.jl](https://juliahub.com/ui/Packages/CompatHelperLocal/x5A3V) package _[disclaimer: I’m the author]_.  
Doesn’t require uploading your package to github or registering it anywhere, just run

```julia
import CompatHelperLocal as CHL
CHL.@check()

```

and get the updated `[compat]` content if it’s incomplete or outdated. I find it most convenient to append this piece of code to `runtests.jl`.
