Skip to content
Closed
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
34 changes: 34 additions & 0 deletions qlty-plugins/plugins/linters/mdformat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# mdformat

[mdformat](https://github.com/hukkin/mdformat) is a CommonMark compliant Markdown formatter.

## Enabling mdformat

Enabling with the `qlty` CLI:

```bash
qlty plugins enable mdformat
```

Or by editing `qlty.toml`:

```toml
# Always use the latest version
[plugins.enabled]
mdformat = "latest"

# OR enable a specific version
[plugins.enabled]
mdformat = "X.Y.Z"
```

## Links

- [mdformat on GitHub](https://github.com/hukkin/mdformat)
- [mdformat plugin definition](https://github.com/qltysh/qlty/tree/main/plugins/linters/mdformat)
- [mdformat releases](https://github.com/hukkin/mdformat/releases)
- [Qlty's open source plugin definitions](https://github.com/qltysh/qlty/tree/main/plugins/linters)

## License

mdformat is licensed under the [MIT License](https://github.com/hukkin/mdformat/blob/master/LICENSE).
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`linter=mdformat fixture=basic version=1.0.0 1`] = `
{
"issues": [
{
"category": "CATEGORY_STYLE",
"level": "LEVEL_FMT",
"location": {
"path": "basic.in.md",
},
"message": "Incorrect formatting, autoformat by running \`qlty fmt\`.",
"mode": "MODE_BLOCK",
"onAddedLine": true,
"ruleKey": "fmt",
"tool": "mdformat",
},
],
}
`;
7 changes: 7 additions & 0 deletions qlty-plugins/plugins/linters/mdformat/fixtures/basic.in.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Heading

This is a paragraph with extra spaces.

* Item 1
* Item 2
* Item 3
3 changes: 3 additions & 0 deletions qlty-plugins/plugins/linters/mdformat/mdformat.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { linterCheckTest } from "tests";

linterCheckTest("mdformat", __dirname);
18 changes: 18 additions & 0 deletions qlty-plugins/plugins/linters/mdformat/plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
config_version = "0"

[plugins.definitions.mdformat]
runtime = "python"
package = "mdformat"
file_types = ["markdown"]
latest_version = "1.0.0"
known_good_version = "1.0.0"
version_command = "mdformat --version"
description = "CommonMark compliant Markdown formatter"

[plugins.definitions.mdformat.drivers.format]
script = "mdformat ${target}"
success_codes = [0]
output = "rewrite"
cache_results = true
batch = true
driver_type = "formatter"
Loading