Skip to main content

A CLI tool to lint Azure Data Factory resources for naming convention compliance

Project description

FactoryLint Logo

🏭 FactoryLint

FactoryLint is a Python CLI tool for linting Azure Data Factory (ADF) resources to ensure they follow consistent, enforceable naming conventions.

It validates pipelines, datasets, linked services, triggers, parameters, and variables using a fully configurable rules file, making it ideal for CI/CD pipelines (Azure DevOps, GitHub Actions) and team-wide governance.


✨ Features

  • ✅ Lint ADF resources:
    • Pipelines
    • Datasets
    • Linked Services
    • Triggers
    • Pipeline & Dataset Parameters
    • Pipeline Variables
  • ⚙️ Fully configurable rules via YAML or JSON
  • 🧠 Automatic ADF resource type detection
  • 📊 Clear, colorized terminal output
  • 💾 Machine-readable JSON report output
  • 🚀 Designed for CI/CD usage
  • 🛠 Simple, predictable CLI interface

📦 Installation

Install from PyPI

pip install factorylint

Local development install

git clone https://github.com/DimaFrank/FactoryLint.git
cd FactoryLint
pip install -e .

🚀 Usage

Initialize project (optional)

Creates the .adf-linter directory used for repo

factorylint init

Lint ADF resources

Run linting against a directory containing ADF resources.

factorylint lint --config ./factorylint.yml --resources .
Option Description
--config Path to rules configuration file (YAML or JSON)
--resources Root directory containing ADF resources
--fail-fast Stop on first error

🗂 Expected Folder Structure

FactoryLint automatically scans these subfolders under --resources:

pipeline/
dataset/
linkedService/
trigger/

Each folder may contain nested subdirectories.

📝 Configuration

The configuration file defines naming and validation rules for each ADF resource type.

Supported formats: YAML (.yml, .yaml) or JSON

The config is validated before linting starts

Invalid configs fail the run immediately (CI-safe)

The default config file name is factorylint.yml.

All rules live under a top-level resources: key. Parameters and variables are configured at the top level.

Naming rules reference

Resource Structure Example
Pipeline PL_<PROJECT>_<ENTITY>_<ACTION> PL_MES_ORDERS_INGEST
Dataset DS_<SOURCE>_<DETAIL...>_<FORMAT> DS_ADLS_CUSTOMERS_PARQUET
Linked Service LS_<ABBR>_<DESCRIPTION...> LS_ADLS_BRONZE
Trigger TR_<TYPE>_<FREQUENCY>_<DESCRIPTION...> TR_SCHEDULE_DAILY_MES_IOT
Parameter p_<name> (lowercase) p_start_date
Variable v_<name> (lowercase) v_row_count

Example factorylint.yml

resources:

  pipelines:
    enabled: true
    naming:
      prefix: "PL_"
      case: "upper"
      separator: "_"
      pattern: "^PL_[A-Z0-9_]+$"
      min_separated_parts: 4
      max_separated_parts: 6
      allowed_actions:
        - INGEST
        - TRANSFORM
        - ORCHESTRATE
        - LOAD
        - COPY
        - EXTRACT
        - PROCESS
      description_required: true
      ignore_folder: "_Config"

  datasets:
    enabled: true
    naming:
      prefix: "DS"
      separator: "_"
      case: "upper"
      pattern: "^[A-Z0-9_]+$"
      required_source_position: 2
      allowed_source_abbreviations:
        "Azure Data Lake Storage Gen2": ADLS
        "Azure SQL Database": ASQL
        "SAP Table": SAPT
        "File System": FILE
      allowed_formats:
        - CSV
        - PARQUET
        - TABLE
        - JSON
        - EXCEL
        - AVRO
        - BIN
        - XML
        - ORC
      min_separated_parts: 4
      max_separated_parts: 8

  linked_services:
    enabled: true
    naming:
      prefix: "LS_"
      case: "upper"
      pattern: "^[A-Z0-9_]+$"
      separator: "_"
      min_separated_parts: 2
      max_separated_parts: 5
      allowed_abbreviations:
        - ADLS
        - ASQL
        - KV
        - ADBR
        - FILE

  triggers:
    enabled: true
    naming:
      prefix: "TR_"
      separator: "_"
      case: "upper"
      pattern: "^[A-Z0-9_]+$"
      min_separated_parts: 4
      max_separated_parts: 7
      allowed_types:
        - SCHEDULE
        - EVENT
      allowed_frequencies:
        - HOURLY
        - DAILY
        - NIGHTLY
        - WEEKLY
        - MONTHLY

parameters:
  enabled: true
  naming:
    prefix: "p_"
    case: "lower"
    pattern: "^[a-z_][a-z0-9_]*$"

variables:
  enabled: true
  naming:
    prefix: "v_"
    case: "lower"
    pattern: "^[a-z_][a-z0-9_]*$"

📊 Output

Terminal output

FactoryLint provides clear, colorized feedback:

❌ pipeline/PL_MES_ORDERS_RUN.json
   - Pipeline 'PL_MES_ORDERS_RUN' has invalid action 'RUN'. Allowed: ['INGEST', 'TRANSFORM', ...]
   - Parameter 'StartDate' must start with prefix 'p_'
✅ pipeline/PL_MES_ORDERS_INGEST.json
✅ dataset/DS_ADLS_CUSTOMERS_PARQUET.json

JSON report

All linting errors are saved to:

.adf-linter/linter_results.json

Example:

{
  "pipeline/PL_MES_ORDERS_RUN.json": [
    "Pipeline 'PL_MES_ORDERS_RUN' has invalid action 'RUN'. Allowed: ['INGEST', 'TRANSFORM', ...]"
  ]
}

🔁 CI/CD Usage (Azure DevOps example)

- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.x'

- script: |
    pip install factorylint
    factorylint lint --config ./factorylint.yml --resources .
  displayName: 'Run FactoryLint'
  • Exit code 1 if errors are found

  • Perfect for gating PRs and enforcing standards

🧠 Design Principles

  • ❌ No hardcoded paths

  • ❌ No assumptions about project layout outside --resources

  • ✅ Fully installable CLI

  • ✅ Deterministic behavior in CI

  • ✅ Clear separation of CLI and core logic

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

factorylint-0.2.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

factorylint-0.2.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file factorylint-0.2.0.tar.gz.

File metadata

  • Download URL: factorylint-0.2.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for factorylint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 46d8d06bcc811b30be1f595474bee8a570814ce4999e5071abe77103e7d00756
MD5 3ed97955674a89771b0221f6f1ab2d2c
BLAKE2b-256 3a385d4fa4bc4cffd633e4d78866e2f88785acd7832ff020b1c7110f883d14ab

See more details on using hashes here.

File details

Details for the file factorylint-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: factorylint-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for factorylint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60554fc3375df332bdfb64b7901bb78a678dc7f8c503aaa50fd2aa5a62709527
MD5 8cf82123edbe18ef8901cd3e885e9085
BLAKE2b-256 e1f1d03c692a1ce78de1c8acf5f19027d76b7eacb83da8e380dbb55551c2e146

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page