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: add markdownlint, stylelint, codespell, and biome #45

Merged
merged 5 commits into from
Sep 14, 2023
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ To view configured and available formatters, as well as to see the path to the l
- [autopep8](https://github.com/hhatto/autopep8) - A tool that automatically formats Python code to conform to the PEP 8 style guide.
- [beautysh](https://github.com/lovesegfault/beautysh) - A Bash beautifier for the masses.
- [black](https://github.com/psf/black) - The uncompromising Python code formatter.
- [biome](https://github.com/biomejs/biome) - A toolchain for web projects, aimed to provide functionalities to maintain them.
- [buf](https://buf.build/docs/lint/overview) - A new way of working with Protocol Buffers
- [clang_format](https://www.kernel.org/doc/html/latest/process/clang-format.html) - Tool to format C/C++/… code according to a set of rules and heuristics.
- [cljstyle](https://github.com/greglook/cljstyle) - Formatter for Clojure code.
- [cmake_format](https://github.com/cheshirekow/cmake_format) - Parse cmake listfiles and format them nicely.
- [codespell](https://github.com/codespell-project/codespell) - Check code for common misspellings.
- [dart_format](https://dart.dev/tools/dart-format) - Replace the whitespace in your program with formatting that follows Dart guidelines.
- [deno_fmt](https://deno.land/manual/tools/formatter) - Use [Deno](https://deno.land/) to format TypeScript, JavaScript/JSON and markdown.
- [dfmt](https://github.com/dlang-community/dfmt) - Formatter for D source code.
Expand All @@ -180,6 +182,7 @@ To view configured and available formatters, as well as to see the path to the l
- [htmlbeautifier](https://github.com/threedaymonk/htmlbeautifier) - A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates.
- [isort](https://github.com/PyCQA/isort) - Python utility / library to sort imports alphabetically and automatically separate them into sections and by type.
- [jq](https://github.com/stedolan/jq) - Command-line JSON processor.
- [markdownlint](https://github.com/DavidAnson/markdownlint) - A Node.js style checker and lint tool for Markdown/CommonMark files.
- [latexindent](https://github.com/cmhughes/latexindent.pl) - A perl script for formatting LaTeX files that is generally included in major TeX distributions.
- [nixfmt](https://github.com/serokell/nixfmt) - nixfmt is a formatter for Nix code, intended to apply a uniform style.
- [nixpkgs_fmt](https://github.com/nix-community/nixpkgs-fmt) - nixpkgs-fmt is a Nix code formatter for nixpkgs.
Expand All @@ -196,6 +199,7 @@ To view configured and available formatters, as well as to see the path to the l
- [shellharden](https://github.com/anordal/shellharden) - The corrective bash syntax highlighter
- [shfmt](https://github.com/mvdan/sh) - A shell parser, formatter, and interpreter with `bash` support.
- [sql_formatter](https://github.com/sql-formatter-org/sql-formatter) - A whitespace formatter for different query languages.
- [stylelint](https://github.com/stylelint/stylelint) - A mighty CSS linter that helps you avoid errors and enforce conventions.
- [stylua](https://github.com/JohnnyMorganz/StyLua) - An opinionated code formatter for Lua.
- [swift_format](https://github.com/apple/swift-format) - Swift formatter from apple. Requires building from source with `swift build`.
- [swiftformat](https://github.com/nicklockwood/SwiftFormat) - SwiftFormat is a code library and command-line tool for reformatting `swift` code on macOS or Linux.
Expand Down
10 changes: 10 additions & 0 deletions lua/conform/formatters/biome.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/biomejs/biome",
description = "A toolchain for web projects, aimed to provide functionalities to maintain them.",
},
command = "biome",
stdin = true,
args = { "format", "--stdin-file-path", "$FILENAME" },
}
14 changes: 14 additions & 0 deletions lua/conform/formatters/codespell.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/codespell-project/codespell",
description = "Check code for common misspellings.",
},
command = "codespell",
stdin = false,
args = {
"$FILENAME",
"--write-changes",
"--check-hidden", -- conform's temp file is hidden
},
}
10 changes: 10 additions & 0 deletions lua/conform/formatters/markdownlint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/DavidAnson/markdownlint",
description = "A Node.js style checker and lint tool for Markdown/CommonMark files.",
},
command = "markdownlint",
args = { "--fix", "$FILENAME" },
stdin = false,
}
10 changes: 10 additions & 0 deletions lua/conform/formatters/stylelint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/stylelint/stylelint",
description = "A mighty CSS linter that helps you avoid errors and enforce conventions.",
},
command = "stylelint",
args = { "--stdin", "--fix" },
stdin = true,
}