Getting Started Guide (Deprecated)
This page is outdated. Please refer to the current documentation:
Quick setup guide for using the Empirical Ignition Perspective Component Schema validation tools.
đ Prerequisitesâ
Before you begin, ensure you have:
- Python 3.10 or newer installed
- UV package manager (recommended) or pip
- Access to Ignition Perspective project files
- Basic familiarity with Ignition development
đ ī¸ Installationâ
Option 1: Using UV (Recommended)â
# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup the project
git clone <repository-url>
cd empirical-ignition-perspective-component-schema
# Install dependencies
uv sync
Option 2: Using pipâ
# Clone the project
git clone <repository-url>
cd empirical-ignition-perspective-component-schema
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
đ¯ Basic Usageâ
1. Lint Any Directoryâ
Point the linter at any directory and it recursively finds view.json and .py files:
# Lint everything under a folder
ignition-lint --target /path/to/any/folder
# With detailed output
ignition-lint -t /path/to/any/folder --verbose
# JSON output for programmatic use
ignition-lint -t /path/to/any/folder --report-format json
2. Lint a Full Ignition Projectâ
If your directory follows the standard Ignition layout:
# All checks (Perspective, naming, scripts)
ignition-lint --project /path/to/ignition/project --profile full
3. Lint a Subdirectoryâ
Focus on just one part of the project:
# Only Perspective views in a specific folder
ignition-lint -t /path/to/views/MyScreen --checks perspective
# Only scripts
ignition-lint -t /path/to/scripts --checks scripts
đ Understanding Resultsâ
Severity Levelsâ
- â ERROR: Critical issues that will cause runtime failures
- â ī¸ WARNING: Compatibility or best practice issues
- âšī¸ INFO: Informational insights and suggestions
- đ STYLE: Code style and documentation improvements
Common Issues and Fixesâ
Component Schema Violationsâ
# Example error
â SCHEMA_VALIDATION: 'style-list' is not one of ['scalar', 'color', 'object']
# Fix: Update the binding transform outputType
"outputType": "scalar" // Instead of "style-list"
Jython Script Issuesâ
# Example error
â JYTHON_IGNITION_INDENTATION_REQUIRED: Lines [1, 2] have no indentation
# Fix: Ensure ALL lines in Ignition inline scripts are indented
if value == -1: # â No indentation
return False
if value == -1: # â
Properly indented
return False
Python Syntax Issuesâ
# Example error
â SYNTAX_ERROR: Missing parentheses in call to 'print'
# Fix: Use function syntax instead of statement
print 'hello' # â Python 2 style
print('hello') # â
Python 3 compatible
đ§ Configurationâ
Project-Specific Configurationâ
Create a .ignition-lint.json file in your project root:
{
"perspective": {
"views_directory": "com.inductiveautomation.perspective/views",
"strict_mode": true,
"ignore_patterns": ["**/temp/**", "**/backup/**"]
},
"scripts": {
"script_directory": "ignition/script-python",
"python_version": "2.7",
"check_imports": true
},
"output": {
"format": "json",
"include_suggestions": true,
"verbose": false
}
}
IDE Integrationâ
VSCode Setupâ
- Install the Python extension
- Add to your
settings.json:
{
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"files.associations": {
"*.json": "jsonc"
},
"json.schemas": [
{
"fileMatch": ["**/perspective/views/**/view.json"],
"url": "./schemas/core-ia-components-schema-robust.json"
}
]
}
Pre-commit Hooksâ
Add to .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: ignition-perspective-lint
name: Ignition Perspective Linter
entry: uv run python tools/ignition-perspective-linter.py
language: system
files: \.json$
args: [--target, .]
pass_filenames: false
đ¯ Common Workflowsâ
Development Workflowâ
# 1. Edit your Perspective views or scripts
# 2. Validate changes
uv run python tools/ignition-perspective-linter.py --target path/to/modified/views
# 3. Fix any issues found
# 4. Re-validate to confirm fixes
# 5. Commit your changes
CI/CD Integrationâ
# Add to your CI pipeline
name: Validate Ignition Project
run: |
uv run python tools/ignition-perspective-linter.py --target ./perspective/views
uv run python tools/ignition-script-linter.py --target ./script-python
# Fail the build if critical errors are found
if [ $? -ne 0 ]; then
echo "Critical validation errors found!"
exit 1
fi
Code Review Processâ
# Before creating a pull request
uv run python tools/ignition-perspective-linter.py --target . --output pr-validation.json
# Share the validation results with your team
# Address any ERROR or WARNING level issues
# Document any intentional deviations
đ Troubleshootingâ
Common Installation Issuesâ
UV not found:
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Restart your terminal
Permission errors:
# Use user installation
pip install --user -r requirements.txt
Module not found errors:
# Ensure you're in the right directory and environment
cd empirical-ignition-perspective-component-schema
uv sync # or pip install -r requirements.txt
Common Validation Issuesâ
Too many style issues:
# Suppress noisy rules during initial adoption
ignition-lint -p ./my-project --profile full --ignore-codes NAMING_PARAMETER,MISSING_DOCSTRING,LONG_LINE
# Or create a .ignition-lintignore file for path-based suppression
# See docs/SUPPRESSION.md for the full guide
False positives on valid code:
- Suppress individual lines with
# ignition-lint: disable=CODE(Python scripts only) - Use
.ignition-lintignoreto exclude generated or template directories - Check if your Ignition version is supported
- Report persistent false positives as GitHub issues
Performance with large projects:
# Process directories in smaller batches
uv run python tools/ignition-perspective-linter.py --target ./views/specific-folder
đ Next Stepsâ
- Read the Documentation: Explore
docs/for detailed guides - Review Examples: Check
examples/for real-world usage patterns - Integrate with Your Workflow: Set up pre-commit hooks and CI/CD
- Customize for Your Project: Configure validation rules for your needs
- Contribute Back: Share improvements and report issues
đ¤ Getting Helpâ
- Documentation: Check the
docs/directory - Examples: Review the
examples/directory - Issues: Open a GitHub issue for bugs or questions
- Community: Join the discussion in project issues
Next: Read LINTER_USAGE.md for detailed tool documentation