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, and triggers 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
  • ⚙️ 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 ./config.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)

Example config.yml

Pipeline:
  enabled: true
  general_rules:
    min_parts: 3
    description_required: false
  types:
    master:
      naming:
        prefix: "PL_M_"
        case: upper
        separator: "_"
        pattern: "^PL_M_[A-Z0-9_]+$"
    sub:
      naming:
        prefix: "PL_S_"
        case: upper
        separator: "_"
        pattern: "^PL_S_[A-Z0-9_]+$"

Dataset:
  enabled: true
  naming:
    prefix: "DS_"
    case: upper
    separator: "_"
    pattern: "^DS_[A-Z0-9_]+$"
    min_separated_parts: 3
    max_separated_parts: 6
    allowed_formats:
      - PARQ
      - CSV
    allowed_source_abbreviations:
      AzureBlob: ABLB
      ADLS: ADLS

LinkedService:
  enabled: true
  naming:
    prefix: "LS_"
    case: upper
    separator: "_"
    min_separated_parts: 2
    max_separated_parts: 4
    allowed_abbreviations:
      - ABLB
      - ADLS

Trigger:
  enabled: true
  naming:
    prefix: "TR_"
    case: upper
    separator: "_"
    min_separated_parts: 3
    max_separated_parts: 5
    allowed_types:
      - SCH
      - EVT

📊 Output

Terminal output

FactoryLint provides clear, colorized feedback:

❌ dataset/DS_INVALID_NAME.json
   - Dataset 'DS_INVALID_NAME' does not match pattern '^DS_[A-Z0-9_]+$'
✅ pipeline/PL_M_LOAD_CUSTOMERS.json

JSON report

All linting errors are saved to:

.adf-linter/linter_results.json

Example:

{
  "dataset/DS_INVALID_NAME.json": [
    "Dataset 'DS_INVALID_NAME' does not match pattern '^DS_[A-Z0-9_]+$'"
  ]
}

🔁 CI/CD Usage (Azure DevOps example)

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

- script: |
    pip install factorylint
    factorylint lint --config ./config.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.1.9.tar.gz (11.3 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.1.9-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for factorylint-0.1.9.tar.gz
Algorithm Hash digest
SHA256 b6f3243db120eaf1f2ad1c928affef3e73b8d50d5d261fc83e069a4a034a035d
MD5 1b53f1497c13f7250ba6e257645c1581
BLAKE2b-256 7a3d7abe5a3b0f5f44071fad254998877cc6962145f1e33ce0417d1449a7418b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for factorylint-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2bfe7754b3228ae19efc07efff3ee4d4d49c55530c15678147c4d82d829b4ac0
MD5 6bc6b4069bddcff1b4d6e6ed24c31c1a
BLAKE2b-256 3761984d4b65231ee2d11e9f1eade8c0f87abac3b1aefae929a209840fccd93c

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