Skip to content
HALOWERK

Codewerk

code format

Runs prettier 3.9.10 with the chosen options and returns the formatted text plus whether anything changed. SQL is formatted with sql-formatter 15.9.0 for the selected dialect. Python (black), Go (gofmt) and Rust (rustfmt) are NOT available: these formatters are native tools that are not installed, so such requests are rejected with a hint instead of being imitated. Syntax errors are reported with line and column. No configuration files or plugins are loaded.

POST https://code.halowerk.com/v1/code-format

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
codestringYesSource text to format.
languagestringYesLanguage of the code; python/go/rust are rejected (formatter not available).
print_widthintegerNo
tab_widthintegerNo
use_tabsbooleanNo
semibooleanNoJS/TS: print semicolons.
single_quotebooleanNoJS/TS/CSS: prefer single quotes.
trailing_commastringNo
prose_wrapstringNoMarkdown: wrap prose.
sql_dialectstringNoSQL only: dialect for sql-formatter.
keyword_casestringNoSQL only: keyword case.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "code",
    "language"
  ],
  "properties": {
    "code": {
      "type": "string",
      "maxLength": 500000,
      "description": "Source text to format."
    },
    "language": {
      "type": "string",
      "enum": [
        "javascript",
        "jsx",
        "typescript",
        "tsx",
        "flow",
        "json",
        "json5",
        "jsonc",
        "css",
        "scss",
        "less",
        "html",
        "vue",
        "angular",
        "handlebars",
        "markdown",
        "mdx",
        "yaml",
        "graphql",
        "sql",
        "python",
        "go",
        "rust"
      ],
      "description": "Language of the code; python/go/rust are rejected (formatter not available)."
    },
    "print_width": {
      "type": "integer",
      "minimum": 40,
      "maximum": 200,
      "default": 80
    },
    "tab_width": {
      "type": "integer",
      "minimum": 1,
      "maximum": 8,
      "default": 2
    },
    "use_tabs": {
      "type": "boolean",
      "default": false
    },
    "semi": {
      "type": "boolean",
      "default": true,
      "description": "JS/TS: print semicolons."
    },
    "single_quote": {
      "type": "boolean",
      "default": false,
      "description": "JS/TS/CSS: prefer single quotes."
    },
    "trailing_comma": {
      "type": "string",
      "enum": [
        "all",
        "es5",
        "none"
      ],
      "default": "all"
    },
    "prose_wrap": {
      "type": "string",
      "enum": [
        "always",
        "never",
        "preserve"
      ],
      "default": "preserve",
      "description": "Markdown: wrap prose."
    },
    "sql_dialect": {
      "type": "string",
      "enum": [
        "sql",
        "mysql",
        "mariadb",
        "postgresql",
        "bigquery",
        "snowflake",
        "duckdb",
        "sqlite",
        "tsql",
        "redshift",
        "trino",
        "spark",
        "db2",
        "plsql"
      ],
      "default": "sql",
      "description": "SQL only: dialect for sql-formatter."
    },
    "keyword_case": {
      "type": "string",
      "enum": [
        "preserve",
        "upper",
        "lower"
      ],
      "default": "preserve",
      "description": "SQL only: keyword case."
    }
  }
}

Open original schema

Published input example

{
  "language": "typescript",
  "code": "interface A{a:string;b?:number}\nconst x:A={a:\"1\"}"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’