Skip to main content

Lint Suppression Guide

Note: The canonical version of this guide is docs/guides/suppression.md. This file is kept for backwards compatibility.

Control which rules fire and where. Ignition Lint provides three complementary suppression mechanisms, each suited to a different scope:

MechanismScopeApplies ToHow
--ignore-codesGlobalAll filesCLI flag / env var
.ignition-lintignorePer-projectFile path patternsGitignore-style file
Inline commentsPer-line / per-filePython scripts onlySource comments

All three mechanisms stack: an issue is suppressed if any mechanism matches it.


1. --ignore-codes CLI Flag

Suppress one or more rule codes globally across the entire run.

# Single code
ignition-lint -p /path/to/project --ignore-codes NAMING_PARAMETER

# Multiple codes (comma-separated, no spaces)
ignition-lint -p /path/to/project --ignore-codes NAMING_PARAMETER,NAMING_COMPONENT,LONG_LINE

GitHub Actions

- uses: whiskeyhouse/ignition-lint@v1
with:
project_path: ./my-project
ignore_codes: "NAMING_PARAMETER,NAMING_COMPONENT"

MCP Server

All MCP tool functions accept an optional ignore_codes parameter:

# Example: calling the lint_ignition_project MCP tool
lint_ignition_project(
project_path="/path/to/project",
ignore_codes="NAMING_PARAMETER,LONG_LINE",
)

Environment Variable (Actions entry point)

export INPUT_IGNORE_CODES="NAMING_PARAMETER,NAMING_COMPONENT"
ignition-lint-action

2. .ignition-lintignore File

Place a .ignition-lintignore file in the project root directory (the path passed to --project). The linter reads it automatically.

Syntax

Each line is either a blanket pattern (suppresses all rules) or a rule-specific pattern (suppresses only named codes). Comments and blank lines are ignored.

# Blank lines and lines starting with # are ignored

# Blanket ignore: suppress ALL rules for matching files
scripts/generated/**
tests/fixtures/**

# Rule-specific ignore: suppress only named codes for matching files
com.inductiveautomation.perspective/views/_REFERENCE/**:NAMING_COMPONENT,GENERIC_COMPONENT_NAME
ignition/script-python/legacy/**:MISSING_DOCSTRING,JYTHON_PRINT_STATEMENT

Pattern Format

Patterns use gitignore / glob syntax (powered by the pathspec library with gitwildmatch mode):

PatternMatches
*.pyAll .py files in the project root
**/*.pyAll .py files at any depth
scripts/generated/**Everything under scripts/generated/
views/_REF*/Directories starting with _REF under views/

Rule-Specific Format

Append :CODE1,CODE2 after the pattern (no spaces around the colon):

pattern:CODE1,CODE2

A line without a colon is treated as a blanket pattern. A line with a colon splits into a path pattern and a set of codes.

Explicit File Path

Override the default location with --ignore-file:

ignition-lint -p /path/to/project --ignore-file /shared/config/.ignition-lintignore

Path Resolution

