{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/air/latest.json",
  "title": "TomlOptions",
  "description": "Configuration for Air",
  "x-lintel": {
    "source": "https://github.com/posit-dev/air/releases/latest/download/air.schema.json",
    "sourceSha256": "b6c28a75922045756807c1e1337880ac7cb5f9e84140764086393df100ee7543",
    "fileMatch": [
      "air.toml",
      ".air.toml"
    ],
    "parsers": [
      "toml"
    ]
  },
  "type": "object",
  "properties": {
    "format": {
      "anyOf": [
        {
          "$ref": "#/$defs/FormatTomlOptions"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "FormatTomlOptions": {
      "description": "Options to configure code formatting.",
      "type": "object",
      "properties": {
        "default-exclude": {
          "title": "Whether or not to use default exclude patterns",
          "description": "Air automatically excludes a default set of folders and files. If this option is\n set to `false`, these files will be formatted as well.\n\n The 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"
          ]
        },
        "default-table": {
          "title": "Whether or not to use defaults for `table`",
          "description": "Air automatically formats a default set of calls as tables. You can\n disable these defaults by setting this option to `false`. The default\n set currently includes:\n\n - `tribble()` from tibble\n - `fcase()` from data.table",
          "type": [
            "boolean",
            "null"
          ]
        },
        "exclude": {
          "title": "Patterns to exclude from formatting",
          "description": "By default, Air will refuse to format files matched by patterns listed in\n `default-exclude`. Use this option to supply an additional list of exclude\n patterns.\n\n Exclude patterns are modeled after what you can provide in a\n [.gitignore](https://git-scm.com/docs/gitignore), and are resolved relative to the\n parent directory that your `air.toml` is contained within. For example, if your\n `air.toml` was located at `root/air.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\n See the full [.gitignore](https://git-scm.com/docs/gitignore) documentation for\n all of the patterns you can provide.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "indent-style": {
          "title": "Whether to use spaces or tabs for indentation",
          "description": "`indent-style = \"space\"` (default):\n\n ```r\n fn <- function() {\n   # Spaces indent `cat()`\n   cat(\"Hello\")\n }\n ```\n\n `indent-style = \"tab\"`:\n\n ```r\n fn <- function() {\n   # A tab `\\t` indents `cat()`\n   cat(\"Hello\")\n }\n ```\n\n Air defaults to spaces due to the overwhelming amount of existing R code written\n in this style, but consider using tabs for new projects to improve accessibility.\n\n See `indent-width` to configure the number of spaces per indentation and the tab\n width.",
          "anyOf": [
            {
              "$ref": "#/$defs/IndentStyle"
            },
            {
              "type": "null"
            }
          ]
        },
        "indent-width": {
          "title": "The number of spaces per indentation level",
          "description": "The value must be greater than or equal to `1` and less than or equal to `24`. The\n default value is `2`.\n\n Used by the formatter to determine the visual width of a tab.\n\n This option changes the number of spaces the formatter inserts when using\n `indent-style = \"space\"`. It also represents the width of a tab when `indent-style\n = \"tab\"` for the purposes of computing the `line-width`.",
          "anyOf": [
            {
              "$ref": "#/$defs/IndentWidth"
            },
            {
              "type": "null"
            }
          ]
        },
        "line-ending": {
          "title": "The character used at the end of a line",
          "description": "- `auto`: The newline style is detected automatically on a file per file basis.\n   Files with mixed line endings will be converted to the first detected line\n   ending. Defaults to `\\n` for files that contain no line endings.\n\n - `lf`: Line endings will be converted to `\\n`. The default line ending on Unix.\n\n - `crlf`: Line endings will be converted to `\\r\\n`. The default line ending on\n   Windows.\n\n - `native`: Line endings will be converted to `\\n` on Unix and `\\r\\n` on Windows.",
          "anyOf": [
            {
              "$ref": "#/$defs/LineEnding"
            },
            {
              "type": "null"
            }
          ]
        },
        "line-width": {
          "title": "The line width at which the formatter prefers to wrap lines",
          "description": "The value must be greater than or equal to `1` and less than or equal to `320`.\n\n While the formatter will attempt to format lines such that they remain within the\n `line-width`, it isn't a hard upper bound, and formatted lines may exceed the\n `line-width`.",
          "anyOf": [
            {
              "$ref": "#/$defs/LineWidth"
            },
            {
              "type": "null"
            }
          ]
        },
        "persistent-line-breaks": {
          "title": "Whether or not to respect persistent line breaks",
          "description": "Air respects a small set of persistent line breaks as an indication that certain\n function calls or function signatures should be left expanded. If this option\n is set to `false`, persistent line breaks are ignored.\n\n It may be preferable to ignore persistent line breaks if you prefer that `line-width`\n should be the only value that influences line breaks.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "skip": {
          "title": "Function calls to skip formatting for",
          "description": "Air typically formats every function call it comes across. To skip formatting of\n a single one-off function call, you can use a `# fmt: skip` comment. However, if\n you know of particular functions that you use a lot that are part of a custom\n domain specific language that doesn't follow conventional formatting rules, you\n can entirely opt out of formatting for those functions by providing them here.\n\n For example, using `skip = [\"graph_from_literal\"]` would automatically skip\n formatting of:\n\n ```r\n igraph::graph_from_literal(Alice +--+ Bob)\n ```",
          "anyOf": [
            {
              "$ref": "#/$defs/Skip"
            },
            {
              "type": "null"
            }
          ]
        },
        "table": {
          "title": "Function calls to format as tables",
          "description": "Some function calls are meant to be formatted as tables, rather than being\n formatted in a flat or expanded layout. For a single one-off function call,\n you can use a `# fmt: table` comment to request a table layout. For function\n calls that you use a lot, use this setting to add them to a list of function\n calls that are automatically formatted as tables without requiring a\n `# fmt: table` comment.\n\n For example, using `table = [\"my_table\"]` would automatically format calls\n to `my_table()` in a table layout.\n\n See `default-table` for the list of function calls that are automatically\n formatted as tables by default.",
          "anyOf": [
            {
              "$ref": "#/$defs/Table"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "IndentStyle": {
      "oneOf": [
        {
          "title": "Indent with tabs",
          "type": "string",
          "const": "tab"
        },
        {
          "title": "Indent with spaces",
          "type": "string",
          "const": "space"
        }
      ]
    },
    "IndentWidth": {
      "type": "integer",
      "format": "uint8",
      "maximum": 24,
      "minimum": 1
    },
    "LineEnding": {
      "oneOf": [
        {
          "description": "The newline style is detected automatically on a file per file basis. Files with\n mixed line endings will be converted to the first detected line ending. Defaults\n to `\\n` for a files that contain no line endings.",
          "type": "string",
          "const": "auto"
        },
        {
          "description": "Line endings will be converted to `\\n` as is common on Unix.",
          "type": "string",
          "const": "lf"
        },
        {
          "description": "Line endings will be converted to `\\r\\n` as is common on Windows.",
          "type": "string",
          "const": "crlf"
        },
        {
          "description": "Line endings will be converted to `\\n` on Unix and `\\r\\n` on Windows.",
          "type": "string",
          "const": "native"
        }
      ]
    },
    "LineWidth": {
      "type": "integer",
      "format": "uint16",
      "maximum": 320,
      "minimum": 1
    },
    "Skip": {
      "$ref": "#/$defs/SortedStrings"
    },
    "SortedStrings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "Table": {
      "$ref": "#/$defs/SortedStrings"
    }
  }
}
