Skip to content

Commit

Permalink
feat(cli): add support for slim-lint (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen authored Feb 23, 2025
1 parent b6241d7 commit 781432d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

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

- feat(cli): add support for slim-lint [`#723`](https://github.com/hougesen/mdsf/pull/723)
- feat(cli): support reek [`#722`](https://github.com/hougesen/mdsf/pull/722)
- feat(cli): add support for pug-lint [`#721`](https://github.com/hougesen/mdsf/pull/721)
- feat(cli): add support for cppcheck [`#720`](https://github.com/hougesen/mdsf/pull/720)
- feat(cli): add support for bashate [`#719`](https://github.com/hougesen/mdsf/pull/719)
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 255 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
`mdsf` currently supports 256 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃

| Name | Description | Categories | Languages |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------- |
Expand Down Expand Up @@ -547,6 +547,7 @@ mdsf init
| [shellharden](https://github.com/anordal/shellharden) | The corrective bash syntax highlighter | `linter` | `bash`, `shell` |
| [shfmt](https://github.com/mvdan/sh) | Shell script formatter | `formatter` | `shell` |
| [sleek](https://github.com/nrempel/sleek) | Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity | `formatter` | `sql` |
| [slim-lint](https://github.com/sds/slim-lint) | Tool for analyzing Slim templates | `linter` | `slim` |
| [smlfmt](https://github.com/shwestrick/smlfmt) | A custom parser/auto-formatter for Standard ML | `formatter` | `standard-ml` |
| [snakefmt](https://github.com/snakemake/snakefmt) | The uncompromising Snakemake code formatter | `formatter` | `snakemake` |
| [solhint](https://github.com/protofire/solhint) | Solhint is an open-source project to provide a linting utility for Solidity code | `linter` | `solidity` |
Expand Down Expand Up @@ -606,7 +607,7 @@ mdsf init

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

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

| Name | Command |
| ------------------------ | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -826,6 +827,7 @@ mdsf init
| `shellharden` | `shellharden --transform --replace $PATH` |
| `shfmt` | `shfmt --write $PATH` |
| `sleek` | `sleek $PATH` |
| `slim-lint` | `slim-lint $PATH` |
| `smlfmt` | `smlfmt --force $PATH` |
| `snakefmt` | `snakefmt $PATH` |
| `solhint` | `solhint --quiet --fix --noPrompt $PATH` |
Expand Down
11 changes: 11 additions & 0 deletions mdsf/src/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ pub mod shellcheck;
pub mod shellharden;
pub mod shfmt;
pub mod sleek;
pub mod slim_lint;
pub mod smlfmt;
pub mod snakefmt;
pub mod solhint;
Expand Down Expand Up @@ -2005,6 +2006,14 @@ pub enum Tooling {
/// `sleek $PATH`
Sleek,

#[serde(rename = "slim-lint")]
/// Tool for analyzing Slim templates
///
/// [https://github.com/sds/slim-lint](https://github.com/sds/slim-lint)
///
/// `slim-lint $PATH`
SlimLint,

#[serde(rename = "smlfmt")]
/// A custom parser/auto-formatter for Standard ML
///
Expand Down Expand Up @@ -2686,6 +2695,7 @@ impl Tooling {
Self::Shellharden => (&shellharden::COMMANDS, shellharden::set_args),
Self::Shfmt => (&shfmt::COMMANDS, shfmt::set_args),
Self::Sleek => (&sleek::COMMANDS, sleek::set_args),
Self::SlimLint => (&slim_lint::COMMANDS, slim_lint::set_args),
Self::Smlfmt => (&smlfmt::COMMANDS, smlfmt::set_args),
Self::Snakefmt => (&snakefmt::COMMANDS, snakefmt::set_args),
Self::Solhint => (&solhint::COMMANDS, solhint::set_args),
Expand Down Expand Up @@ -2968,6 +2978,7 @@ impl AsRef<str> for Tooling {
Self::Shellharden => "shellharden",
Self::Shfmt => "shfmt",
Self::Sleek => "sleek",
Self::SlimLint => "slim_lint",
Self::Smlfmt => "smlfmt",
Self::Snakefmt => "snakefmt",
Self::Solhint => "solhint",
Expand Down
18 changes: 18 additions & 0 deletions mdsf/src/tools/slim_lint.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("slim-lint")];

#[cfg(test)]
mod test_slim_lint {}
5 changes: 5 additions & 0 deletions schemas/v0.5.3-dev/mdsf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,11 @@
"type": "string",
"enum": ["sleek"]
},
{
"description": "Tool for analyzing Slim templates\n\n[https://github.com/sds/slim-lint](https://github.com/sds/slim-lint)\n\n`slim-lint $PATH`",
"type": "string",
"enum": ["slim-lint"]
},
{
"description": "A custom parser/auto-formatter for Standard ML\n\n[https://github.com/shwestrick/smlfmt](https://github.com/shwestrick/smlfmt)\n\n`smlfmt --force $PATH`",
"type": "string",
Expand Down
16 changes: 16 additions & 0 deletions tools/slim-lint/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "../tool.schema.json",
"binary": "slim-lint",
"categories": ["linter"],
"commands": {
"": {
"arguments": ["$PATH"]
}
},
"description": "Tool for analyzing Slim templates",
"homepage": "https://github.com/sds/slim-lint",
"languages": ["slim"],
"packages": {
"gem": "slim_lint"
}
}

0 comments on commit 781432d

Please sign in to comment.