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

feat(tools): add support for flynt #870

Merged
merged 1 commit into from
Mar 23, 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 @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d

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

- feat(tools): add support for perflint [`#869`](https://github.com/hougesen/mdsf/pull/869)
- test(tools): validate js-beautify [`#868`](https://github.com/hougesen/mdsf/pull/868)
- test(tools): validate jsonlint [`#867`](https://github.com/hougesen/mdsf/pull/867)
- test(tools): validate vhdl-style-guide [`#866`](https://github.com/hougesen/mdsf/pull/866)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ mdsf init

<!-- START_SECTION:supported-tools -->

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

| Name | Description | Categories | Languages |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -473,6 +473,7 @@ mdsf init
| [fish_indent](https://fishshell.com/docs/current/cmds/fish_indent.html) | Fish indenter and prettifier | `formatter` | `fish` |
| [fixjson](https://github.com/rhysd/fixjson) | JSON Fixer for Humans using (relaxed) JSON5 | `formatter`, `linter` | `json5`, `json` |
| [floskell](https://github.com/ennocramer/floskell) | Floskell is a flexible Haskell source code pretty printer | `formatter` | `haskell` |
| [flynt](https://github.com/ikamensh/flynt) | A tool to automatically convert old string literal formatting to f-strings | `formatter` | `python` |
| [fnlfmt](https://git.sr.ht/~technomancy/fnlfmt) | A formatter for Fennel code | `formatter` | `fennel` |
| [forge](https://github.com/foundry-rs/foundry) | A Solidity formatter | `formatter` | `solidity` |
| [fortitude](https://github.com/plasmafair/fortitude) | A Fortran linter, written in Rust | `linter` | |
Expand Down Expand Up @@ -684,7 +685,7 @@ mdsf init

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

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

| Name | Command |
| ---------------------------- | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -777,6 +778,7 @@ mdsf init
| `fish_indent` | `fish_indent -w $PATH` |
| `fixjson` | `fixjson -w $PATH` |
| `floskell` | `floskell $PATH` |
| `flynt` | `flynt $PATH` |
| `fnlfmt` | `fnlfmt $PATH` |
| `forge:fmt` | `forge fmt $PATH` |
| `fortitude:check:fix:unsafe` | `fortitude check --quiet --no-respect-gitignore --fix --unsafe-fixes $PATH` |
Expand Down
21 changes: 21 additions & 0 deletions mdsf/src/tools/flynt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
///
/// 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(file_path);
cmd
}

pub const COMMANDS: [CommandType; 3] = [
CommandType::Direct("flynt"),
CommandType::Uv("flynt", "flynt"),
CommandType::Pipx("flynt"),
];

pub const IS_STDIN: bool = false;
12 changes: 12 additions & 0 deletions mdsf/src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub mod fantomas;
pub mod fish_indent;
pub mod fixjson;
pub mod floskell;
pub mod flynt;
pub mod fnlfmt;
pub mod forge_fmt;
pub mod fortitude_check;
Expand Down Expand Up @@ -1030,6 +1031,14 @@ pub enum Tooling {
/// `floskell $PATH`
Floskell,

#[serde(rename = "flynt")]
/// A tool to automatically convert old string literal formatting to f-strings
///
/// [https://github.com/ikamensh/flynt](https://github.com/ikamensh/flynt)
///
/// `flynt $PATH`
Flynt,

#[serde(rename = "fnlfmt")]
/// A formatter for Fennel code
///
Expand Down Expand Up @@ -3131,6 +3140,7 @@ impl Tooling {
),
Self::Fixjson => (&fixjson::COMMANDS, fixjson::set_args, fixjson::IS_STDIN),
Self::Floskell => (&floskell::COMMANDS, floskell::set_args, floskell::IS_STDIN),
Self::Flynt => (&flynt::COMMANDS, flynt::set_args, flynt::IS_STDIN),
Self::Fnlfmt => (&fnlfmt::COMMANDS, fnlfmt::set_args, fnlfmt::IS_STDIN),
Self::ForgeFmt => (
&forge_fmt::COMMANDS,
Expand Down Expand Up @@ -3911,6 +3921,7 @@ impl AsRef<str> for Tooling {
Self::FishIndent => "fish_indent",
Self::Fixjson => "fixjson",
Self::Floskell => "floskell",
Self::Flynt => "flynt",
Self::Fnlfmt => "fnlfmt",
Self::ForgeFmt => "forge:fmt",
Self::FortitudeCheck => "fortitude:check",
Expand Down Expand Up @@ -4248,6 +4259,7 @@ mod test_tooling {
assert_eq!(Tooling::FishIndent, reverse(Tooling::FishIndent)?);
assert_eq!(Tooling::Fixjson, reverse(Tooling::Fixjson)?);
assert_eq!(Tooling::Floskell, reverse(Tooling::Floskell)?);
assert_eq!(Tooling::Flynt, reverse(Tooling::Flynt)?);
assert_eq!(Tooling::Fnlfmt, reverse(Tooling::Fnlfmt)?);
assert_eq!(Tooling::ForgeFmt, reverse(Tooling::ForgeFmt)?);
assert_eq!(Tooling::FortitudeCheck, reverse(Tooling::FortitudeCheck)?);
Expand Down
5 changes: 5 additions & 0 deletions schemas/development/mdsf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@
"type": "string",
"enum": ["floskell"]
},
{
"description": "A tool to automatically convert old string literal formatting to f-strings\n\n[https://github.com/ikamensh/flynt](https://github.com/ikamensh/flynt)\n\n`flynt $PATH`",
"type": "string",
"enum": ["flynt"]
},
{
"description": "A formatter for Fennel code\n\n[https://git.sr.ht/~technomancy/fnlfmt](https://git.sr.ht/~technomancy/fnlfmt)\n\n`fnlfmt $PATH`",
"type": "string",
Expand Down
5 changes: 5 additions & 0 deletions schemas/v0.8.2-next/mdsf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@
"type": "string",
"enum": ["floskell"]
},
{
"description": "A tool to automatically convert old string literal formatting to f-strings\n\n[https://github.com/ikamensh/flynt](https://github.com/ikamensh/flynt)\n\n`flynt $PATH`",
"type": "string",
"enum": ["flynt"]
},
{
"description": "A formatter for Fennel code\n\n[https://git.sr.ht/~technomancy/fnlfmt](https://git.sr.ht/~technomancy/fnlfmt)\n\n`fnlfmt $PATH`",
"type": "string",
Expand Down
19 changes: 19 additions & 0 deletions tools/flynt/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "../tool.schema.json",
"binary": "flynt",
"categories": ["formatter"],
"commands": {
"": {
"arguments": ["$PATH"],
"tests": []
}
},
"description": "A tool to automatically convert old string literal formatting to f-strings",
"homepage": "https://github.com/ikamensh/flynt",
"languages": ["python"],
"packages": {
"pip": {
"package": "flynt"
}
}
}
Loading