Skip to content

chore: consolidate all linters into hk.pkl#8498

Merged
jdx merged 9 commits intomainfrom
chore/add-cargo-fmt-to-hk
Mar 7, 2026
Merged

chore: consolidate all linters into hk.pkl#8498
jdx merged 9 commits intomainfrom
chore/add-cargo-fmt-to-hk

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Mar 7, 2026

Summary

  • Move actionlint, markdownlint, cargo-fmt, and schema validation from xtask lint scripts into hk.pkl
  • Remove dbg! ripgrep check
  • Remove temporary rustfmt.toml creation from xtasks/lint-fix.sh (cargo fmt now in hk)
  • Document hk install --mise for pre-commit hooks in CLAUDE.md and contributing docs
  • Delete .agent-os/ directory, add .claude/ to .markdownlintignore

All linters now run via hk check --all, which means hk install --mise gives contributors pre-commit hooks that catch everything.

🤖 Generated with Claude Code


Note

Low Risk
Primarily tooling and documentation changes; main risk is CI/local lint behavior changing due to new hk.pkl steps and expanded file globs.

Overview
Consolidates linting/formatting into hk.pkl by adding cargo fmt, actionlint, markdownlint, and JSON schema validation (ajv), while broadening glob coverage for pkl and taplo.

Removes now-redundant xtasks/lint/* scripts (including the ripgrep dbg! check) and simplifies xtasks/lint-fix.sh to delegate entirely to hk fix without generating a temporary rustfmt.toml.

Updates contributor docs (CLAUDE.md, docs/contributing.md) to use hk install --mise for pre-commit hooks, trims related task docs (tasks.md), deletes the .agent-os/ documentation directory, and adds .claude/ to .markdownlintignore.

Written by Cursor Bugbot for commit 2b134eb. This will update automatically on new commits. Configure here.

jdx and others added 2 commits March 7, 2026 15:01
This ensures cargo fmt runs as part of hk pre-commit hooks, preventing
autofix-ci from needing to make separate formatting commits on PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Now handled by hk.pkl cargo-fmt linter step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the Rust code formatting process by centralizing cargo-fmt execution within the hk.pkl configuration. This change aims to prevent autofix-ci from generating separate formatting commits, leading to a cleaner and more efficient development workflow by ensuring formatting is addressed earlier in the commit cycle.

Highlights

  • Linter Integration: Integrated cargo-fmt as a linter step within hk.pkl to automate Rust code formatting checks during pre-commit hooks.
  • Script Cleanup: Removed the temporary rustfmt.toml creation and deletion logic from xtasks/lint-fix.sh.
  • Redundant Script Removal: Deleted the xtasks/lint/cargo-fmt script, as its functionality is now managed by hk.pkl.
Changelog
  • hk.pkl
    • Integrated cargo-fmt as a new linter step.
    • Configured cargo fmt --all -- --check for checking and cargo fmt --all for fixing.
  • xtasks/lint-fix.sh
    • Removed the logic for creating and deleting a temporary rustfmt.toml file.
    • Eliminated the direct call to cargo fmt --all.
  • xtasks/lint/cargo-fmt
    • Deleted the entire script as its functionality is now handled by hk.pkl.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 refactors the Rust code formatting by moving cargo fmt into hk.pkl. While this simplifies the linting setup, I've identified a couple of issues. The glob pattern for Rust files is not recursive, which means it will miss most files. Additionally, the removal of the dynamic rustfmt.toml creation also removes specific formatting rules, which could lead to inconsistent formatting. My review includes suggestions to address these points.

I am having trouble creating individual review comments. Click here to see my feedback.

hk.pkl (17)

high

The glob pattern *.rs will only match Rust files in the root directory. To ensure all Rust files in the project are formatted, you should use a recursive glob pattern like **/*.rs.

      glob = List("**/*.rs")

xtasks/lint-fix.sh (10-15)

high

By removing the dynamic creation of rustfmt.toml, you are also removing the specific formatting rules that were being applied (unstable_features = true, imports_granularity = "Module"). This will cause cargo fmt to revert to its default settings, which may result in different code formatting. If these settings are still required, you should create a permanent rustfmt.toml file in the repository root with the previous content.

markdownlint --fix .
SHELLCHECK_OPTS="--exclude=SC1090 --exclude=SC2046 --exclude=SC2086 --exclude=SC2129" actionlint

cat >rustfmt.toml <<EOF
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Formatting config options lost during cargo-fmt migration

Medium Severity

The old lint-fix.sh created a temporary rustfmt.toml with unstable_features = true and imports_granularity = "Module" before running cargo fmt. The new cargo-fmt step in hk.pkl runs cargo fmt without these settings, and no permanent rustfmt.toml exists in the repo. This silently changes formatting behavior — imports_granularity = "Module" grouped imports by module, which will no longer happen with the default "Preserve" setting.

Additional Locations (1)

Fix in Cursor Fix in Web

