Skip to content
HALOWERK

Codewerk

ruff

Runs the official statically linked Ruff 0.17.3 release binary (MIT, SHA-256 checked) in isolated mode (no configuration files) in a resource-limited child process without network. Check mode returns diagnostics from Ruff JSON output (Pyflakes F, pycodestyle E/W, isort I, bugbear B, pyupgrade UP and every other selectable Ruff rule) with fix applicability; format mode returns the code formatted like Black. Selectors, ignores, target Python version and line length are configurable; unknown.

POST https://code.halowerk.com/v1/ruff

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
codestringYesPython source (max. 1 MB).
modestringNoLint, format or both.
selectarrayNoRule selectors (default Ruff defaults: E4, E7, E9, F).
ignorearrayNoRule selectors to ignore.
target_versionstringNoMinimum Python version of the code.
line_lengthintegerNoLine length for E501 and the formatter.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000000,
      "description": "Python source (max. 1 MB)."
    },
    "mode": {
      "type": "string",
      "enum": [
        "check",
        "format",
        "both"
      ],
      "default": "both",
      "description": "Lint, format or both."
    },
    "select": {
      "type": "array",
      "maxItems": 60,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^(ALL|[A-Z]{1,4}[0-9]{0,4})$"
      },
      "description": "Rule selectors (default Ruff defaults: E4, E7, E9, F)."
    },
    "ignore": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[A-Z]{1,4}[0-9]{0,4}$"
      },
      "description": "Rule selectors to ignore."
    },
    "target_version": {
      "type": "string",
      "enum": [
        "py37",
        "py38",
        "py39",
        "py310",
        "py311",
        "py312",
        "py313",
        "py314"
      ],
      "default": "py312",
      "description": "Minimum Python version of the code."
    },
    "line_length": {
      "type": "integer",
      "minimum": 40,
      "maximum": 320,
      "default": 88,
      "description": "Line length for E501 and the formatter."
    }
  }
}

Open original schema

Published input example

{
  "code": "import os, sys\n\ndef f(x):\n    if x == None:\n        return undefined_name\n    return sys.argv\n",
  "select": [
    "E",
    "F"
  ]
}

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 โ†’