Skip to content

feat(builtins): add dclint to builtins#779

Merged
jdx merged 1 commit intojdx:mainfrom
timothysparg:feat/builtins/dclint
Apr 1, 2026
Merged

feat(builtins): add dclint to builtins#779
jdx merged 1 commit intojdx:mainfrom
timothysparg:feat/builtins/dclint

Conversation

@timothysparg
Copy link
Copy Markdown
Contributor

Add docker compose linter to the builtins registry

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a Docker Compose linter (dclint) configuration and its corresponding tool stub. The configuration includes glob patterns for identifying compose files and basic test cases. Feedback suggests simplifying the glob patterns using brace expansion and ensuring consistency between the 'bad' and 'good' test examples by including the version field in both.

Comment thread pkl/builtins/dclint.pkl
Comment on lines +18 to +22
"**/compose*.yml",
"**/compose*.yaml",
"**/docker-compose*.yml",
"**/docker-compose*.yaml",
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The glob patterns are quite repetitive. They can be simplified to improve readability and maintainability by combining similar extensions and prefixes.

    List(
      "**/compose*.{yml,yaml}",
      "**/docker-compose*.{yml,yaml}"
    )

Comment thread pkl/builtins/dclint.pkl Outdated
filename = "docker-compose.yml"
}
local const bad = "version: '3'\nservices:\n web:\n image: nginx\n"
local const good = "services:\n web:\n image: nginx:latest\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The good example for the test case omits the version field, which is present in the bad example. For better clarity and consistency, especially if dclint has rules around the version field, it's recommended to include it in the good example to represent a fully valid and fixed version of the bad input.

    local const good = "version: '3'\nservices:\n  web:\n    image: nginx:latest\n"

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 29, 2026

Greptile Summary

This PR adds dclint (docker-compose linter) as a new builtin to the hk registry. It follows the established pattern for infrastructure builtins like hadolint, covering both check and fix workflows with comprehensive test coverage.

Both concerns raised in the previous review round have been addressed:

  • check_list_files is no longer present (correctly removed since dclint {{files}} outputs error messages rather than plain file paths).
  • Fix tests (fixPass) are now included, testing the auto-fix path for the deprecated version: key as well as a no-op fix on an already-clean file.

Key implementation details:

  • Glob patterns cover all common Docker Compose file naming conventions (compose*, docker-compose*, .yml/.yaml).
  • batch = true is set, consistent with other multi-file linters like prettier.
  • The tool stub pins dclint at 3.1.0 via npm:dclint, following the same stub format used by other npm-backed builtins.
  • Four tests exercise checkFail, checkPass, fixPass (bad → fixed), and fixPass (good → unchanged).

Confidence Score: 5/5

This PR is safe to merge — it is a self-contained new builtin with no risk of breaking existing functionality.

Both previous P1/P2 concerns (incorrect check_list_files usage and missing fix tests) have been fully addressed in this revision. The implementation follows the established builtin pattern correctly, the glob patterns are comprehensive, and all four test cases are structurally valid. No new issues were found.

No files require special attention.

Important Files Changed

Filename Overview
pkl/builtins/dclint.pkl New builtin for docker-compose linter with check/fix commands, comprehensive glob patterns, and four tests covering check pass/fail and fix pass/no-op scenarios.
test/builtin_tool_stubs/dclint Tool stub pinning dclint at version 3.1.0 via npm, following the same mise tool-stub format used by other builtins.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Staged file matches glob
 compose*.yml / docker-compose*.yml] --> B{run type}
    B -->|check| C["dclint {{files}}"]
    B -->|fix| D{check_first?}
    D -->|yes, check passes| E[skip fix]
    D -->|check fails| F["dclint --fix {{files}}"]
    C -->|exit 0| G[✅ Pass]
    C -->|exit ≠ 0| H[❌ Fail]
    F -->|exit 0| I[✅ File auto-fixed]
    F -->|exit ≠ 0| J[❌ Fix failed]
Loading

Reviews (3): Last reviewed commit: "feat(builtins): add dclint builtin for D..." | Re-trigger Greptile

Comment thread pkl/builtins/dclint.pkl
Comment thread pkl/builtins/dclint.pkl
@timothysparg timothysparg force-pushed the feat/builtins/dclint branch from ebf4766 to bc865f6 Compare March 29, 2026 23:06
@timothysparg timothysparg force-pushed the feat/builtins/dclint branch from bc865f6 to 7c964d8 Compare March 31, 2026 20:24
@jdx jdx merged commit a80a481 into jdx:main Apr 1, 2026
18 checks passed
@jdx jdx mentioned this pull request Apr 1, 2026
jdx added a commit that referenced this pull request Apr 1, 2026
### 🚀 Features

