chore: add stylua linting for vfox plugin Lua files#7960
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds stylua as a linting tool for Lua files in the vfox plugin directory. The changes ensure consistent code formatting across the project's Lua codebase by standardizing on tabs for indentation, adding trailing commas, and ensuring proper newlines at end of files.
Changes:
- Added stylua linting configuration to
hk.pklwith check and fix commands for vfox plugin Lua files - Added stylua as a dev dependency in
mise.toml - Applied stylua formatting across all vfox test plugin Lua files (whitespace normalization, trailing commas)
Reviewed changes
Copilot reviewed 11 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mise.toml | Added stylua as a development dependency |
| hk.pkl | Configured stylua linting step for vfox plugin Lua files |
| crates/vfox/plugins/test-nodejs/metadata.lua | Applied stylua formatting (indentation, trailing comma) |
| crates/vfox/plugins/test-nodejs/hooks/parse_legacy_file.lua | Applied stylua formatting (indentation, trailing comma) |
| crates/vfox/plugins/test-nodejs/hooks/env_keys.lua | Applied stylua formatting (indentation, trailing commas) |
| crates/vfox/plugins/test-nodejs/hooks/available.lua | Applied stylua formatting (indentation, trailing commas) |
| crates/vfox/plugins/hooks/env_keys.lua | Applied stylua formatting (indentation, trailing commas, removed trailing newline) |
| crates/vfox/plugins/dummy/metadata.lua | Applied stylua formatting (indentation, trailing comma) |
| crates/vfox/plugins/dummy/hooks/env_keys.lua | Applied stylua formatting (indentation, trailing commas, removed trailing newline) |
| crates/vfox/plugins/dummy/hooks/available.lua | Applied stylua formatting (indentation, trailing commas) |
| crates/vfox/plugins/dummy/Injection.lua | Removed trailing blank line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary of ChangesHello @jdx, 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 introduces Highlights
Using Gemini Code AssistThe 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
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 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
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
b6be481 to
1259a2b
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces stylua for linting and formatting Lua files, which is a great addition for maintaining consistent code style. The configuration for the new tool and the dev dependency are correctly added. The automatic formatting changes applied to the existing Lua files are also included.
My review includes one suggestion for hk.pkl to improve the efficiency of the new linting step by using the {{files}} placeholder, which will avoid re-scanning the entire directory for each file. This is an important optimization, especially for pre-commit hooks.
| check = "stylua --check crates/vfox/plugins/" | ||
| fix = "stylua crates/vfox/plugins/" |
There was a problem hiding this comment.
The check and fix commands for stylua are configured to run on the entire crates/vfox/plugins/ directory. Since hk runs this command for each file matching the glob (as batch defaults to false), this is inefficient. It causes the entire directory to be scanned for every single Lua file change.
You should use the {{files}} placeholder to pass only the relevant file(s) to the command. This will be much more performant, especially in pre-commit hooks.
I'd also recommend applying a similar change to the lua-check step for consistency and performance.
check = "stylua --check {{files}}"
fix = "stylua {{files}}"
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.1 x -- echo |
21.6 ± 0.9 | 20.9 | 41.1 | 1.00 |
mise x -- echo |
22.3 ± 0.3 | 21.7 | 23.1 | 1.03 ± 0.05 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.1 env |
20.6 ± 0.7 | 19.2 | 27.1 | 1.00 |
mise env |
20.9 ± 0.6 | 19.3 | 22.3 | 1.01 ± 0.05 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.1 hook-env |
21.5 ± 0.5 | 20.0 | 23.2 | 1.03 ± 0.07 |
mise hook-env |
20.9 ± 1.3 | 19.9 | 42.0 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.1 ls |
18.5 ± 0.5 | 17.6 | 22.7 | 1.00 |
mise ls |
19.3 ± 0.8 | 17.8 | 21.4 | 1.05 ± 0.06 |
xtasks/test/perf
| Command | mise-2026.2.1 | mise | Variance |
|---|---|---|---|
| install (cached) | 113ms | 113ms | +0% |
| ls (cached) | 70ms | 71ms | -1% |
| bin-paths (cached) | 74ms | 73ms | +1% |
| task-ls (cached) | 531ms | 540ms | -1% |
### 🚀 Features - **(asset-matcher)** enable `mingw-w64` detection for windows packages by @lchagnoleau in [#7981](#7981) - **(crates/vfox)** add download_path to BackendInstall context by @malept in [#7959](#7959) - **(python)** rework `python.uv_venv_auto` setting by @halms in [#7905](#7905) - add "Did you mean?" suggestions and inactive tool warnings by @jdx in [#7965](#7965) ### 🐛 Bug Fixes - **(hook-env)** skip remote version fetching for uninstalled tools in prefer-offline mode by @jdx in [#7976](#7976) - **(install.sh)** Corret `setup` to `set up` by @gogolok in [#7980](#7980) - retry spawn on ETXTBSY (Text file busy) by @jdx in [#7964](#7964) - improve ToolOptions parsing to support comma separated values by @roele in [#7971](#7971) ### 📚 Documentation - improve plugin documentation with comparisons and template links by @jdx in [#7962](#7962) ### 📦️ Dependency Updates - bump hyper-util, system-configuration, lru, aws-sdk, and others by @jdx in [#7977](#7977) ### Chore - **(vfox)** add LuaCATS type definitions for plugin IDE support by @jdx in [#7961](#7961) - **(vfox)** add `download_path` to `BackendInstallCtx` type defintion by @malept in [#7973](#7973) - add stylua linting for vfox plugin Lua files by @jdx in [#7960](#7960) - use system Rust for PPA builds on Ubuntu 26.04+ by @jdx in [#7956](#7956) ### New Contributors - @gogolok made their first contribution in [#7980](#7980) ## 📦 Aqua Registry Updates #### New Packages (4) - [`autobrr/mkbrr`](https://github.com/autobrr/mkbrr) - [`dodobrands/Peekie`](https://github.com/dodobrands/Peekie) - [`grpc/grpc-java/protoc-gen-grpc-java`](https://github.com/grpc/grpc-java/protoc-gen-grpc-java) - [`str4d/age-plugin-yubikey`](https://github.com/str4d/age-plugin-yubikey) #### Updated Packages (3) - [`biomejs/biome`](https://github.com/biomejs/biome) - [`rust-cross/cargo-zigbuild`](https://github.com/rust-cross/cargo-zigbuild) - [`siderolabs/talos`](https://github.com/siderolabs/talos)
## Summary - Add stylua as a linting step in `hk.pkl` for `crates/vfox/plugins/**/*.lua` - Add stylua as a dev dependency in `mise.toml` - Apply stylua formatting to all vfox test plugin Lua files (spaces→tabs, trailing commas, newlines at EOF) ## Test plan - [x] `stylua --check crates/vfox/plugins/` passes - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: adds a formatting/linting tool and applies whitespace-only reformatting to Lua plugin fixtures, with no functional logic changes expected. > > **Overview** > Adds **StyLua** as an hk linter/auto-fixer for `crates/vfox/plugins/**/*.lua` and includes `stylua` in `mise.toml`/`mise.lock` so the tool is available in dev. > > Reformats the vfox plugin Lua sources (dummy, template hooks, and test-nodejs) to match StyLua output (tabs/indentation, trailing commas, and ensuring newline at EOF), without changing behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1259a2b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
### 🚀 Features - **(asset-matcher)** enable `mingw-w64` detection for windows packages by @lchagnoleau in [jdx#7981](jdx#7981) - **(crates/vfox)** add download_path to BackendInstall context by @malept in [jdx#7959](jdx#7959) - **(python)** rework `python.uv_venv_auto` setting by @halms in [jdx#7905](jdx#7905) - add "Did you mean?" suggestions and inactive tool warnings by @jdx in [jdx#7965](jdx#7965) ### 🐛 Bug Fixes - **(hook-env)** skip remote version fetching for uninstalled tools in prefer-offline mode by @jdx in [jdx#7976](jdx#7976) - **(install.sh)** Corret `setup` to `set up` by @gogolok in [jdx#7980](jdx#7980) - retry spawn on ETXTBSY (Text file busy) by @jdx in [jdx#7964](jdx#7964) - improve ToolOptions parsing to support comma separated values by @roele in [jdx#7971](jdx#7971) ### 📚 Documentation - improve plugin documentation with comparisons and template links by @jdx in [jdx#7962](jdx#7962) ### 📦️ Dependency Updates - bump hyper-util, system-configuration, lru, aws-sdk, and others by @jdx in [jdx#7977](jdx#7977) ### Chore - **(vfox)** add LuaCATS type definitions for plugin IDE support by @jdx in [jdx#7961](jdx#7961) - **(vfox)** add `download_path` to `BackendInstallCtx` type defintion by @malept in [jdx#7973](jdx#7973) - add stylua linting for vfox plugin Lua files by @jdx in [jdx#7960](jdx#7960) - use system Rust for PPA builds on Ubuntu 26.04+ by @jdx in [jdx#7956](jdx#7956) ### New Contributors - @gogolok made their first contribution in [jdx#7980](jdx#7980) ## 📦 Aqua Registry Updates #### New Packages (4) - [`autobrr/mkbrr`](https://github.com/autobrr/mkbrr) - [`dodobrands/Peekie`](https://github.com/dodobrands/Peekie) - [`grpc/grpc-java/protoc-gen-grpc-java`](https://github.com/grpc/grpc-java/protoc-gen-grpc-java) - [`str4d/age-plugin-yubikey`](https://github.com/str4d/age-plugin-yubikey) #### Updated Packages (3) - [`biomejs/biome`](https://github.com/biomejs/biome) - [`rust-cross/cargo-zigbuild`](https://github.com/rust-cross/cargo-zigbuild) - [`siderolabs/talos`](https://github.com/siderolabs/talos)
Summary
hk.pklforcrates/vfox/plugins/**/*.luamise.tomlTest plan
stylua --check crates/vfox/plugins/passes🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds a formatting/linting tool and applies whitespace-only reformatting to Lua plugin fixtures, with no functional logic changes expected.
Overview
Adds StyLua as an hk linter/auto-fixer for
crates/vfox/plugins/**/*.luaand includesstyluainmise.toml/mise.lockso the tool is available in dev.Reformats the vfox plugin Lua sources (dummy, template hooks, and test-nodejs) to match StyLua output (tabs/indentation, trailing commas, and ensuring newline at EOF), without changing behavior.
Written by Cursor Bugbot for commit 1259a2b. This will update automatically on new commits. Configure here.