Run `hk install --mise` when entering the project so pre-commit
hooks are always set up for contributors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR consolidates all linters (actionlint, markdownlint, cargo fmt, JSON schema validation) from individual xtasks/lint/* scripts into hk.pkl, making hk check --all / hk fix --all the single entry point for linting. It also fixes pre-existing glob bugs in hk.pkl (pkl and taplo steps now use ** prefix to match files in subdirectories), removes the dbg! ripgrep check, updates contributor docs to use hk install --mise for pre-commit hooks, and adds .claude/ to .markdownlintignore.

Key changes:

  • hk.pkl: Adds four new linter steps (cargo-fmt, actionlint, markdownlint, schema); fixes pkl and taplo globs to use **/*.pkl and **/*.toml for recursive directory matching — correcting a prior coverage gap where root-only globs would miss files in subdirectories.
  • xtasks/lint-fix.sh: Reduced to a single hk fix --all invocation; per-tool fix commands removed.
  • xtasks/lint/{actionlint,cargo-fmt,markdownlint,ripgrep,schema}: All deleted; functionality moved into hk.pkl.
  • CLAUDE.md / docs/contributing.md: Updated pre-commit setup instructions to use hk install --mise.
  • .markdownlintignore: Adds .claude/ to prevent linting AI agent instructions.

All changes affect only dev tooling and documentation; no production code impact.

Confidence Score: 5/5

  • Safe to merge. Changes are confined to dev tooling configuration and documentation with zero impact on production code or user-facing behavior.
  • This PR is low-risk and correct. All changes affect only CI/dev workflow and documentation. The migrated linter commands are functionally equivalent to their removed predecessors (verified glob patterns and check commands match or improve upon previous scripts). The pkl and taplo glob fixes are correctness improvements that eliminate prior subdirectory coverage gaps. No application logic is modified, and all behavioral differences from prior scripts are either intentional (cargo fmt removing temporary rustfmt.toml configuration, which was flagged in prior review) or transparent (consolidating linters from multiple scripts into hk.pkl).
  • No files require special attention.

Last reviewed commit: 2b134eb

autofix-ci bot and others added 2 commits March 7, 2026 15:08
Move actionlint, markdownlint, and schema validation from xtask lint
scripts into hk.pkl so they run as part of pre-commit hooks via
`hk install --mise`. Remove the dbg! ripgrep check. Delete .agent-os
directory. Add .claude/ to .markdownlintignore. Revert the mise.toml
hooks.enter change in favor of documenting `hk install --mise` in
CLAUDE.md and contributing docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx changed the title chore: move cargo fmt into hk.pkl chore: consolidate all linters into hk.pkl Mar 7, 2026
["schema"] {
glob = List("schema/*.json")
check = "ajv compile -s schema/mise.json --spec=draft2019 --strict-schema=true && ajv compile -s schema/mise-task.json --spec=draft2019 --strict-schema=true && ajv compile -s schema/mise.plugin.json --spec=draft2020 --strict-schema=true"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debug macro check removed without replacement

Medium Severity

The xtasks/lint/ripgrep script, which scanned src/ for accidental dbg! macros, was deleted but no equivalent step was added to hk.pkl. Clippy's dbg_macro lint is also not configured in Cargo.toml. This removes the only guard against committing Rust debug output to production code.

Fix in Cursor Fix in Web

autofix-ci bot and others added 2 commits March 7, 2026 15:14
These now run via hk fix --all, so the explicit calls were duplicated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

jdx and others added 2 commits March 7, 2026 15:25
Ensures subdirectories like docs/ are covered, matching the previous
recursive behavior of `markdownlint .`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx enabled auto-merge (squash) March 7, 2026 15:26
@jdx jdx merged commit c3777b1 into main Mar 7, 2026
37 checks passed
@jdx jdx deleted the chore/add-cargo-fmt-to-hk branch March 7, 2026 15:39
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.4 x -- echo 24.3 ± 0.5 23.5 28.4 1.00
mise x -- echo 24.4 ± 0.4 23.5 27.5 1.00 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.4 env 23.7 ± 0.7 22.5 29.0 1.00
mise env 24.0 ± 0.4 23.0 26.8 1.01 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.4 hook-env 24.1 ± 0.3 23.4 28.0 1.00
mise hook-env 24.7 ± 0.4 23.9 28.8 1.03 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.4 ls 23.7 ± 0.4 22.9 25.2 1.00
mise ls 24.0 ± 1.2 23.1 49.1 1.01 ± 0.06

xtasks/test/perf

Command mise-2026.3.4 mise Variance
install (cached) 152ms 152ms +0%
ls (cached) 83ms 83ms +0%
bin-paths (cached) 88ms 88ms +0%
task-ls (cached) 857ms 815ms +5%

jdx pushed a commit that referenced this pull request Mar 7, 2026
### 🚀 Features

- **(vfox)** add `RUNTIME.envType` for libc variant detection by @malept
in [#8493](#8493)
- store provenance verification results in lockfile by @jdx in
[#8495](#8495)

### 🐛 Bug Fixes

- **(env)** skip remote version fetching for "latest" in prefer-offline
mode by @jdx in [#8500](#8500)
- **(tasks)** deduplicate shared deps across task delegation by
@vadimpiven in [#8497](#8497)
- **(windows)** correctly identify mise binary without extension by @jdx
in [#8503](#8503)

### 🚜 Refactor

- **(core)** migrate cmd! callers to async with kill_on_drop by @jdx in
[a63f7d2](a63f7d2)

### Chore

- **(ci)** temporarily disable `mise up` in release-plz by @jdx in
[#8504](#8504)
- consolidate all linters into hk.pkl by @jdx in
[#8498](#8498)

## 📦 Aqua Registry Updates

#### New Packages (1)

- [`apache/ant`](https://github.com/apache/ant)
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.

1 participant