- **(betterleaks)** add betterleaks config to hk builtin config by
[@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in
[#750](#750)
- **(builtins)** add google-java-format to builtins by
[@timothysparg](https://github.com/timothysparg) in
[#777](#777)
- **(builtins)** add dclint to builtins by
[@timothysparg](https://github.com/timothysparg) in
[#779](#779)
- **(config)** set default value for exclude to List() by
[@timothysparg](https://github.com/timothysparg) in
[#781](#781)
- **(core)** add required field to prevent unconfigured steps from
running by [@timothysparg](https://github.com/timothysparg) in
[#785](#785)
- **(gitleaks)** add gitleaks config to hk builtin config by
[@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in
[#749](#749)
- **(mdschema)** add mdschema config to hk builtin config by
[@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in
[#748](#748)
- **(pkl)** add pklr as opt-in pkl backend by
[@jdx](https://github.com/jdx) in
[#769](#769)
- add pklr as opt-in pkl backend by [@jdx](https://github.com/jdx) in
[#768](#768)

### 🐛 Bug Fixes

- **(docs)** replace invalid /latest/ pkl package URIs with versioned
format by [@jdx](https://github.com/jdx) in
[#770](#770)
- **(stage)** do not stage pre-existing untracked files by
[@jdx](https://github.com/jdx) in
[#788](#788)

### 📚 Documentation

- add benchmarks page and reproducible benchmark suite by
[@jdx](https://github.com/jdx) in
[#766](#766)
- add recommended setup section to mise integration by
[@timothysparg](https://github.com/timothysparg) in
[#780](#780)

### 📦️ Dependency Updates

- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#762](#762)
- update rust crate pklr to 0.4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#776](#776)
- update apple-actions/import-codesign-certs digest to fe74d46 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#774](#774)
- update anthropics/claude-code-action digest to 094bd24 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#773](#773)
- update taiki-e/upload-rust-binary-action digest to 0e34102 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#775](#775)
- bump usage to 3.2.0 and pkl to 0.31.1, add windows platforms by
[@jdx](https://github.com/jdx) in
[#787](#787)
- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#786](#786)

### New Contributors

- @timothysparg made their first contribution in
[#781](#781)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Primarily a version/documentation bump, but it also updates the Rust
dependency lockfile (e.g., `hyper` and `windows-sys`), which could
introduce build/runtime regressions.
> 
> **Overview**
> Bumps hk to **v1.40.0** and publishes the corresponding release notes
in `CHANGELOG.md`.
> 
> Updates generated CLI/docs and all Pkl package URL references in
docs/examples to point at `v1.40.0`, and refreshes `Cargo.lock` with
dependency updates/removals consistent with the new release.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
da00ab8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <[email protected]>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Apr 2, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [hk](https://github.com/jdx/hk) | minor | `1.39.0` → `1.40.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jdx/hk (hk)</summary>

### [`v1.40.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1400---2026-04-01)

[Compare Source](jdx/hk@v1.39.0...v1.40.0)

##### 🚀 Features

- **(betterleaks)** add betterleaks config to hk builtin config by [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;750](jdx/hk#750)
- **(builtins)** add google-java-format to builtins by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;777](jdx/hk#777)
- **(builtins)** add dclint to builtins by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;779](jdx/hk#779)
- **(config)** set default value for exclude to List() by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;781](jdx/hk#781)
- **(core)** add required field to prevent unconfigured steps from running by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;785](jdx/hk#785)
- **(gitleaks)** add gitleaks config to hk builtin config by [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;749](jdx/hk#749)
- **(mdschema)** add mdschema config to hk builtin config by [@&#8203;hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#&#8203;748](jdx/hk#748)
- **(pkl)** add pklr as opt-in pkl backend by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;769](jdx/hk#769)
- add pklr as opt-in pkl backend by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;768](jdx/hk#768)

##### 🐛 Bug Fixes

- **(docs)** replace invalid /latest/ pkl package URIs with versioned format by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;770](jdx/hk#770)
- **(stage)** do not stage pre-existing untracked files by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;788](jdx/hk#788)

##### 📚 Documentation

- add benchmarks page and reproducible benchmark suite by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;766](jdx/hk#766)
- add recommended setup section to mise integration by [@&#8203;timothysparg](https://github.com/timothysparg) in [#&#8203;780](jdx/hk#780)

##### 📦️ Dependency Updates

- lock file maintenance by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;762](jdx/hk#762)
- update rust crate pklr to 0.4 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;776](jdx/hk#776)
- update apple-actions/import-codesign-certs digest to [`fe74d46`](jdx/hk@fe74d46) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;774](jdx/hk#774)
- update anthropics/claude-code-action digest to [`094bd24`](jdx/hk@094bd24) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;773](jdx/hk#773)
- update taiki-e/upload-rust-binary-action digest to [`0e34102`](jdx/hk@0e34102) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;775](jdx/hk#775)
- bump usage to 3.2.0 and pkl to 0.31.1, add windows platforms by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;787](jdx/hk#787)
- lock file maintenance by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;786](jdx/hk#786)

##### New Contributors

- [@&#8203;timothysparg](https://github.com/timothysparg) made their first contribution in [#&#8203;781](jdx/hk#781)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlJlbm92YXRlIEJvdCIsImF1dG9tYXRpb246Ym90LWF1dGhvcmVkIiwiZGVwZW5kZW5jeS10eXBlOjptaW5vciJdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants