{"id":51187774,"url":"https://github.com/tjirab/tff","last_synced_at":"2026-06-27T12:00:50.458Z","repository":{"id":367022697,"uuid":"1278893149","full_name":"tjirab/tff","owner":"tjirab","description":"Fitness functions for your data transformation project","archived":false,"fork":false,"pushed_at":"2026-06-27T10:50:39.000Z","size":188,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-27T11:11:43.253Z","etag":null,"topics":["architecture","connascence","dbt","fitness-functions","sqlmesh"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tjirab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-24T07:28:39.000Z","updated_at":"2026-06-27T10:50:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tjirab/tff","commit_stats":null,"previous_names":["tjirab/sqlmesh-ff","tjirab/tff"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tjirab/tff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjirab%2Ftff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjirab%2Ftff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjirab%2Ftff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjirab%2Ftff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjirab","download_url":"https://codeload.github.com/tjirab/tff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjirab%2Ftff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34852282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","connascence","dbt","fitness-functions","sqlmesh"],"created_at":"2026-06-27T12:00:48.227Z","updated_at":"2026-06-27T12:00:50.453Z","avatar_url":"https://github.com/tjirab.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# TFF: Transformation Fitness Functions\n\n[![PyPI version](https://img.shields.io/pypi/v/tff-core.svg)](https://pypi.org/project/tff-core/)\n[![Python versions](https://img.shields.io/pypi/pyversions/tff-core.svg)](https://pypi.org/project/tff-core/)\n\nConfigurable fitness functions engine and linter for transformation projects. \n\nTFF allows you to enforce architectural layout boundaries, layer structure policies, schema contracts, and code formatting rules across data pipelines. It ships with dedicated plugins for **SQLMesh** and **dbt** and outputs clean, color-coded lint reports to the terminal.\n\u003cimg width=\"1029\" height=\"828\" alt=\"Screenshot 2026-06-27 at 13 22 08\" src=\"https://github.com/user-attachments/assets/77c8896f-b626-481e-90f1-b88fe8036448\" /\u003e\n\n---\n\n## Documentation\n\nSetup and usage details differ depending on your pipeline engine. Refer to the corresponding guide:\n\n* 📐 **SQLMesh Integration**: See [docs/sqlmesh.md](docs/sqlmesh.md)\n* ⚡ **dbt Integration**: See [docs/dbt.md](docs/dbt.md)\n* 🏗️ **Architecture \u0026 Contributor Guide**: See [docs/contributing.md](docs/contributing.md)\n\n---\n\n## Quick Installation\n\nInstall the adapter matching your pipeline tool:\n\n### 📐 For SQLMesh projects:\n```bash\n# With uv:\nuv add tff-sqlmesh\n\n# Or pip:\npip install tff-sqlmesh\n```\n\n### ⚡ For dbt projects:\n```bash\n# With uv:\nuv add tff-dbt\n\n# Or pip:\npip install tff-dbt\n```\n\n---\n\n## Core Features\n\nTFF runs two categories of quality guardrails:\n\n### 1. Architectural Checks\n* **Layer integrity**: Prevent models in upstream layers (e.g. `marts`) from depending on downstream/raw layers.\n* **Custom exclusions**: Enforce custom domain isolation boundaries (e.g., prevent `marts/finance` from depending on `marts/marketing`).\n* **Schema contracts**: Ensure matching structures between model schemas (e.g., source tables and target core columns).\n* **Dependency graph**: Track DAG metrics and fail if model fan-in or fan-out exceeds defined thresholds.\n\n### 2. Linter Rules\n* **No SELECT ***: Require explicit columns to reduce upstream coupling.\n* **No positional GROUP BY/ORDER BY**: Prevent using ordinal indexes (e.g., `GROUP BY 1, 2`) in queries.\n* **Classification macros**: Require using standardized macros instead of inline CASE statements for classification fields.\n* **Sql complexity**: Limits CTE count, join count, decision points, and line count in SQL.\n* **Mart naming**: Ensure model filenames match their subfolder namespaces.\n* **Metadata checks**: Enforce owners, descriptions, grains, unique assertions, and non-null constraints on models.\n* **Filename equals model name**: Flags model name mismatch.\n\n---\n\n## Shared Configuration\n\nAll adapters use a shared `fitness_functions.yaml` config file located in the root of your project:\n\n```yaml\ncontract_groups_path: linter_contract_groups.json\nexclusions_path: linter_exclusions.json\n\nlayers:\n  order: [staging, core, marts]  # Configured bottom-to-top hierarchy\n\nchecks:\n  layer_integrity: { enabled: true }\n  custom_exclusions: { enabled: true }\n  schema_contracts: { enabled: true }\n  dependency_graph:\n    enabled: true\n    fan_out_warn: 15\n    fan_out_fail: 25\n    fan_in_warn: 10\n\nrules:\n  no_select_star:\n    enabled: true\n  no_positional_group_by_or_order_by:\n    enabled: true\n  classification_macros:\n    enabled: true\n    skip_layers: [staging]\n    columns:\n      product_type: \"@product_type\\\\b\"\n  sql_complexity:\n    enabled: true\n    thresholds:\n      decision_points: [15, 25]\n      cte_count: [8, 12]\n      join_count: [8, 12]\n      line_count: [250, 400]\n  mart_naming:\n    enabled: true\n    layer_name: marts\n    rule: prefix_with_subdirectory\n  column_names:\n    enabled: true\n    replacements:\n      api_request: api_call\n  column_types:\n    enabled: true\n    rules:\n      - name: id_is_text\n        pattern: \"_id$\"\n        data_type: text\n  metadata:\n    owner: true\n    description: true\n    grain: true\n    unique_values: true\n    not_null: true\n  filename_equals_modelname:\n    enabled: true\n```\n\n---\n\n## Further Reading \u0026 Learning Resources\n\nTo learn more about the architectural concepts behind fitness functions and connascence, check out these resources:\n\n* [Connascence.io](https://connascence.io/) — A guide to software coupling metrics (connascence of name, type, meaning, algorithm, etc.), which inspired the classification and structure of the linter report findings.\n* [Evolutionary Architecture](https://evolutionaryarchitecture.com/) — The homepage for *Building Evolutionary Architectures*, which introduces the concept of architectural fitness functions to guide design changes over time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjirab%2Ftff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjirab%2Ftff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjirab%2Ftff/lists"}