Skip to content

Commit

Permalink
feat: add auto-optional (#196)
Browse files Browse the repository at this point in the history
* feat: add `auto-optional`

* doc: add period at end of description

---------

Co-authored-by: Steven Arcangeli <[email protected]>
  • Loading branch information
filipgodlewski and stevearc authored Nov 12, 2023
1 parent 0963118 commit 9156364
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ You can view this list in vim with `:help conform-formatters`
- [alejandra](https://kamadorueda.com/alejandra/) - The Uncompromising Nix Code Formatter.
- [ast-grep](https://ast-grep.github.io/) - A CLI tool for code structural search, lint and rewriting. Written in Rust
- [astyle](https://astyle.sourceforge.net/astyle.html) - A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code.
- [auto-optional](https://auto-optional.daanluttik.nl/) - A tool that automatically formats Python code to conform to the PEP 8 style guide.
- [autoflake](https://github.com/PyCQA/autoflake) - Removes unused imports and unused variables as reported by pyflakes.
- [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.
Expand Down Expand Up @@ -510,7 +511,6 @@ Retrieve the available formatters for a buffer
`list_all_formatters(): conform.FormatterInfo[]` \
List information about all filetype-configured formatters


### get_formatter_info(formatter, bufnr)

`get_formatter_info(formatter, bufnr): conform.FormatterInfo` \
Expand Down
12 changes: 12 additions & 0 deletions lua/conform/formatters/auto_optional.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://auto-optional.daanluttik.nl/",
description = "Adds the Optional type-hint to arguments where the default value is None.",
},
command = "auto-optional",
args = {
"$FILENAME",
},
stdin = false,
}

0 comments on commit 9156364

Please sign in to comment.