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(cli): add support for nasmfmt #716

Merged
merged 1 commit into from
Feb 21, 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: 0 additions & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ jobs:
- run: npx prettier@latest --write schemas mdsf.json README.md
- uses: EndBug/add-and-commit@v9
with:
add: schemas mdsf.json README.md
message: "chore: updated generated code"
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelo.

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

- feat(cli): add support for nasmfmt [`#716`](https://github.com/hougesen/mdsf/pull/716)
- feat(cli): add support for runic [`#715`](https://github.com/hougesen/mdsf/pull/715)
- build(deps-dev): bump globals from 15.15.0 to 16.0.0 in /mdsf-vscode [`#707`](https://github.com/hougesen/mdsf/pull/707)
- build(deps): bump anyhow from 1.0.95 to 1.0.96 [`#711`](https://github.com/hougesen/mdsf/pull/711)
- build(deps): bump tempfile from 3.16.0 to 3.17.1 [`#714`](https://github.com/hougesen/mdsf/pull/714)
- build(deps-dev): bump @typescript-eslint/eslint-plugin in /mdsf-vscode [`#712`](https://github.com/hougesen/mdsf/pull/712)
- build(deps): bump serde_json from 1.0.138 to 1.0.139 [`#713`](https://github.com/hougesen/mdsf/pull/713)
- build(deps): bump clap from 4.5.29 to 4.5.30 [`#704`](https://github.com/hougesen/mdsf/pull/704)
- build(deps): bump serde from 1.0.217 to 1.0.218 [`#709`](https://github.com/hougesen/mdsf/pull/709)
- build(deps-dev): bump @typescript-eslint/parser in /mdsf-vscode [`#710`](https://github.com/hougesen/mdsf/pull/710)
- build(deps): bump log from 0.4.25 to 0.4.26 [`#708`](https://github.com/hougesen/mdsf/pull/708)
- build(deps): bump clap_complete from 4.5.44 to 4.5.45 [`#705`](https://github.com/hougesen/mdsf/pull/705)
- feat(cli): add support for gospel [`#703`](https://github.com/hougesen/mdsf/pull/703)
- feat(cli): add support for md-padding [`#698`](https://github.com/hougesen/mdsf/pull/698)
- feat(cli): add support for cpplint [`#694`](https://github.com/hougesen/mdsf/pull/694)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ mdsf init

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

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

| Name | Description | Categories | Languages |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------- |
Expand Down Expand Up @@ -479,6 +479,7 @@ mdsf init
| [mix](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html) | Code formatter for Elixir | `formatter` | `elixir` |
| [mojo](https://docs.modular.com/mojo/cli/format) | Formats Mojo source files | `formatter` | `mojo` |
| [mypy](https://github.com/python/mypy) | Optional static typing for Python | `linter` | `python` |
| [nasmfmt](https://github.com/yamnikov-oleg/nasmfmt) | Formatter for NASM source files | `formatter` | `assembly` |
| [nginxbeautifier](https://github.com/vasilevich/nginxbeautifier) | Format and beautify nginx config files | `formatter` | `nginx` |
| [nginxfmt](https://github.com/slomkowski/nginx-config-formatter) | nginx config file formatter/beautifier written in Python with no additional dependencies | `formatter` | `nginx` |
| [nickel](https://nickel-lang.org/) | Better configuration for less | `formatter` | `nickel` |
Expand Down Expand Up @@ -601,7 +602,7 @@ mdsf init

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

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

| Name | Command |
| ------------------------ | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -749,6 +750,7 @@ mdsf init
| `mix:format` | `mix format $PATH` |
| `mojo:format` | `mojo format -q $PATH` |
| `mypy` | `mypy $PATH` |
| `nasmfmt` | `nasmfmt $PATH` |
| `nginxbeautifier` | `nginxbeautifier $PATH` |
| `nginxfmt` | `nginxfmt $PATH` |
| `nickel:format` | `nickel format $PATH` |
Expand Down
22 changes: 22 additions & 0 deletions mdsf/src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub mod misspell;
pub mod mix_format;
pub mod mojo_format;
pub mod mypy;
pub mod nasmfmt;
pub mod nginxbeautifier;
pub mod nginxfmt;
pub mod nickel_format;
Expand Down Expand Up @@ -201,6 +202,7 @@ pub mod ruff_check;
pub mod ruff_format;
pub mod rufo;
pub mod rune_fmt;
pub mod runic;
pub mod rustfmt;
pub mod rustywind;
pub mod salt_lint;
Expand Down Expand Up @@ -1423,6 +1425,14 @@ pub enum Tooling {
/// `mypy $PATH`
Mypy,

#[serde(rename = "nasmfmt")]
/// Formatter for NASM source files
///
/// [https://github.com/yamnikov-oleg/nasmfmt](https://github.com/yamnikov-oleg/nasmfmt)
///
/// `nasmfmt $PATH`
Nasmfmt,

#[serde(rename = "nginxbeautifier")]
/// Format and beautify nginx config files
///
Expand Down Expand Up @@ -1871,6 +1881,14 @@ pub enum Tooling {
/// `rune fmt $PATH`
RuneFmt,

#[serde(rename = "runic")]
/// Julia code formatter
///
/// [https://github.com/fredrikekre/Runic.jl](https://github.com/fredrikekre/Runic.jl)
///
/// `runic --inplace $PATH`
Runic,

#[serde(rename = "rustfmt")]
/// The official code formatter for Rust
///
Expand Down Expand Up @@ -2557,6 +2575,7 @@ impl Tooling {
Self::MixFormat => (&mix_format::COMMANDS, mix_format::set_args),
Self::MojoFormat => (&mojo_format::COMMANDS, mojo_format::set_args),
Self::Mypy => (&mypy::COMMANDS, mypy::set_args),
Self::Nasmfmt => (&nasmfmt::COMMANDS, nasmfmt::set_args),
Self::Nginxbeautifier => (&nginxbeautifier::COMMANDS, nginxbeautifier::set_args),
Self::Nginxfmt => (&nginxfmt::COMMANDS, nginxfmt::set_args),
Self::NickelFormat => (&nickel_format::COMMANDS, nickel_format::set_args),
Expand Down Expand Up @@ -2616,6 +2635,7 @@ impl Tooling {
Self::RuffFormat => (&ruff_format::COMMANDS, ruff_format::set_args),
Self::Rufo => (&rufo::COMMANDS, rufo::set_args),
Self::RuneFmt => (&rune_fmt::COMMANDS, rune_fmt::set_args),
Self::Runic => (&runic::COMMANDS, runic::set_args),
Self::Rustfmt => (&rustfmt::COMMANDS, rustfmt::set_args),
Self::Rustywind => (&rustywind::COMMANDS, rustywind::set_args),
Self::SaltLint => (&salt_lint::COMMANDS, salt_lint::set_args),
Expand Down Expand Up @@ -2836,6 +2856,7 @@ impl AsRef<str> for Tooling {
Self::MixFormat => "mix_format",
Self::MojoFormat => "mojo_format",
Self::Mypy => "mypy",
Self::Nasmfmt => "nasmfmt",
Self::Nginxbeautifier => "nginxbeautifier",
Self::Nginxfmt => "nginxfmt",
Self::NickelFormat => "nickel_format",
Expand Down Expand Up @@ -2892,6 +2913,7 @@ impl AsRef<str> for Tooling {
Self::RuffFormat => "ruff_format",
Self::Rufo => "rufo",
Self::RuneFmt => "rune_fmt",
Self::Runic => "runic",
Self::Rustfmt => "rustfmt",
Self::Rustywind => "rustywind",
Self::SaltLint => "salt_lint",
Expand Down
18 changes: 18 additions & 0 deletions mdsf/src/tools/nasmfmt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
///
/// 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; 1] = [CommandType::Direct("nasmfmt")];

#[cfg(test)]
mod test_nasmfmt {}
19 changes: 19 additions & 0 deletions mdsf/src/tools/runic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
///
/// 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("--inplace");
cmd.arg(file_path);
cmd
}

pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("runic")];

#[cfg(test)]
mod test_runic {}
5 changes: 5 additions & 0 deletions schemas/v0.5.2-dev/mdsf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@
"type": "string",
"enum": ["mypy"]
},
{
"description": "Formatter for NASM source files\n\n[https://github.com/yamnikov-oleg/nasmfmt](https://github.com/yamnikov-oleg/nasmfmt)\n\n`nasmfmt $PATH`",
"type": "string",
"enum": ["nasmfmt"]
},
{
"description": "Format and beautify nginx config files\n\n[https://github.com/vasilevich/nginxbeautifier](https://github.com/vasilevich/nginxbeautifier)\n\n`nginxbeautifier $PATH`",
"type": "string",
Expand Down
14 changes: 14 additions & 0 deletions tools/nasmfmt/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "../tool.schema.json",
"binary": "nasmfmt",
"categories": ["formatter"],
"commands": {
"": {
"arguments": ["$PATH"]
}
},
"description": "Formatter for NASM source files",
"homepage": "https://github.com/yamnikov-oleg/nasmfmt",
"languages": ["assembly"],
"packages": {}
}
Loading