Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(kulala-fmt): update arguments to v2 #728

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [Unreleased](https://github.com/hougesen/mdsf/compare/v0.5.2...HEAD)

- refactor(kulala-fmt): update arguments to v2 [`#728`](https://github.com/hougesen/mdsf/pull/728)
- fix(cli): simplify file modified check [`#727`](https://github.com/hougesen/mdsf/pull/727)
- chore: add package manager to sleek, sqlfmt and typstyle [`#726`](https://github.com/hougesen/mdsf/pull/726)
- feat(cli): add support for pasfmt [`#725`](https://github.com/hougesen/mdsf/pull/725)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ mdsf init
| [kdoc-formatter](https://github.com/tnorbye/kdoc-formatter) | Reformats Kotlin KDoc comments, reflowing text and other cleanup | `formatter` | `kotlin` |
| [ktfmt](https://github.com/facebook/ktfmt) | program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions | `formatter` | `kotlin` |
| [ktlint](https://github.com/pinterest/ktlint) | An anti-bikeshedding Kotlin linter with built-in formatter | `linter` | `kotlin` |
| [kulala-fmt](https://github.com/mistweaverco/kulala-fmt) | An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter | `formatter` | `http` |
| [kulala-fmt](https://github.com/mistweaverco/kulala-fmt) | An opinionated .http and .rest file linter and formatter | `formatter` | `http` |
| [leptosfmt](https://github.com/bram209/leptosfmt) | A formatter for the leptos view! macro | `formatter` | `rust` |
| [liquidsoap-prettier](https://github.com/savonet/liquidsoap-prettier) | Prettier plugin for liquidsoap script | `formatter` | `liquidsoap` |
| [luacheck](https://github.com/lunarmodules/luacheck) | A tool for linting and static analysis of Lua code | `formatter` | `lua` |
Expand Down Expand Up @@ -609,7 +609,7 @@ mdsf init

<!-- START_SECTION:supported-commands -->

`mdsf` currently supports 276 commands. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
`mdsf` currently supports 277 commands. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃

| Name | Command |
| ------------------------ | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -741,7 +741,8 @@ mdsf init
| `kdoc-formatter` | `kdoc-formatter --quiet $PATH` |
| `ktfmt` | `ktfmt --format --log-level=error $PATH` |
| `ktlint` | `ktlint --format --log-level=error $PATH` |
| `kulala-fmt` | `kulala-fmt $PATH` |
| `kulala-fmt:check` | `kulala-fmt check $PATH` |
| `kulala-fmt:format` | `kulala-fmt format $PATH` |
| `leptosfmt` | `leptosfmt --quiet $PATH` |
| `liquidsoap-prettier` | `liquidsoap-prettier --write $PATH` |
| `luacheck` | `luacheck $PATH` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub fn set_args(
mut cmd: std::process::Command,
file_path: &std::path::Path,
) -> std::process::Command {
cmd.arg("check");
cmd.arg(file_path);
cmd
}
Expand All @@ -19,4 +20,4 @@ pub const COMMANDS: [CommandType; 3] = [
];

#[cfg(test)]
mod test_kulala_fmt {}
mod test_kulala_fmt_check {}
23 changes: 23 additions & 0 deletions mdsf/src/tools/kulala_fmt_format.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
///
/// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY
///
use crate::runners::CommandType;

#[inline]
pub fn set_args(
mut cmd: std::process::Command,
file_path: &std::path::Path,
) -> std::process::Command {
cmd.arg("format");
cmd.arg(file_path);
cmd
}

pub const COMMANDS: [CommandType; 3] = [
CommandType::NodeModules("kulala-fmt"),
CommandType::Direct("kulala-fmt"),
CommandType::Npm("@mistweaverco/kulala-fmt"),
];

#[cfg(test)]
mod test_kulala_fmt_format {}
25 changes: 18 additions & 7 deletions mdsf/src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ pub mod kdlfmt;
pub mod kdoc_formatter;
pub mod ktfmt;
pub mod ktlint;
pub mod kulala_fmt;
pub mod kulala_fmt_check;
pub mod kulala_fmt_format;
pub mod leptosfmt;
pub mod liquidsoap_prettier;
pub mod luacheck;
Expand Down Expand Up @@ -1306,13 +1307,21 @@ pub enum Tooling {
/// `ktlint --format --log-level=error $PATH`
Ktlint,

#[serde(rename = "kulala-fmt")]
/// An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter ⚡
#[serde(rename = "kulala-fmt:check")]
/// Check if .http and .rest code is formatted
///
/// [https://github.com/mistweaverco/kulala-fmt](https://github.com/mistweaverco/kulala-fmt)
///
/// `kulala-fmt $PATH`
KulalaFmt,
/// `kulala-fmt check $PATH`
KulalaFmtCheck,

#[serde(rename = "kulala-fmt:format")]
/// Format .http and .rest code
///
/// [https://github.com/mistweaverco/kulala-fmt](https://github.com/mistweaverco/kulala-fmt)
///
/// `kulala-fmt format $PATH`
KulalaFmtFormat,

#[serde(rename = "leptosfmt")]
/// A formatter for the leptos view! macro
Expand Down Expand Up @@ -2637,7 +2646,8 @@ impl Tooling {
Self::KdocFormatter => (&kdoc_formatter::COMMANDS, kdoc_formatter::set_args),
Self::Ktfmt => (&ktfmt::COMMANDS, ktfmt::set_args),
Self::Ktlint => (&ktlint::COMMANDS, ktlint::set_args),
Self::KulalaFmt => (&kulala_fmt::COMMANDS, kulala_fmt::set_args),
Self::KulalaFmtCheck => (&kulala_fmt_check::COMMANDS, kulala_fmt_check::set_args),
Self::KulalaFmtFormat => (&kulala_fmt_format::COMMANDS, kulala_fmt_format::set_args),
Self::Leptosfmt => (&leptosfmt::COMMANDS, leptosfmt::set_args),
Self::LiquidsoapPrettier => (
&liquidsoap_prettier::COMMANDS,
Expand Down Expand Up @@ -2930,7 +2940,8 @@ impl AsRef<str> for Tooling {
Self::KdocFormatter => "kdoc_formatter",
Self::Ktfmt => "ktfmt",
Self::Ktlint => "ktlint",
Self::KulalaFmt => "kulala_fmt",
Self::KulalaFmtCheck => "kulala_fmt_check",
Self::KulalaFmtFormat => "kulala_fmt_format",
Self::Leptosfmt => "leptosfmt",
Self::LiquidsoapPrettier => "liquidsoap_prettier",
Self::Luacheck => "luacheck",
Expand Down
9 changes: 7 additions & 2 deletions schemas/v0.5.3-dev/mdsf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,14 @@
"enum": ["ktlint"]
},
{
"description": "An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter ⚡\n\n[https://github.com/mistweaverco/kulala-fmt](https://github.com/mistweaverco/kulala-fmt)\n\n`kulala-fmt $PATH`",
"description": "Check if .http and .rest code is formatted\n\n[https://github.com/mistweaverco/kulala-fmt](https://github.com/mistweaverco/kulala-fmt)\n\n`kulala-fmt check $PATH`",
"type": "string",
"enum": ["kulala-fmt"]
"enum": ["kulala-fmt:check"]
},
{
"description": "Format .http and .rest code\n\n[https://github.com/mistweaverco/kulala-fmt](https://github.com/mistweaverco/kulala-fmt)\n\n`kulala-fmt format $PATH`",
"type": "string",
"enum": ["kulala-fmt:format"]
},
{
"description": "A formatter for the leptos view! macro\n\n[https://github.com/bram209/leptosfmt](https://github.com/bram209/leptosfmt)\n\n`leptosfmt --quiet $PATH`",
Expand Down
11 changes: 8 additions & 3 deletions tools/kulala-fmt/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
"binary": "kulala-fmt",
"categories": ["formatter"],
"commands": {
"": {
"arguments": ["$PATH"]
"check": {
"arguments": ["check", "$PATH"],
"description": "Check if .http and .rest code is formatted"
},
"format": {
"arguments": ["format", "$PATH"],
"description": "Format .http and .rest code"
}
},
"description": "An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter",
"description": "An opinionated .http and .rest file linter and formatter",
"homepage": "https://github.com/mistweaverco/kulala-fmt",
"languages": ["http"],
"packages": {
Expand Down
Loading