Paths in the ignore file are matched relative to the project root. For example, given --project /home/user/my-project, the pattern scripts/generated/** matches files under /home/user/my-project/scripts/generated/.


3. Inline Comments (Python Scripts Only)

Suppress specific rules directly in .py source files. This mechanism only applies to standalone Python scripts in script-python directories. It does not apply to view.json files (comments are invalid JSON) or inline Jython snippets (stored as JSON strings).

Comment Directives

DirectiveScopePlacement
disable-file=CODESEntire fileMust appear in the first 10 lines
disable-next=CODESNext line onlyLine immediately before the target
disable-line=CODESCurrent lineOn the same line as the target
disable=CODESCurrent lineShorthand for disable-line

All directives use the prefix # ignition-lint: followed by the directive and a comma-separated list of rule codes.

Examples

Suppress a rule for the entire file

# ignition-lint: disable-file=MISSING_DOCSTRING
# This legacy module predates our docstring requirements.

def get_tag_value(path):
return system.tag.readBlocking([path])[0].value

def set_tag_value(path, value):
system.tag.writeBlocking([path], [value])

Suppress a rule on a single line

x = build_very_long_configuration_string(param_a, param_b, param_c, param_d)  # ignition-lint: disable=LONG_LINE

Suppress a rule on the next line

# ignition-lint: disable-next=IGNITION_SYSTEM_OVERRIDE
system = get_custom_proxy() # intentional override for testing

Suppress multiple rules

# ignition-lint: disable-file=MISSING_DOCSTRING,LONG_LINE
x = 1  # ignition-lint: disable=LONG_LINE,JYTHON_PRINT_STATEMENT

Behavior Notes

  • disable-file is only recognised if it appears within the first 10 lines of the file. Comments placed later are silently ignored.
  • disable-next applies to exactly the line immediately following the comment. It does not cascade.
  • Multiple directives can coexist in the same file.
  • The FILE_READ_ERROR code cannot be suppressed via inline comments (it fires before the file content is parsed).

Rule Code Reference

Below is a non-exhaustive list of rule codes you can suppress. Run the linter with --report-format json to see the exact codes produced for your project.

Perspective / Schema Rules

CodeSeverityDescription
SCHEMA_VALIDATIONERRORComponent structure doesn't match schema
GENERIC_COMPONENT_NAMESTYLEComponent has a non-descriptive default name
MISSING_ICON_PATHWARNINGIcon component missing required path prop
SINGLE_CHILD_FLEXSTYLEFlex container with only one child

Naming Rules

CodeSeverityDescription
NAMING_COMPONENTSTYLEComponent name doesn't match naming style
NAMING_PARAMETERSTYLEParameter or custom property key doesn't match naming style

Script Rules

CodeSeverityDescription
SYNTAX_ERRORERRORPython syntax error
FILE_READ_ERRORERRORCould not read file
LONG_LINESTYLELine exceeds 120 characters
MISSING_DOCSTRINGSTYLEPublic function missing docstring
GLOBAL_VARIABLE_USAGEWARNINGglobal keyword usage
JYTHON_PRINT_STATEMENTWARNINGprint x statement syntax
JYTHON_DEPRECATED_ITERITEMSWARNING.iteritems() usage
JYTHON_XRANGE_USAGEINFOxrange() usage
JYTHON_STRING_TYPESWARNINGbasestring/unicode usage
IGNITION_SYSTEM_OVERRIDEERROROverriding system variable
IGNITION_HARDCODED_GATEWAYWARNINGHardcoded gateway URL
IGNITION_DEBUG_PRINTINFODebug print statement
IGNITION_UNKNOWN_SYSTEM_CALLWARNINGUnrecognised system.* call
JAVA_INTEGRATION_DETECTEDINFOJava imports present
PARSE_WARNINGWARNINGFile could not be fully parsed

Jython Inline Rules (from view.json scripts)

CodeSeverityDescription
JYTHON_SYNTAX_ERRORERRORSyntax error in inline script
JYTHON_IGNITION_INDENTATION_REQUIREDERRORMissing required indentation
JYTHON_PRINT_STATEMENTWARNINGPrint statement in inline script
JYTHON_PREFER_PERSPECTIVE_PRINTINFOPrefer system.perspective.print()

Report Output

When issues are suppressed, the report summary includes a suppression count:

============================================================
📊 LINT RESULTS
============================================================
📋 Issues by severity:
❌ Error: 117
⚠️ Warning: 285
ℹ️ Info: 702
💡 Style: 865

🔇 716 issues suppressed

[... detailed issue list ...]

If all issues are suppressed:

============================================================
📊 LINT RESULTS
============================================================
✅ No issues found
🔇 2685 issues suppressed

The suppressed count reflects issues matched by --ignore-codes or .ignition-lintignore. Inline comment suppressions happen inside the script linter before issues reach the report, so they are not included in this count.


Examples

Gradual Adoption

Suppress noisy rules during initial rollout, then remove suppressions as the codebase is cleaned up:

# Phase 1: Focus on errors only
ignition-lint -p ./my-project --profile full \
--ignore-codes NAMING_PARAMETER,NAMING_COMPONENT,MISSING_DOCSTRING,LONG_LINE,GENERIC_COMPONENT_NAME

# Phase 2: Address naming
ignition-lint -p ./my-project --profile full \
--ignore-codes MISSING_DOCSTRING,LONG_LINE

# Phase 3: Full enforcement
ignition-lint -p ./my-project --profile full

Ignore Generated / Reference Views

# .ignition-lintignore
# Auto-generated views from Designer templates
com.inductiveautomation.perspective/views/_generated/**

# Reference/template views exempt from naming rules
com.inductiveautomation.perspective/views/_REFERENCE/**:NAMING_COMPONENT,GENERIC_COMPONENT_NAME

# Legacy scripts pre-dating docstring requirements
ignition/script-python/legacy/**:MISSING_DOCSTRING

CI Pipeline with Selective Suppression

name: Ignition Lint
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: whiskeyhouse/ignition-lint@v1
with:
project_path: .
lint_type: all
ignore_codes: "NAMING_PARAMETER"
fail_on: error