Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

tff logo

tff

Fast, zero-warehouse-cost architectural linter & health dashboard for dbt, SQLMesh & Dataform.

Catch illegal upstream joins, layer violations, and duplicate transformation logic in CI.

PyPI version Downloads Python versions Documentation Status License: MIT

SQL linters check syntax and formatting in individual files, but they do not analyze the transformation graph. tff evaluates transformation models holistically—enforcing layer boundaries, domain contracts, and logic deduplication across the entire data warehouse DAG.

tff catching layer violations and duplicate CTEs

$ tff check

TFF ARCHITECTURE AUDIT
6 models · 4 errors · 4 warnings · 0.05s

STATUS  LOCATION                              RULE               COUPLING
──────────────────────────────────────────────────────────────────────────────
WRN     models/core/layer_violation.sql       duplicate_ctes     algorithm
        * CTE 'cleaned_users' duplicates transformation logic with 3 other models.

ERR     models/core/users.sql                 banselectstar      name
        ! SELECT * is prohibited. Explicitly name your columns to reduce coupling.

ERR     models/core/users.sql                 nomissingowner     metadata
        ! Model owner should always be specified.

WRN     models/marts/finance/finance_stats.sql  duplicate_ctes   algorithm
        * CTE 'cleaned_users' duplicates transformation logic with 3 other models.

ERR     models/marts/marketing/marketing_all_users.sql  layer_integrity  dynamic
        ! marts/marketing depends on sqlmesh_example.finance_stats (marts/finance)

WRN     models/marts/marketing/marketing_all_users.sql  duplicate_ctes   algorithm
        * CTE 'marketing_cleaned_users' duplicates transformation logic.

ERR     models/marts/marketing/marketing_type_violation.sql  join_type_parity  type
        ! Join condition 'o.user_id = u.user_id' compares integer with text (CoT).
──────────────────────────────────────────────────────────────────────────────
FAIL — 4 errors block merge. Run `tff --fix` for auto-correctable rules.

Quickstart (Zero Configuration)

Run tff inside any existing dbt, SQLMesh, or Dataform repository. No configuration file required—tff automatically infers standard layer conventions (staging → intermediate → core → marts) and immediately audits your DAG:

# Instant zero-install invocation via uvx:
uvx --from "tff-core[dbt]" tff check        # for dbt
# uvx --from "tff-core[sqlmesh]" tff check  # for SQLMesh
# uvx --from "tff-core[dataform]" tff check # for Dataform

# Or install for your pipeline framework:
pip install "tff-core[dbt]"        # for dbt (or: uv add "tff-core[dbt]")
# pip install "tff-core[sqlmesh]"  # for SQLMesh
# pip install "tff-core[dataform]" # for Dataform

# Catch layer violations, duplicate CTEs, and circular dependencies
tff check

# Calculate your repository architecture health score (0–100)
tff health

Architecture & Capabilities

Capability Specification & Function
Layer Boundary Integrity Enforces directional DAG constraints (staging → intermediate → core → marts) and blocks unauthorized cross-mart coupling.
Duplicate CTE Detection Identifies identical transformation sub-queries across independent models (Connascence of Algorithm) to drive upstream consolidation.
Model Health Scoring Computes an objective repository health metric (0–100) and gates CI builds via tff health --fail-under 80.
CI/CD Pipeline Governance Official GitHub Action (tjirab/tff@v1) diffs PR changes against base branches, gates merges, and generates inline annotations.
Automated Remediation Rewrites positional ordering clauses and provisions missing metadata scaffolds via tff lint --fix.
Multi-Engine Support Native semantic analysis across dbt, SQLMesh, and Google Cloud Dataform projects without warehouse connection overhead.

Documentation

Complete specifications, configuration guides, and architectural documentation are available at tff.readthedocs.io:


License

Distributed under the MIT License.

About

Guided evolution for data transformation projects

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages