From 9156364c23cff19734a0055377321c22b1484c0f Mon Sep 17 00:00:00 2001 From: Filip Godlewski <54432731+filipgodlewski@users.noreply.github.com> Date: Sun, 12 Nov 2023 03:17:12 +0100 Subject: feat: add `auto-optional` (#196) * feat: add `auto-optional` * doc: add period at end of description --------- Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com> --- README.md | 2 +- lua/conform/formatters/auto_optional.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 lua/conform/formatters/auto_optional.lua diff --git a/README.md b/README.md index 71a4369..813669e 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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` \ diff --git a/lua/conform/formatters/auto_optional.lua b/lua/conform/formatters/auto_optional.lua new file mode 100644 index 0000000..b0738dc --- /dev/null +++ b/lua/conform/formatters/auto_optional.lua @@ -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, +} -- cgit v1.2.3-70-g09d2