Skip to content

Commit

Permalink
feat(cli): support reek
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen committed Feb 23, 2025
1 parent aa0602a commit ffd9817
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 2 deletions.
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)

- 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 254 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
`mdsf` currently supports 255 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃

| Name | Description | Categories | Languages |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------- |
Expand Down Expand Up @@ -523,6 +523,7 @@ mdsf init
| [qmlfmt](https://github.com/jesperhh/qmlfmt) | qmlfmt - command line application that formats QML files | `formatter` | `qml` |
| [quick-lint-js](https://github.com/quick-lint/quick-lint-js) | quick-lint-js finds bugs in JavaScript programs | `linter` | `javascript` |
| [raco](https://docs.racket-lang.org/fmt/) | An extensible code formatter for Racket | `formatter` | `racket` |
| [reek](https://github.com/troessner/reek) | Code smell detector for Ruby | `linter` | `ruby` |
| [refmt](https://reasonml.github.io/docs/en/refmt) | refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason | `formatter` | `reason` |
| [reformat-gherkin](https://github.com/ducminh-phan/reformat-gherkin) | Reformat-gherkin automatically formats Gherkin files | `formatter` | `gherkin` |
| [regal](https://github.com/styrainc/regal) | Regal is a linter and language server for Rego, bringing your policy development experience to the next level | `linter` | `rego` |
Expand Down Expand Up @@ -605,7 +606,7 @@ mdsf init

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

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

| Name | Command |
| ------------------------ | --------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -799,6 +800,7 @@ mdsf init
| `qmlfmt` | `qmlfmt -w $PATH` |
| `quick-lint-js` | `quick-lint-js $PATH` |
| `raco:fmt` | `raco fmt -i $PATH` |
| `reek` | `reek $PATH` |
| `refmt` | `refmt --in-place $PATH` |
| `reformat-gherkin` | `reformat-gherkin $PATH` |
| `regal:fix` | `regal fix $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 @@ -191,6 +191,7 @@ pub mod pyment;
pub mod qmlfmt;
pub mod quick_lint_js;
pub mod raco_fmt;
pub mod reek;
pub mod refmt;
pub mod reformat_gherkin;
pub mod regal_fix;
Expand Down Expand Up @@ -1796,6 +1797,14 @@ pub enum Tooling {
/// `raco fmt -i $PATH`
RacoFmt,

#[serde(rename = "reek")]
/// Code smell detector for Ruby
///
/// [https://github.com/troessner/reek](https://github.com/troessner/reek)
///
/// `reek $PATH`
Reek,

#[serde(rename = "refmt")]
/// refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason
///
Expand Down Expand Up @@ -2648,6 +2657,7 @@ impl Tooling {
Self::Qmlfmt => (&qmlfmt::COMMANDS, qmlfmt::set_args),
Self::QuickLintJs => (&quick_lint_js::COMMANDS, quick_lint_js::set_args),
Self::RacoFmt => (&raco_fmt::COMMANDS, raco_fmt::set_args),
Self::Reek => (&reek::COMMANDS, reek::set_args),
Self::Refmt => (&refmt::COMMANDS, refmt::set_args),
Self::ReformatGherkin => (&reformat_gherkin::COMMANDS, reformat_gherkin::set_args),
Self::RegalFix => (&regal_fix::COMMANDS, regal_fix::set_args),
Expand Down Expand Up @@ -2932,6 +2942,7 @@ impl AsRef<str> for Tooling {
Self::Qmlfmt => "qmlfmt",
Self::QuickLintJs => "quick_lint_js",
Self::RacoFmt => "raco_fmt",
Self::Reek => "reek",
Self::Refmt => "refmt",
Self::ReformatGherkin => "reformat_gherkin",
Self::RegalFix => "regal_fix",
Expand Down
18 changes: 18 additions & 0 deletions mdsf/src/tools/reek.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("reek")];

#[cfg(test)]
mod test_reek {}
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 @@ -1016,6 +1016,11 @@
"type": "string",
"enum": ["raco:fmt"]
},
{
"description": "Code smell detector for Ruby\n\n[https://github.com/troessner/reek](https://github.com/troessner/reek)\n\n`reek $PATH`",
"type": "string",
"enum": ["reek"]
},
{
"description": "refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason\n\n[https://reasonml.github.io/docs/en/refmt](https://reasonml.github.io/docs/en/refmt)\n\n`refmt --in-place $PATH`",
"type": "string",
Expand Down
16 changes: 16 additions & 0 deletions tools/reek/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "../tool.schema.json",
"binary": "reek",
"categories": ["linter"],
"commands": {
"": {
"arguments": ["$PATH"]
}
},
"description": "Code smell detector for Ruby",
"homepage": "https://github.com/troessner/reek",
"languages": ["ruby"],
"packages": {
"gem": "reek"
}
}

0 comments on commit ffd9817

Please sign in to comment.