Skip to content

odcslint

Lint your data contracts against the standard and your own rules.

odcslint is a linter for Open Data Contract Standard (ODCS) contracts, written in Rust. It checks every contract against the official schema and against the conventions your team agrees on. Where it can, it fixes problems for you and leaves your formatting alone.

Get started Browse the rules

What it checks

  • Schema validation


    Each contract is validated against the official ODCS JSON Schema for its apiVersion (see the supported versions). The schemas ship inside the binary, so nothing is downloaded, and every error points at a line and column.

    payments.odcs.yaml
      6:1  error    schema  unexpected property `owner`
      9:9  error    schema  logicalType: `binary` is not one of: string, date, ...
    

    Schema validation

  • Your own rules


    Rules turn team conventions into checks: approved owners, known domains, column order, naming, and required descriptions and tags. There are 11 rules to choose from, and you enable them in odcslint.yml.

    - type: allowed_values
      field: team.members.username
      role: owner
      values: [alice, bob]
    

    All rules

Autofix

odcslint check --fix repairs fixable findings in place. Instead of rewriting the file, it moves the original text, so comments, block scalars and blank lines stay where you put them.

     properties:
-      # Load metadata, added by the ingestion framework.
-      - name: _loaded_at
       - name: order_id
         primaryKey: true
         primaryKeyPosition: 1
       - name: amount
+      # Load metadata, added by the ingestion framework.
+      - name: _loaded_at

How autofix works

Example output

$ odcslint check contracts/
contracts/orders.odcs.yaml
  13:17  error    approved_owners  team member username `mallory` is not allowed; allowed values: alice, bob
  20:9   error    property_order   expected `order_id` at position 1 of `orders`, found `_loaded_at` [*]
  40:13  error    property_order   expected `street` at position 1 of `shipping_address`, found `_source_hash` [*]

contracts/payments.odcs.yaml
  6:1  error    schema  unexpected property `owner`

Found 4 errors and 0 warnings (2 files checked). 2 findings marked [*] can be fixed with `odcslint check --fix`.

Speed, output and integrations

  • Fast


    10,000 contracts take 0.4 s. Files are checked in parallel, and each schema is compiled only once.

    Performance

  • Precise


    Every finding has a line and column. Messages stay short and never print whole objects from your contract.

  • Runs everywhere


    The same binary works on the command line, as a prek hook and as a GitHub Action that annotates pull requests.

  • Machine-readable


    Output comes as text, json, ndjson, csv or github, and the exit codes are documented.

    Usage

Quick start

  1. Install odcslint:

    pip install odcslint
    
    brew install feliblo/tap/odcslint
    
  2. Check every *.odcs.yaml below the current directory against the ODCS schema:

    odcslint check
    
  3. Write a starter odcslint.yml, then enable and tune the rules you want:

    odcslint init
    
  4. Fix what can be fixed:

    odcslint check --fix