id = "rubocop"
name = "RuboCop"
homepage = "https://rubocop.org"
description = "RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter."
icon = "SimpleIcons:rubocop"
executables = ["rubocop"]
[dotfiles]
paths = [
"~/.rubocop.yml",
"[configHome]/rubocop/config.yml",
]
exclude = [
"[xdgCache]/rubocop_cache/",
"[xdgCache]/*/rubocop_cache/",
]
secret = []
side_effect = false
[commands]
format = 1
label = "Inspect Ruby code"
description = "Inspect files with RuboCop, optionally autocorrecting."
quality = "ai-draft"
base = "fig:rubocop"
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/rubocop.ts"
license = "MIT"
[[commands.field]]
id = "files"
label = "Files or directories"
type = "path"
position = 0
multiple = true
path = { kind = "any", role = "input" }
sources = ["fig"]
[[commands.field]]
id = "autocorrect"
label = "Autocorrect (safe)"
type = "boolean"
option = ["--autocorrect", "-a"]
effect = "overwrite"
sources = ["fig"]
[[commands.field]]
id = "autocorrect_all"
label = "Autocorrect (safe and unsafe)"
type = "boolean"
option = ["--autocorrect-all", "-A"]
effect = "overwrite"
sources = ["fig"]
[[commands.field]]
id = "lint"
label = "Lint cops only"
type = "boolean"
option = ["--lint", "-l"]
sources = ["fig"]
[[commands.field]]
id = "only"
label = "Only these cops"
type = "string"
option = ["--only"]
multiple = true
sources = ["fig"]
[[commands.field]]
id = "except"
label = "Exclude these cops"
type = "string"
option = ["--except"]
multiple = true
sources = ["fig"]
[[commands.field]]
id = "format"
label = "Output formatter"
type = "string"
option = ["--format", "-f"]
sources = ["fig"]
[[commands.field]]
id = "config"
label = "Config file"
type = "path"
option = ["--config", "-c"]
path = { kind = "file", role = "input" }
sources = ["fig"]
[[commands.field]]
id = "fail_level"
label = "Fail level"
type = "string"
option = ["--fail-level"]
suggestions = [{ value = "A", label = "A" }, { value = "I", label = "I" }, { value = "R", label = "R" }, { value = "C", label = "C" }, { value = "W", label = "W" }, { value = "E", label = "E" }, { value = "F", label = "F" }]
sources = ["fig"]
[[commands.field]]
id = "fail_fast"
label = "Fail fast"
type = "boolean"
option = ["--fail-fast", "-F"]
sources = ["fig"]
[[commands.field]]
id = "list_target_files"
label = "List target files only"
type = "boolean"
option = ["--list-target-files", "-L"]
sources = ["fig"]
[[commands.field]]
id = "force_exclusion"
label = "Force configured exclusions"
type = "boolean"
option = ["--force-exclusion"]
sources = ["fig"]
[[commands.task]]
id = "inspect"
label = "Inspect"
fields = ["files", "only", "except", "format", "config", "fail_level"]
[[commands.task]]
id = "fix_safe"
label = "Autocorrect safely"
fields = ["files", "autocorrect"]
required = ["autocorrect"]
set = { autocorrect = [true] }
[[commands.task]]
id = "list"
label = "List files RuboCop would inspect"
fields = ["files", "list_target_files"]
required = ["list_target_files"]
set = { list_target_files = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "autocorrect", "autocorrect_all", "lint", "only", "except"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["format", "config", "fail_level", "fail_fast", "list_target_files", "force_exclusion"]