Checks reference¶
Every check plc-st-review ships with, what it catches, why it exists, how to configure it, an ST trigger, what the bot posts, and a suggested fix. See check-limitations.md for what each check deliberately doesn't catch.
Live demo: every check in this document fires at least once on PR #1, where you can see the exact inline comments the bot posts.
Common settings (apply to every check)¶
Two knobs work on every check, set in .plc-st-review.yml:
severity_overrides:
CATEGORY_NAME: error # raise / lower the severity for this category
disabled_checks:
- CATEGORY_NAME # turn the check off entirely
Each per-check page below only lists additional knobs (check-specific config, prefix lists, etc.).
Diff-based checks¶
These compare the before and after trees of a PR. Every finding implies a change happened in this PR.
- SIGNATURE_CHANGED
- CALL_SITE_OUTDATED
- TYPE_MISMATCH
- ENUM_VALUE_REMOVED
- ENUM_VALUE_ADDED
- TIMER_VALUE_CHANGED
- CONSTANT_VALUE_CHANGED
- COMMENT_ONLY
- ARRAY_BOUNDS_CHANGED
- STATE_UNHANDLED
- UNREACHABLE_CODE
- LOOP_BOUNDS_CHANGED
- POU_DELETED
- POU_RENAMED
- METHOD_ADDED_TO_INTERFACE
- INHERITANCE_CHANGED
- PRAGMA_CHANGED
- UNUSED_VAR_INTRODUCED
- COUNTER_VALUE_CHANGED
Static integrity checks¶
These run on the after tree alone and surface bugs that compile but mis-behave. Each one filters out findings already present in the before tree so the check only flags new problems introduced in the PR.
- ENUM_VALUE_UNUSED
- ENUM_MEMBER_UNKNOWN
- ARRAY_INDEX_OUT_OF_BOUNDS
- DIVISION_BY_ZERO
- INFINITE_LOOP
- LOOP_BOUNDS_REVERSED
FB-instance checks¶
These target standard IEC 61131-3 function-block patterns (TON, CTU, R_TRIG, SR/RS, etc.), wiring mistakes that won't trip a normal compiler but produce wrong runtime behavior.
- COUNTER_PV_ZERO
- TIMER_PT_ZERO
- TIMER_NOT_DRIVEN
- EDGE_TRIG_REUSED
- FB_INSTANCE_DOUBLE_CALL
- FB_INSTANCE_NEVER_CALLED
- BISTABLE_DOMINANCE_MISMATCH
Code-quality and style checks¶
These are stylistic / hygiene checks. Most ship at info severity and stay off your blocking gate by default; raise them in .plc-st-review.yml once your team agrees on a convention.
- EMPTY_STATEMENT
- UNUSED_RETURN_VALUE
- ARRAY_SINGLE_ELEMENT
- VARIABLE_SHADOWING
- UNQUALIFIED_ENUM_CONSTANT
- IDENTIFIER_CASE_MISMATCH
- UNUSED_INPUT_VAR
- INPUT_VAR_WRITTEN
- BOOL_COMPARISON
- REAL_EQUALITY
- MULTIPLE_EXIT_POINTS
- ASSIGNMENT_IN_CONDITION
- COMMENTED_OUT_CODE
- RECURSIVE_CALL
- FORBIDDEN_SYMBOL
- ADDRESS_OF_CONSTANT
- UNUSED_OUTPUT_VAR
- OUTPUT_VAR_READ_INTERNALLY
- NESTED_COMMENTS
- NAMING_CONVENTION
Using a check in your PR¶
plc-st-review runs automatically once you've set up the GitLab or GitHub integration (see gitlab-setup.md / github-setup.md). Every check above lands as either an inline comment on the relevant .st line or as part of the summary issue / discussion comment when the affected line falls outside the PR's diff hunks.
To suppress a check for a single repo, add it to disabled_checks in .plc-st-review.yml. To raise or lower its severity, use severity_overrides. See tuning-severities.md for the tuning ramp.
To compose policy across many repos, naming conventions, severity profiles, forbidden symbols, use extends: to pull from shared preset files. See preset-packs.md.