feat(aqua): add JAR file support and ktfmt registry entry#8575
Conversation
Summary of ChangesHello, 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 integrates Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the ktfmt Kotlin formatter by adding its configuration to the registry. The dependency on java is correctly specified. However, the test configuration for verifying the installation is incorrect and will likely fail. I've provided a suggestion to fix the expected output of the version check command.
| backends = ["aqua:facebook/ktfmt"] | ||
| depends = ["java"] | ||
| description = "A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions" | ||
| test = ["ktfmt --version", "ktfmt version {{version}}"] |
There was a problem hiding this comment.
The test configuration appears to be incorrect. The test array is typically in the format ["<command>", "<expected_output>"]. The ktfmt --version command outputs only the version number (e.g., 0.46), not a string like ktfmt version 0.46. As a result, this test is likely to fail.
To fix this, the expected output should be the version placeholder to match the actual command output.
| test = ["ktfmt --version", "ktfmt version {{version}}"] | |
| test = ["ktfmt --version", "{{version}}"] |
There was a problem hiding this comment.
This isn't correct:
ktfmt --version
ktfmt version 0.61
caf03ea to
269de30
Compare
Greptile SummaryThis PR extends the aqua backend's Key points:
Confidence Score: 2/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[AquaBackend::install called\nformat = raw, filename = *.jar] --> B{filename.ends_with\n.jar ?}
B -- No --> C[file::copy tarball\nto first_bin_path]
B -- Yes --> D[Compute jar_path =\nfirst_bin_path.with_extension jar]
D --> E[file::copy tarball\nto jar_path]
E --> F[Generate sh wrapper\nwith absolute jar_path\nembedded via formatdoc!]
F --> G[file::write wrapper\nto first_bin_path]
G --> H[make_executable = true]
C --> H
H --> I[Loop over bin_paths:\nfile::make_executable\nwrapper script]
I --> J{symlink_bins?}
J -- Yes --> K[create_symlink_bin_dir:\nsymlink to wrapper in .mise-bins/]
J -- No --> L[Done]
K --> L
Last reviewed commit: 9d4455b |
269de30 to
f9ac009
Compare
f9ac009 to
737b99b
Compare
|
Hi! I'm I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
|
737b99b to
9d4455b
Compare
|
@jdx think we can look at getting this merged? |
|
For context: Aqua recently added support in aquaproj/aqua#4625 I don't use Windows, so not too sure, but I think we shouldn't ignore them? |
|
Also, it might be worth adding an e2e test with a pinned version of ktfmt in |
I'd suggest supporting windows once others post an issue / chat in discord, instead of holding back the PR |
|
I don't think we should do anything like this for raw aqua types |
Ok, what would you prefer? Or will mise never support tools like this? |
Summary
rawformat asset ends in.jar, mise now creates a shell wrapper that invokesjava -jarinstead of copying the JAR directly as the binaryaqua:facebook/ktfmt) as the first tool to use thisAn example of the generated wrapper:
Context
ktfmt is distributed as a fat JAR (
ktfmt-<version>-with-dependencies.jar). JAR files aren't directly executable, so the aqua backend now detects.jarassets and generates a#!/bin/shwrapper that respects$JAVA_HOMEif set.