-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,363 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ brew install hougesen/tap/mdsf | |
<!-- START_SECTION:base-command-help --> | ||
|
||
``` | ||
mdsf 0.4.0 | ||
mdsf 0.4.0-dev | ||
Format markdown code snippets using your favorite code formatters | ||
Mads Hougesen <[email protected]> | ||
|
@@ -214,7 +214,7 @@ mdsf init | |
<!-- START_SECTION:supported-tools --> | ||
|
||
`mdsf` currently supports 235 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃 | ||
`mdsf` currently supports 236 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃 | ||
|
||
| Name | Description | Categories | Languages | | ||
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------- | | ||
|
@@ -398,6 +398,7 @@ mdsf init | |
| [salt-lint](https://github.com/warpnet/salt-lint) | A command-line utility that checks for best practices in SaltStack | `linter` | `salt` | | ||
| [scalafmt](https://github.com/scalameta/scalafmt) | Code formatter for Scala | `formatter` | `scala` | | ||
| [scalariform](https://github.com/scala-ide/scalariform) | Scala source code formatter | `formatter` | `scala` | | ||
| [selene](https://github.com/Kampfkarren/selene) | A blazing-fast modern Lua linter written in Rust | `linter` | `lua` | | ||
| [shellcheck](https://github.com/koalaman/shellcheck) | ShellCheck, a static analysis tool for shell scripts | `linter` | `bash`, `shell` | | ||
| [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` | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::process::Command; | ||
|
||
use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; | ||
|
||
#[inline] | ||
fn set_selene_args(mut cmd: Command, file_path: &std::path::Path) -> Command { | ||
cmd.arg(file_path); | ||
cmd | ||
} | ||
|
||
#[inline] | ||
pub fn run(file_path: &std::path::Path) -> Result<(bool, Option<String>), MdsfError> { | ||
let commands = [CommandType::Direct("selene")]; | ||
|
||
for (index, cmd) in commands.iter().enumerate() { | ||
let cmd = set_selene_args(cmd.build(), file_path); | ||
let execution_result = execute_command(cmd, file_path); | ||
|
||
if index == commands.len() - 1 { | ||
return execution_result; | ||
} | ||
|
||
if let Ok(r) = execution_result { | ||
if !r.0 { | ||
return Ok(r); | ||
} | ||
} | ||
} | ||
|
||
Ok((true, None)) | ||
} | ||
|
||
#[cfg(test)] | ||
mod test_selene {} |
Oops, something went wrong.