id = "black"
name = "Black"
homepage = "https://black.readthedocs.io"
description = "The uncompromising Python code formatter."
icon = "SimpleIcons:black"
executables = ["black", "blackd"]
[dotfiles]
paths = [
"~/.config/black",
"~/.black",
]
exclude = ["[cacheHome]/black/"]
secret = []
side_effect = false
[commands]
format = 1
label = "Format Python code"
description = "Format Python files or directories in place, or check and diff them. Config discovery is left to Black; color, safe/fast and notebook-magic options are left out."
quality = "ai-draft"
base = "fig:black"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/black.ts"
license = "MIT"
[[commands.field]]
id = "files"
label = "Files or directories"
description = "Leave blank only when using Code below."
type = "path"
position = 0
multiple = true
path = { kind = "any", role = "input" }
sources = ["fig"]
[[commands.field]]
id = "code"
label = "Code string"
description = "Format this code instead of files."
type = "string"
option = ["--code", "-c"]
sources = ["fig"]
[[commands.field]]
id = "line_length"
label = "Line length"
description = "Characters per line."
type = "integer"
option = ["--line-length", "-l"]
sources = ["fig"]
[[commands.field]]
id = "target_version"
label = "Target versions"
description = "Python versions that must be supported."
type = "string"
option = ["--target-version", "-t"]
multiple = true
suggestions = [{ value = "py37", label = "py37" }, { value = "py38", label = "py38" }, { value = "py39", label = "py39" }, { value = "py310", label = "py310" }]
sources = ["fig"]
[[commands.field]]
id = "check"
label = "Check only"
description = "Do not write files; exit status reports whether changes are needed."
type = "boolean"
option = ["--check"]
sources = ["fig"]
[[commands.field]]
id = "diff"
label = "Show diff only"
description = "Do not write files; print a diff."
type = "boolean"
option = ["--diff"]
sources = ["fig"]
[[commands.field]]
id = "skip_string_normalization"
label = "Keep string quotes"
type = "boolean"
option = ["--skip-string-normalization", "-S"]
sources = ["fig"]
[[commands.field]]
id = "skip_magic_trailing_comma"
label = "Ignore magic trailing comma"
type = "boolean"
option = ["--skip-magic-trailing-comma", "-C"]
sources = ["fig"]
[[commands.field]]
id = "preview"
label = "Preview style"
description = "Enable potentially disruptive style changes."
type = "boolean"
option = ["--preview"]
sources = ["fig"]
[[commands.field]]
id = "pyi"
label = "Treat as stubs (.pyi)"
type = "boolean"
option = ["--pyi"]
sources = ["fig"]
[[commands.field]]
id = "ipynb"
label = "Treat as notebooks"
type = "boolean"
option = ["--ipynb"]
sources = ["fig"]
[[commands.field]]
id = "include"
label = "Include regex"
type = "string"
option = ["--include"]
sources = ["fig"]
[[commands.field]]
id = "exclude"
label = "Exclude regex"
type = "string"
option = ["--exclude"]
sources = ["fig"]
[[commands.field]]
id = "extend_exclude"
label = "Extra exclude regex"
type = "string"
option = ["--extend-exclude"]
sources = ["fig"]
[[commands.field]]
id = "force_exclude"
label = "Force-exclude regex"
description = "Exclude even when passed explicitly."
type = "string"
option = ["--force-exclude"]
sources = ["fig"]
[[commands.field]]
id = "config"
label = "Config file"
type = "path"
option = ["--config"]
path = { kind = "file", role = "input" }
sources = ["fig"]
[[commands.field]]
id = "stdin_filename"
label = "Name for stdin"
type = "string"
option = ["--stdin-filename"]
sources = ["fig"]
[[commands.field]]
id = "workers"
label = "Parallel workers"
type = "integer"
option = ["--workers", "-W"]
sources = ["fig"]
[[commands.field]]
id = "quiet"
label = "Quiet"
type = "boolean"
option = ["--quiet", "-q"]
sources = ["fig"]
[[commands.field]]
id = "verbose"
label = "Verbose"
type = "boolean"
option = ["--verbose", "-v"]
sources = ["fig"]
[[commands.task]]
id = "format"
label = "Format in place"
fields = ["files", "line_length", "target_version", "preview"]
required = ["files"]
[[commands.task]]
id = "check"
label = "Check only"
fields = ["files", "line_length", "check", "diff"]
required = ["files"]
set = { check = [true] }
[[commands.task]]
id = "diff"
label = "Preview changes as diff"
fields = ["files", "diff"]
required = ["files"]
set = { diff = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "line_length", "target_version", "check", "diff", "skip_string_normalization", "preview"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["code", "skip_magic_trailing_comma", "pyi", "ipynb", "include", "exclude", "extend_exclude", "force_exclude", "config", "stdin_filename", "workers", "quiet", "verbose"]