{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/jarl/latest.json",
  "title": "TomlOptions",
  "x-lintel": {
    "source": "https://github.com/etiennebacher/jarl/releases/latest/download/jarl.schema.json",
    "sourceSha256": "cc2b1c792c1f91c8af329cf633ad678a3fa7fc4f4572bffd13318359bdfae04b",
    "fileMatch": [
      "jarl.toml"
    ],
    "parsers": [
      "toml"
    ]
  },
  "type": "object",
  "properties": {
    "lint": {
      "anyOf": [
        {
          "$ref": "#/$defs/LinterTomlOptions"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AssignmentConfig": {
      "description": "Accepts either the legacy top-level string (`assignment = \"<-\"`) or the new\ntable form (`[lint.assignment]` with an `operator` field).\n\nTOML doesn't allow a key to be both a string and a table, but by trying the\ntable form first we can surface clear errors (like \"unknown field\") while\nstill falling back to the legacy string form.",
      "oneOf": [
        {
          "description": "Legacy: `assignment = \"<-\"` (deprecated)",
          "type": "object",
          "properties": {
            "Legacy": {
              "type": "string"
            }
          },
          "required": [
            "Legacy"
          ],
          "additionalProperties": false
        },
        {
          "description": "New: `[lint.assignment]` table with fields",
          "type": "object",
          "properties": {
            "Options": {
              "$ref": "#/$defs/AssignmentOptions"
            }
          },
          "required": [
            "Options"
          ],
          "additionalProperties": false
        }
      ]
    },
    "AssignmentOptions": {
      "description": "TOML options for `[lint.assignment]`.\n\nUse `operator` to specify which assignment operator to enforce.\nValid values are `\"<-\"` (the default) and `\"=\"`.",
      "type": "object",
      "properties": {
        "operator": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "DuplicatedArgumentsOptions": {
      "description": "TOML options for `[lint.duplicated_arguments]`.\n\nUse `skipped-functions` to fully replace the default list of functions\nthat are allowed to have duplicated arguments. Use\n`extend-skipped-functions` to add to the default list.\nSpecifying both is an error.",
      "type": "object",
      "properties": {
        "extend-skipped-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "skipped-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "ImplicitAssignmentOptions": {
      "description": "TOML options for `[lint.implicit_assignment]`.\n\nUse `skipped-functions` to fully replace the default list of functions\nwhere implicit assignments are allowed. Use\n`extend-skipped-functions` to add to the default list.\nSpecifying both is an error.",
      "type": "object",
      "properties": {
        "extend-skipped-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "skipped-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "LinterTomlOptions": {
      "type": "object",
      "properties": {
        "assignment": {
          "title": "Assignment operator to use",
          "description": "Accepts either the legacy form `assignment = \"<-\"` (deprecated) or the\nnew table form `[lint.assignment]` with an `operator` field.",
          "anyOf": [
            {
              "$ref": "#/$defs/AssignmentConfig"
            },
            {
              "type": "null"
            }
          ]
        },
        "check-roxygen": {
          "title": "Whether to lint R code in roxygen `@examples` and `@examplesIf` sections",
          "description": "When enabled, Jarl parses and checks R code found in roxygen2\n`@examples` and `@examplesIf` documentation sections. Only applies to\nfiles inside an R package (i.e. in the `R/` directory with a\n`DESCRIPTION` file in the parent).\n\nDefaults to `true`.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "default-exclude": {
          "title": "Whether or not to use default exclude patterns",
          "description": "Jarl automatically excludes a default set of folders and files. If this option is\nset to `false`, these files will be formatted as well.\n\nThe default set of excluded patterns are:\n- `.git/`\n- `renv/`\n- `revdep/`\n- `cpp11.R`\n- `RcppExports.R`\n- `extendr-wrappers.R`\n- `import-standalone-*.R`",
          "type": [
            "boolean",
            "null"
          ]
        },
        "duplicated_arguments": {
          "title": "Options for the `duplicated_arguments` rule",
          "description": "Use `skipped-functions` to fully replace the default list of functions\nthat are allowed to have duplicated arguments. Use\n`extend-skipped-functions` to add to the default list.\nSpecifying both is an error.",
          "anyOf": [
            {
              "$ref": "#/$defs/DuplicatedArgumentsOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "exclude": {
          "title": "Patterns to exclude from checking",
          "description": "By default, jarl will refuse to check files matched by patterns listed in\n`default-exclude`. Use this option to supply an additional list of exclude\npatterns.\n\nExclude patterns are modeled after what you can provide in a\n[.gitignore](https://git-scm.com/docs/gitignore), and are resolved relative to the\nparent directory that your `jarl.toml` is contained within. For example, if your\n`jarl.toml` was located at `root/jarl.toml`, then:\n\n- `file.R` excludes a file named `file.R` located anywhere below `root/`. This is\n  equivalent to `**/file.R`.\n\n- `folder/` excludes a directory named `folder` (and all of its children) located\n  anywhere below `root/`. You can also just use `folder`, but this would\n  technically also match a file named `folder`, so the trailing slash is preferred\n  when targeting directories. This is equivalent to `**/folder/`.\n\n- `/file.R` excludes a file named `file.R` located at `root/file.R`.\n\n- `/folder/` excludes a directory named `folder` (and all of its children) located\n  at `root/folder/`.\n\n- `file-*.R` excludes R files named like `file-this.R` and `file-that.R` located\n  anywhere below `root/`.\n\n- `folder/*.R` excludes all R files located at `root/folder/`. Note that R files\n  in directories under `folder/` are not excluded in this case (such as\n  `root/folder/subfolder/file.R`).\n\n- `folder/**/*.R` excludes all R files located anywhere below `root/folder/`.\n\n- `**/folder/*.R` excludes all R files located directly inside a `folder/`\n  directory, where the `folder/` directory itself can appear anywhere.\n\nSee the full [.gitignore](https://git-scm.com/docs/gitignore) documentation for\nall of the patterns you can provide.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "extend-select": {
          "title": "Additional rules to select",
          "description": "This is a list of rule names to add on top of the existing selection.\nThis is useful in the case where you want to use the default set of\nrules *and* some additional opt-in rules. In this scenario, you only\nneed to add `extend-select = [\"OPT_IN_RULE\"]` instead of writing all\ndefault rule names.\n\nThis has the same constraints as `select`.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "fix-roxygen": {
          "title": "Whether to apply autofixes to roxygen examples",
          "description": "When enabled, Jarl will attempt to apply fixes to R code inside\nroxygen2 `@examples` and `@examplesIf` sections. Since Air does not\ncurrently support formatting roxygen examples, this is opt-in.\n\nDefaults to `false`.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "fixable": {
          "title": "Rule violations to always fix",
          "description": "A list of rules for which violations will be fixed if possible. By\ndefault, all rules are considered fixable.\nThis only matters if you pass `--fix` in the CLI.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "ignore": {
          "title": "Rules to ignore",
          "description": "If this is empty, then no rules are excluded. This field has higher\nimportance than `select`, so if a rule name appears by mistake in both\n`select` and `ignore`, it is ignored.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "implicit_assignment": {
          "title": "Options for the `implicit_assignment` rule",
          "description": "Use `skipped-functions` to fully replace the default list of functions\nthat are allowed to contain implicit assignment. Use\n`extend-skipped-functions` to add to the default list.\nSpecifying both is an error.",
          "anyOf": [
            {
              "$ref": "#/$defs/ImplicitAssignmentOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "include": {
          "title": "Patterns to include in checking",
          "description": "By default, jarl checks all files with a `.R`, `.qmd`, `.Rmd`, or `.rmd`\nextension discovered in the provided paths. Use this option to restrict\nchecking to files that match at least one of the supplied patterns. An\nempty list or a missing option means no restriction, i.e. all discovered\nfiles are checked.\n\nInclude patterns follow the same format as `exclude` patterns (gitignore\nstyle, resolved relative to the `jarl.toml` directory). For example:\n\n- `R/` only checks files inside the `R/` directory.\n\n- `test-*.R` only checks files whose name matches `test-*.R`.\n\n- `**/*.{Rmd,qmd}` only checks Rmd and qmd files.\n\nWhen both `include` and `exclude` are specified, a file is checked only\nif it matches at least one `include` pattern and does not match any\n`exclude` pattern.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "select": {
          "title": "Rules to select",
          "description": "If this is empty, then all rules that are provided by `jarl` are used,\nwith one limitation related to the minimum R version used in the project.\nBy default, if this minimum R version is unknown, then all rules that\nhave a version restriction are deactivated. This is for example the case\nof `grepv` since the eponymous function was introduced in R 4.5.0.\n\nThere are three ways to inform `jarl` about the minimum version used in\nthe project:\n1. pass the argument `--min-r-version` in the CLI, e.g.,\n   `jarl --min-r-version 4.3`;\n2. if the project is an R package, then `jarl` looks for mentions of a\n   minimum R version in the `Depends` field sometimes present in the\n   `DESCRIPTION` file.\n3. specify `min-r-version` in `jarl.toml`.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "undesirable_function": {
          "title": "Options for the `undesirable_function` rule",
          "description": "Use `functions` to fully replace the default list of undesirable functions.\nUse `extend-functions` to add to the default list.\nSpecifying both is an error.",
          "anyOf": [
            {
              "$ref": "#/$defs/UndesirableFunctionOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "unfixable": {
          "title": "Rule violations to never fix",
          "description": "A list of rules that are never fixed. This only matters if you pass\n`--fix` in the CLI.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "unreachable_code": {
          "title": "Options for the `unreachable_code` rule",
          "description": "Use `stopping-functions` to fully replace the default list of functions\nthat are considered to stop execution (never return). Use\n`extend-stopping-functions` to add to the default list.\nSpecifying both is an error.",
          "anyOf": [
            {
              "$ref": "#/$defs/UnreachableCodeOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "unused_function": {
          "title": "Options for the `unused_function` rule",
          "description": "Use `threshold-ignore` to control how many `unused_function`\nviolations are allowed before they are all hidden (likely false\npositives).\n\nUse `skipped-functions` to determine which functions won't be reported\neven if Jarl considers them unused.",
          "anyOf": [
            {
              "$ref": "#/$defs/UnusedFunctionOptions"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "UndesirableFunctionOptions": {
      "description": "TOML options for `[lint.undesirable_function]`.\n\nUse `functions` to fully replace the default list of undesirable functions.\nUse `extend-functions` to add to the default list.\nSpecifying both is an error.",
      "type": "object",
      "properties": {
        "extend-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "UnreachableCodeOptions": {
      "description": "TOML options for `[lint.unreachable_code]`.\n\nUse `stopping-functions` to fully replace the default list of functions\nthat are considered to stop execution (never return). Use\n`extend-stopping-functions` to add to the default list.\nSpecifying both is an error.",
      "type": "object",
      "properties": {
        "extend-stopping-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "stopping-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "UnusedFunctionOptions": {
      "description": "TOML options for `[lint.unused_function]`.\n\nUse `threshold-ignore` to control when `unused_function`\ndiagnostics are hidden. When the number of violations exceeds this\nthreshold, they are suppressed with an informative note (likely false\npositives).\n\nUse `skipped-functions` to provide a list of regex patterns for\nfunctions that should be skipped by this rule.",
      "type": "object",
      "properties": {
        "skipped-functions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "threshold-ignore": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  }
}
