Metadata-Version: 2.4
Name: factorylint
Version: 0.1.5
Summary: A CLI tool to lint Azure Data Factory resources for naming convention compliance
Author-email: Dima Frank <dimafrank91@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Dima Frank
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Dynamic: license-file

<p align="left">
  <img src="https://raw.githubusercontent.com/DimaFrank/FactoryLint/master/logo.png" alt="FactoryLint Logo" width="700"/>
</p>

# 🏭 FactoryLint

**FactoryLint** is a CLI tool to **lint your Azure Data Factory (ADF) resources** and ensure they follow consistent naming conventions. It checks **pipelines, datasets, linked services, and triggers**, and generates clear, visual reports.

---

## ✨ Features

- ✅ Lint ADF resources: **Pipeline, Dataset, Linked Service, Trigger**
- ⚙️ Fully **customizable rules** via `rules_config.json`
- 📊 **Visual error reports** in the terminal
- 💾 Saves **JSON reports** for further inspection
- 🛠 Easy CLI usage

---

## 📦 Installation

Install FactoryLint via `pip`:

```bash
pip install factorylint
```

Or install locally for development:

```bash
git clone <repo-url>
cd FactoryLint
pip install -e .
```

## 🚀 Usage
Initialize FactoryLint

Create the .adf-linter directory:
```bash
factorylint init
```
You’ll see a friendly welcome message and confirmation that the directory was created. 

## Lint ADF resources
Lint all ADF resources in a folder, using the default or custom configuration:
```bash
factorylint lint --resources /path/to/adf/resources
```
Specify a custom rules configuration:
```bash
factorylint lint --resources /path/to/adf/resources --config /path/to/rules_config.json
```


## 📝 Configuration
The **rules_config.json** file defines naming conventions for your ADF resources. You can edit this file to match your project standards. FactoryLint validates this file before linting.

Example structure:
```json
{
  "Pipeline": {
    "patterns": {
      "master": "^Master_.*$",
      "sub": "^Sub_.*$"
    }
  },
  "Dataset": {
    "prefix": "DS_",
    "formats": { "Parquet": "PARQ", "CSV": "CSV" },
    "allowed_chars": "^[A-Z0-9_]+$",
    "allowed_abbreviations": [
      { "Type": "Azure", "Service": "Blob Storage", "Abbreviation": "ABLB" }
    ]
  }
  // ... other rules
}
```


## 📊 Output

- Console: Colored, visual feedback for each resource 
- JSON report: Saved by default in .adf-linter/linter_results.json

Example: 
```pgsql
❌ dataset/DS_INVALID_NAME.json
   - Dataset detail part 'invalidName' must be uppercase letters, numbers or underscores only
✅ pipeline/Master_ExamplePipeline.json passed
```

## 📝 License

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