Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

feat(builtin-formatter): python-docformatter #1619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions lua/null-ls/builtins/formatting/docformatter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local h = require("null-ls.helpers")
local methods = require("null-ls.methods")

local FORMATTING = methods.internal.FORMATTING

return h.make_builtin({
name = "docformatter",
meta = {
url = "https://github.com/PyCQA/docformatter/",
description = "Python formatter complaint with the PEP 257 standard",
},
method = { FORMATTING },
filetypes = { "python" },
generator_opts = {
command = "docformatter",
-- black compatibility added by default because 74 cols is very restrictive
-- in modern times
args = { "--black", "-" },
to_stdin = true,
},
factory = h.formatter_factory,
})
Loading